Rails Template
A minimal Rails API template for creating MCP (Model Context Protocol) servers with robust tool execution capabilities and examples.
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
Maintainer
Works with
Installation
Manual Installation
npx mcp-rails-templateConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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_templateInstall 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 .envStart PostgreSQL with Docker Compose
Bring up the PostgreSQL container (runs on port 5466 by default).
make upStart the Rails MCP server
Launch the server on localhost:3002 (default) where it exposes the /mcp endpoint.
bin/rails sTest 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/mcpConfigure 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/mcpRails 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.
Rails Template Alternatives — Similar Coding Agents Servers
Looking for alternatives to Rails Template? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
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.
Set Up Rails Template in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.