MCP Server Plugin logo

MCP Server Plugin

Community
raja-jamwal

Allows AI assistants to eval and verify rails/ruby code changes at lighting-speed access without the need restart server.

Publisherraja-jamwal
Repositoryrails-mcp
LanguageRuby
Forks
6
Stars
12
Available tools
0
Transport typestreamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP Server Plugin exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    12 stars and 6 forks from the linked repository.

rails-mcp

Setting this up? Point your coding agent (Cursor, Claude Code, etc.) at llms.txt and ask it to self-configure rails-mcp in your project.

A Ruby gem that provides AI assistants with ruby code execution capabilities within the context of existing running application server. Think of it giving AI assistant lighting-speed access to ruby console without the need to write script, reload or restart.

Works with Rails, Sinatra, Hanami, Roda, and any other Rack-based framework. The code is executed in your application's context for debugging and investigation.

YouTube Link

Used at

Used at Apollo.io against a Rails codebase with 20k+ Ruby files.

Use cases

  1. Learn a new codebase or code areas quickly. With your AI client and a running server, you can ask it to research while executing snippets from your actual application code. It effectively acts as an in-loop code-verification block.
  2. Perform quick, preliminary investigations of customer escalations using a read-only copy of the production environment. It can execute your application code, locate models, and run relevant class methods or code paths from the codebase to do preliminary root-cause analysis (RCA). Even better if your application uses an event-sourcing framework (i.e., change logs). The AI client, together with the code-execution capabilities via rails-mcp, can deliver fast preliminary RCAs.
  3. Use it for quick data analytics and export reports as CSV.

Installation

Add this line to your application's Gemfile:

ruby
gem "rails-mcp"

Or install locally for development:

bash
bundle install

Usage

Mounting the MCP Server

Rails (config/routes.rb):

ruby
require "rails_mcp/mcp/server"

Rails.application.routes.draw do
  mount RailsMcp::MCP::Server.new => "/mcp"
end

Rack (config.ru):

ruby
require "rails_mcp"
require "rails_mcp/mcp/server"

map "/mcp" do
  run RailsMcp::MCP::Server.new
end

Sinatra:

ruby
require "rails_mcp/mcp/server"

mount RailsMcp::MCP::Server.new, at: "/mcp"

Starting the Server

bash
# Standalone with Rackup
bundle exec rackup -p 9292

# With Rails
bundle exec rails server

Environment-scoped mounting

This gem ships without authentication — the MCP endpoint will accept any request that reaches it. You are responsible for ensuring it is only mounted where appropriate. A typical Rails setup gates it on environment:

ruby
Rails.application.routes.draw do
  mount RailsMcp::MCP::Server.new => "/mcp" if Rails.env.development?
end

For staging or production access, combine that with network-level restrictions (firewall, VPC, SSH port-forward, VPN) so the endpoint is never reachable from the open internet.

MCP Protocol

Endpoint

The MCP server exposes a single JSON-RPC endpoint:

  • POST /mcp/rpc - JSON-RPC request and response

Available Tools

evaluate_ruby_code

  • Description: Evaluates Ruby code and returns the result with captured stdout/stderr
  • Parameters:
    • code (string, required): Ruby code to execute

Connecting AI Assistants

Cursor/ Claude Desktop

Add to your MCP client configuration (.cursor/mcp.json for Cursor or claude_desktop_config.json for Claude Desktop):

json
{
  "mcpServers": {
    "rails-mcp": {
      "url": "http://localhost:3001/mcp/rpc"
    }
  }
}

For Claude Code, add it from the command line:

bash
claude mcp add rails-mcp --transport http http://localhost:3001/mcp/rpc

MCP integration in Cursor

Other MCP Clients

Any MCP-compatible client can connect to the server by making JSON-RPC requests to the /mcp/rpc endpoint.

Example with curl:

bash
curl -X POST "http://localhost:3001/mcp/rpc" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list"
  }'

Optional: Client Verification

If you want a second layer of defense beyond environment-scoped mounting and network gating, enable client verification when constructing the server. When enabled, every request must carry an X-Rails-Mcp-Token header whose value matches ENV["RAILS_MCP_TOKEN"] (minimum 8 characters); otherwise the server responds 401 Unauthorized.

This deliberately uses a custom header (not Authorization: Bearer) and returns no WWW-Authenticate so it stays off the standard MCP/OAuth code path — important when the host Rails app already exposes a separate, product-facing MCP server with DCR / well-known discovery.

ruby
mount RailsMcp::MCP::Server.new(use_client_verification: true) => "/mcp"

Set the token in the host environment:

bash
export RAILS_MCP_TOKEN="<at-least-8-char-secret>"

Claude Code:

bash
claude mcp add rails-mcp --transport http \
  --header "X-Rails-Mcp-Token: $RAILS_MCP_TOKEN" \
  http://localhost:3001/mcp/rpc

Cursor (.cursor/mcp.json):

json
{
  "mcpServers": {
    "rails-mcp": {
      "url": "http://localhost:3001/mcp/rpc",
      "headers": {
        "X-Rails-Mcp-Token": "<at-least-8-char-secret>"
      }
    }
  }
}

Testing

Run the test suite:

bash
bundle exec rspec

Security Warning

⚠️ This gem executes arbitrary Ruby code.

Important security considerations:

  • No built-in authentication. Gate the mount on environment (e.g., if Rails.env.development?) so the endpoint isn't exposed in production by accident
  • Only use in development environments or secure, isolated production environments
  • Rely on network-level restrictions (firewall, VPC, SSH port-forward, VPN) to limit access
  • Consider running in a sandboxed or containerized environment
  • Monitor and log all code execution requests

Concurrency Note

This gem uses global $stdout/$stderr redirection during evaluation, which can clash in multi-threaded servers. For production use with concurrency, consider:

  • Running in a single worker/thread mode
  • Isolating evaluation per request (e.g., via fork)
  • Using a dedicated job worker for code execution

License

MIT License - see LICENSE file for details.

Use MCP Server Plugin MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Server Plugin is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP connects through a hosted MCP server URL in TypingMind.

Add an MCP server URL

Use this when MCP Server Plugin is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for MCP Server Plugin.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the MCP Server Plugin connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the MCP Server Plugin tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the MCP Server Plugin tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Server Plugin to help me with this task?
MCP Server Plugin
Sure. I read it.
Here is what I found using MCP Server Plugin.

Frequently asked questions

What is the MCP Server Plugin MCP server used for?

MCP Server Plugin is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP Server Plugin MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Server Plugin with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP Server Plugin MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP Server Plugin connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Server Plugin MCP to TypingMind?

MCP Server Plugin can be connected in TypingMind by adding its hosted MCP server URL. This is useful when you want a remote MCP connection that is available from your TypingMind workspace.

What tools does MCP Server Plugin MCP provide in TypingMind?

MCP Server Plugin exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP Server Plugin MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Server Plugin requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇