Rails Template

v1.0.0Coding Agentsstable

A minimal Rails API template for creating MCP (Model Context Protocol) servers with robust tool execution capabilities and examples.

agentsclaudemcp-serverrails-api
Share:
42
Stars
0
Downloads
0
Weekly
0/5

What is Rails Template?

Rails Template is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to minimal rails api template for creating mcp (model context protocol) servers with robust tool execution capabilities and examples.

A minimal Rails API template for creating MCP (Model Context Protocol) servers with robust tool execution capabilities and examples.

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A minimal Rails API template for creating MCP (Model Context

Use Cases

Create MCP servers with Rails API template.
Execute tools robustly with example implementations.
seuros

Maintainer

LicenseMIT
Languageruby
Versionv1.0.0
UpdatedApr 3, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-rails-template

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Rails Template

mcp-rails-template is a minimal Rails API application that serves as a working template for building your own MCP (Model Context Protocol) servers using Ruby on Rails. It ships with several example tools — including gem dependency inspection, weather fetching via Open-Meteo, RuboCop code analysis, and Ruby static analysis — along with JWT authentication and a ready-to-run Docker Compose setup. Developers use it as a starting point to scaffold production-grade MCP servers in Rails, adapting the included tool examples to their own domain-specific use cases.

Prerequisites

  • Ruby 3.2 or later and Bundler installed
  • Rails 7.1 or later
  • Docker and Docker Compose (for the included PostgreSQL setup)
  • Node.js with npx (for MCP Inspector testing)
  • An MCP client such as Claude Desktop or Claude Code
1

Clone the template repository

Clone the mcp_rails_template repo to use it as the starting point for your own Rails MCP server.

git clone https://github.com/seuros/mcp_rails_template.git
cd mcp_rails_template
2

Install dependencies and set up the environment

Run the setup script to install gems and prepare the database, then copy the example environment file.

bin/setup
cp .env.example .env
3

Start PostgreSQL with Docker Compose

Bring up the PostgreSQL container (runs on port 5466 by default).

make up
4

Start the Rails MCP server

Launch the server on localhost:3002 (default) where it exposes the /mcp endpoint.

bin/rails s
5

Test with MCP Inspector

Use MCP Inspector to verify all tools are responding correctly before connecting a production client. Use [email protected] / password123 as credentials.

npx @modelcontextprotocol/inspector --url http://localhost:3002/mcp
6

Configure your MCP client

Point Claude Desktop or Claude Code at your running Rails server endpoint. Generate a JWT token from the Rails console for authenticated access.

curl -H "Authorization: Bearer <your-jwt-token>" http://localhost:3002/mcp

Rails Template Examples

Client configuration

Claude Desktop config connecting to the locally running Rails MCP server over HTTP.

{
  "mcpServers": {
    "rails-mcp": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:3002/mcp"],
      "env": {}
    }
  }
}

Prompts to try

Sample prompts that use the built-in tools: dependency_info_tool, rubocop_tool, ruby_code_analyzer_tool, and fetch_weather_by_location_tool.

- "List all gems in this Rails project and their versions"
- "Analyze this Ruby code for style issues: def foo(x); x+1; end"
- "What classes and modules are defined in this project's app/models directory?"
- "Get the current weather forecast for latitude 40.7128, longitude -74.0060"

Troubleshooting Rails Template

bin/setup fails with database connection errors

Make sure Docker Compose is running first with 'make up'. The database runs on port 5466 — verify no other service is using that port.

JWT authentication returns 401 Unauthorized

Generate a fresh JWT token from the Rails console: rails console, then user.generate_jwt(expires_in: 10.years). Include it in the Authorization: Bearer header.

MCP Inspector cannot connect to the server

Confirm the Rails server is running on port 3002 with bin/rails s, and that you are hitting the /mcp endpoint (not the root path). Check Rails logs for routing errors.

Frequently Asked Questions about Rails Template

What is Rails Template?

Rails Template is a Model Context Protocol (MCP) server that minimal rails api template for creating mcp (model context protocol) servers with robust tool execution capabilities and examples. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Rails Template?

Follow the installation instructions on the Rails Template GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Rails Template?

Rails Template works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Rails Template free to use?

Yes, Rails Template is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-rails-template": { "command": "npx", "args": ["-y", "mcp-rails-template"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Rails Template?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides