A minimal Rails API template for creating MCP (Model Context Protocol) servers with robust tool execution capabilities and examples.
MCPpedia last refreshed this data
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"mcp_rails_template": {
"url": "http://localhost:8080/mcp",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A simple Ruby on Rails application demonstrating how to integrate and use the ActionMCP gem. The gem source code can be found on GitHub at https://github.com/seuros/mcp.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Click any tool to inspect its schema.
gemfile_templateProvides access to the project's Gemfile dependencies as a JSON resource. Uses Bundler to fetch gems based on the specified environment (production, test, development, or default).
gemfile://{environment}
epic_adventure_promptGenerates a short, narrative adventure story based on a provided hero name and adventure type (fantasy, sci-fi, mystery). Can optionally include a placeholder image data string.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Manage Supabase projects — databases, auth, storage, and edge functions
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors
MCP Security Weekly
Get CVE alerts and security updates for Mcp_rails_template and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A simple Ruby on Rails application demonstrating how to integrate and use the ActionMCP gem. The gem source code can be found on GitHub at https://github.com/seuros/mcp.
This application showcases how to define and use MCP components within a Rails project.
.ruby-version for recommended version)git clone https://github.com/seuros/mcp_rails_template.git
cd mcp_rails_template
bin/setup
Copy the provided .env.example file:
cp .env.example .env
Edit .env and fill in necessary values according to your setup (especially any required API keys for tools like fetch_weather_by_location_tool).
You can quickly spin up a temporary PostgreSQL instance using Docker:
make up
This will start PostgreSQL on port 5466.
Alternatively, configure your own PostgreSQL database by editing config/database.yml.
Launch the Rails server:
bin/rails s
The app will be available at http://localhost:3002.
ActionMCP runs as a standalone server on port 62770 (via mcp.ru). Nginx proxies /mcp requests to this server.
Client → nginx:8080/mcp → ActionMCP:62770
This application uses JWT-based authentication via the ApplicationGateway class.
| Password | Role | |
|---|---|---|
| test@example.com | password123 | Test User |
| admin@example.com | password123 | Admin User |
bin/rails db:fixtures:load FIXTURES=users
# In Rails console
user = User.find_by(email: 'test@example.com')
token = user.generate_jwt(expires_in: 10.years) # Long-lived for demo
A .mcp.json file is provided with a pre-configured long-lived token:
{
"mcpServers": {
"mcp_rails_template": {
"url": "http://localhost:8080/mcp",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}
Or test manually with curl:
curl -H "Authorization: Bearer <token>" http://localhost:8080/mcp
The gateway is configured in config/mcp.yml:
development:
authentication: ["jwt"]
gateway_class: "ApplicationGateway"
class MyTool < ApplicationMCPTool
def perform
render text: "Hello #{current_user.name}!"
end
end
app/mcp/)This application includes several examples of ActionMCP components:
app/mcp/prompts/)epic_adventure_prompt.rb: Generates a short, narrative adventure story based on a provided hero name and adventure type (fantasy, sci-fi, mystery). It can optionally include a placeholder image data string.app/mcp/resource_templates/)gemfile_template.rb: Provides access to the project's Gemfile dependencies as a JSON resource. It uses Bundler to fetch gems based on the specified environment (production, test, development, or default). The resource URI follows the pattern gemfile://{environment}.app/mcp/tools/)Tools define specific actions that a language model can request to be executed.
dependency_info_tool.rb: Retrieves dependency information using Bundler from the Gemfile and Gemfile.lock. It also checks for a .gemspec file for runtime dependencies. It outputs separate JSON resources for production, test, and runtime dependencies.fetch_weather_by_location_tool.rb: Fetches weather forecast data from the Open-Meteo API (https://api.open-meteo.com) based on provided latitude and longitude coordinates. It returns the raw JSON response from t