MCP.so
登录
R

Rails AI Context — Zero-config MCP server for Rails apps

@crisnahine

关于 Rails AI Context — Zero-config MCP server for Rails apps

Automatically introspects your Rails application and exposes schema, models, routes, controllers, views, auth, tests, config, and conventions to AI assistants via MCP. 9 read-only tools, zero configuration. Works with Claude Code, Cursor, Windsurf, and GitHub Copilot.

基本信息

分类

开发工具

传输方式

stdio

发布者

crisnahine

提交者

Cris Joseph

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "rails-ai-context": {
      "command": "bundle",
      "args": [
        "exec",
        "rails",
        "ai:serve"
      ]
    }
  }
}

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is Rails AI Context — Zero-config MCP server for Rails apps?

An MCP server gem (rails-ai-context) that automatically introspects your Rails app’s database schema, models, routes, controllers, gems, and conventions, then exposes 13 read-only tools via the Model Context Protocol. It is built for Rails developers using AI assistants (Claude Code, Cursor, Copilot, Windsurf, OpenCode) who want the AI to understand their app without manually explaining it each session.

How to use Rails AI Context — Zero-config MCP server for Rails apps?

Add the gem (bundle add rails-ai-context), run rails generate rails_ai_context:install, then rails ai:context. This creates .mcp.json for auto-discovery by Claude Code and Cursor. Optionally start the MCP server manually with rails ai:serve or enable HTTP transport. Configuration is done in config/initializers/rails_ai_context.rb.

Key features of Rails AI Context — Zero-config MCP server for Rails apps

  • 13 read-only MCP tools covering schema, models, routes, controllers, views, config, and more
  • 29 built-in introspectors (13 active by default in :standard preset)
  • Generates context files for Claude Code, Cursor, OpenCode, Windsurf, and GitHub Copilot
  • Smart detail levels (summary, standard, full) to minimize token usage
  • Token savings of up to 37% on small apps and estimated 80% on large apps
  • All tools are read-only – no changes to your Rails codebase

Use cases of Rails AI Context — Zero-config MCP server for Rails apps

  • Let an AI assistant add a new model or migration without rediscovering the database schema
  • Answer questions about existing routes, controllers, and associations using MCP tools
  • Reduce token consumption when asking complex multi-file changes
  • Provide AI context for debugging or refactoring across models, controllers, and views
  • Onboard new developers faster by feeding the full app structure to AI coding assistants

FAQ from Rails AI Context — Zero-config MCP server for Rails apps

What is required to run it?

A Rails application with Ruby on Rails. The gem is installed via Bundler and works with any Rails app (version 6.0+ is assumed, though not explicitly stated; the README covers Rails 7+ patterns). No external database access changes are needed.

How does it save tokens compared to not using it?

Its MCP tools return summaries first (≈55 tokens) and only fetch full details on demand, replacing expensive full-file reads. Benchmarks in the README show a 37% token reduction on a small 5-model app; savings grow with app size.

Which AI assistants are supported?

Claude Code, Cursor, OpenCode, Windsurf, and GitHub Copilot. Claude Desktop is also supported with manual MCP configuration.

Can I customize which parts of my app are introspected?

Yes. Set config.preset = :standard (default, 13 introspectors) or :full (28 introspectors, exluding database_stats which is PostgreSQL-only opt-in). You can also cherry-pick introspectors via config.introspectors += %i[...].

Is the gem read-only and safe for production?

All MCP tools are read-only. They query the Rails app’s internal state (e.g., ActiveRecord::Base.connection.tables) and never write to the database or file system. The generated context files are plain markdown/JSON and can be regenerated at any time.

评论

开发工具 分类下的更多 MCP 服务器