- Home
- MCP servers
- Action MCP Rails Server
Action MCP Rails Server
- other
40
GitHub Stars
other
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You run an MCP server powered by a Rails-based ActionMCP engine. It exposes an MCP endpoint at /action_mcp that lets you send requests from an MCP client to interact with Rails components, prompts, tools, and templates defined in the app. This setup is useful for building dynamic, model-assisted workflows that leverage Ruby tooling, code analysis, and external APIs from a single MCP surface.
How to use
You connect your MCP client to the server’s MCP endpoint and issue actions that trigger prompts, tool executions, or resource fetches defined in the engine. Begin by starting the Rails server so the MCP endpoint is reachable, then use the MCP client to request a prompt, run a tool, or fetch a resource. You can index or query available components through the MCP surface, and you can chain prompts with tool outputs to build complex workflows.
How to install
Prerequisites: Ruby, PostgreSQL (or Docker), and a suitable runtime for your environment.
git clone https://github.com/seuros/mcp_rails_template.git
cd mcp_rails_template
bin/setup
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).
make up
This will start PostgreSQL in a temporary Docker container on port 5466. If you prefer to use a locally configured PostgreSQL, edit `config/database.yml` accordingly.
bin/rails s
Open the app at http://localhost:3002. The MCP engine is mounted under /action_mcp by default, ready to be accessed by your MCP client.
## Additional notes
Security and configuration notes: ensure your environment variables in `.env` are kept secure and never committed to version control. If you rely on external tools or APIs (for example, weather data tools), verify API keys and rate limits are properly managed. You may run the server with a separate database or in a containerized environment to isolate development from production settings.
Operational notes: to test MCP functionality interactively, you can use the MCP Inspector client after your Rails server is running, pointing it at the MCP URL `http://localhost:3002/action_mcp` to explore prompts, resources, and tools exposed by the engine.
## Troubleshooting
If the MCP endpoint is not reachable, verify that the Rails server is running (`bin/rails s`) and that there are no port conflicts. Check logs for startup messages related to the ActionMCP engine mounted at `/action_mcp`. If PostgreSQL fails to start, confirm Docker is running (if you used `make up`) and that the container port mappings do not conflict with existing services.
## Available tools
### dependency\_info\_tool
Retrieves Bundler dependency information from Gemfile and Gemfile.lock, and checks for a .gemspec for runtime dependencies; outputs separate JSON resources for production, test, and runtime dependencies.
### fetch\_weather\_by\_location\_tool
Fetches weather forecast data from the Open-Meteo API using provided latitude and longitude; returns the raw API JSON response.
### rubocop\_tool
Analyzes a Ruby code snippet using RuboCop and reports style or quality offenses with details such as rule name, message, line, and column.
### ruby\_code\_analyzer\_tool
Performs static analysis of Ruby code in the project to index classes, modules, and methods; supports listing details for a given class/module or method including source snippets.