Skip to main content
Glama
theashleygross

rails-routes-mcp

rails-routes-mcp

A two-tool MCP server in Ruby for a Rails route table. Stdio JSON-RPC. Built so RubyMine 2025.2+ can attach it as an MCP client (Claude / Junie talking to this server, alongside RubyMine's own IDE server).

JetBrains' February 2026 post Building LLM-Friendly MCP Tools in RubyMine is the design spec: paginate, filter, return file+line for the next editor jump, do not dump bin/rails routes.

Portfolio piece. Ships a 15-route shop catalog so CI does not need a Rails app. Point it at a real routes.rb later.

Tools

Tool

What it returns

search_routes

Paginated list (page, page_size ≤ 20). Filters: verb, path_contains, controller. Each row has file and line.

show_route

One route by verb+path, plus next.file / next.line so the agent opens the action in RubyMine without another list call.

Two tools. Not a Rails SDK.

Related MCP server: ACE-MCP

RubyMine

RubyMine already is an MCP server (call hierarchy, get_rails_routes, run configurations). This repo is the other direction: a small server the IDE's AI Assistant consumes.

Settings → Tools → MCP Server → manual stdio config:

{
  "mcpServers": {
    "rails-routes": {
      "command": "ruby",
      "args": ["/absolute/path/to/rails-routes-mcp/bin/rails-routes-mcp"]
    }
  }
}

Or paste Copy Stdio Config from that same settings page and swap in this command.

Eval

ruby evals/run.rb

Committed report: naive rails routes dump is 4.83× a typical shaped page; 8/8 queries fill show_route from verb/path/file/line. See evals/REPORT.md.

Tradeoffs

  • No mcp gem. The protocol surface we need is initialize / tools/list / tools/call. Owning the loop means ruby test/ runs on stock MRI 3.1 with zero bundler. The official Ruby SDK is the right move for Streamable HTTP + Rails mount; this is the stdio slice.

  • Catalog, not bin/rails routes. Parsing a live app is a follow-up. The eval is about payload shape, which does not need Bootsnap.

  • No writes. A generate_controller tool would be a different repo and would need RubyMine's own apply_patch, not a second writer.

Streamlit demo

Ruby stdio is the server. Streamlit is the click-through of search_routes / show_route.

pip install -r requirements.txt
streamlit run app.py

Streamlit Cloud: app file app.py. No secrets.

Test

ruby -Itest test/catalog_test.rb test/server_test.rb
ruby evals/run.rb

What I would do differently

  • Shell out to bin/rails routes --json when RAILS_ROOT is set, with the same pagination wrapper.

  • Add a resource routes://table for clients that prefer resources over tools.

License

MIT. Ashley Gross, 2026.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Exposes Language Server Protocol (LSP) features as MCP tools, enabling IDE-grade semantic navigation including go-to-definition, find references, hover info, and symbols across multiple programming languages (Python, Rust, C/C++, TypeScript/JavaScript, React, HTML, CSS).
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI clients to perform local code search, indexing, and analysis across Java, JavaScript/TypeScript, .NET/C#, and Python projects through the MCP protocol.
    2
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides code intelligence by indexing source code into SQLite and offering MCP tools for symbol search, flow tracing, and context retrieval to assist with code navigation and understanding.

View all related MCP servers

Related MCP Connectors

  • A MCP server built for developers enabling Git based project management with project and personal…

  • Geo-based flight search MCP server. Find more flights between any two places on earth

  • CodeRide eliminates the context reset cycle once and for all. Through MCP integration, it seamless…

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/theashleygross/rails-routes-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server