{"id":25242272,"url":"https://github.com/seuros/mcp_rails_template","last_synced_at":"2025-04-05T20:28:51.432Z","repository":{"id":275927650,"uuid":"927396816","full_name":"seuros/mcp_rails_template","owner":"seuros","description":"A minimal Rails API template for creating MCP (Model Context Protocol) servers with robust tool execution capabilities.","archived":false,"fork":false,"pushed_at":"2025-03-21T20:57:59.000Z","size":82,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T21:29:53.955Z","etag":null,"topics":["agents","claude","mcp-server","rails-api"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seuros.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-04T22:10:26.000Z","updated_at":"2025-03-21T20:57:12.000Z","dependencies_parsed_at":"2025-02-05T10:38:44.837Z","dependency_job_id":"2dab81f2-340d-4b3f-a6bb-38548bf189dc","html_url":"https://github.com/seuros/mcp_rails_template","commit_stats":null,"previous_names":["seuros/mcp_rails_template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seuros%2Fmcp_rails_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seuros%2Fmcp_rails_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seuros%2Fmcp_rails_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seuros%2Fmcp_rails_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seuros","download_url":"https://codeload.github.com/seuros/mcp_rails_template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247397458,"owners_count":20932540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","claude","mcp-server","rails-api"],"created_at":"2025-02-11T22:07:29.172Z","updated_at":"2025-04-05T20:28:51.417Z","avatar_url":"https://github.com/seuros.png","language":"Ruby","funding_links":[],"categories":["📚 Projects (1974 total)","Ruby","🌐 Web Development"],"sub_categories":["MCP Servers"],"readme":"# Action MCP Example 🚀\n\nA 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/action_mcp](https://github.com/seuros/action_mcp).\n\nThis application showcases how to define and use MCP components within a Rails project.\n\n---\n\n## Requirements\n\n- Ruby (see `.ruby-version` for recommended version)\n- PostgreSQL (or Docker)\n\n---\n\n## Getting Started\n\n### 1. Clone and Setup\n\n```bash\ngit clone https://github.com/seuros/mcp_rails_template.git\ncd mcp_rails_template\nbin/setup\n```\n\n### 2. Environment Configuration\n\nCopy the provided `.env.example` file:\n\n```bash\ncp .env.example .env\n```\n\nEdit `.env` and fill in necessary values according to your setup (especially any required API keys for tools like `fetch_weather_by_location_tool`).\n\n### 3. Database Setup\n\nYou can quickly spin up a temporary PostgreSQL instance using Docker:\n\n```bash\nmake up\n```\n\nThis will start PostgreSQL on port `5466`.\n\nAlternatively, configure your own PostgreSQL database by editing `config/database.yml`.\n\n### 4. Run the Application\n\nLaunch the Rails server:\n\n```bash\nbin/rails s\n```\n\nThe app will be available at [http://localhost:3002](http://localhost:3002).\n\n---\n\n## ActionMCP Engine\n\nThe **ActionMCP** engine is mounted at `/action_mcp`. Feel free to mount it at a custom location by modifying the routes in your application.\n\n---\n\n## MCP Components (`app/mcp/`)\n\nThis application includes several examples of ActionMCP components:\n\n### Prompts (`app/mcp/prompts/`)\n\n-   **`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.\n\n### Resource Templates (`app/mcp/resource_templates/`)\n\n-   **`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}`.\n\n### Tools (`app/mcp/tools/`)\n\nTools define specific actions that a language model can request to be executed.\n\n-   **`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.\n-   **`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 the API.\n-   **`rubocop_tool.rb`**: Analyzes a provided Ruby code snippet using the RuboCop gem's API. It reports any detected style or code quality offenses, including the rule name, message, line, and column number.\n-   **`ruby_code_analyzer_tool.rb`**: Performs basic static analysis of Ruby code within the project directory. It indexes classes, modules, and methods by parsing `.rb` files. It can be queried to list all found classes, modules, or methods, or to get details (including source snippets) for a specific class/module (`constant`) or method (`method_details`).\n\n---\n\n## Usage\n\nTo test and inspect MCP functionality interactively, you can use the MCP Inspector:\n\n```bash\nnpx @modelcontextprotocol/inspector --url http://localhost:3002/action_mcp\n```\n\nMake sure your Rails server (`bin/rails s`) is running before executing the inspector command.\n\n---\n\n## Contributing\n\nFeel free to contribute! Open issues or submit pull requests to help improve this example.\n\n---\n\nHappy Coding! ✨🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseuros%2Fmcp_rails_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseuros%2Fmcp_rails_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseuros%2Fmcp_rails_template/lists"}