
maquina-app/rails-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
Railsプロジェクト向けのモデルコンテキストプロトコル(MCP)サーバーのRubyジェム実装です。このサーバーは、LLM(大規模言語モデル)がModel Context...を通じてRailsプロジェクトとやり取りできるようにします。
概要
Railsプロジェクト向けのモデルコンテキストプロトコル(MCP)サーバーのRuby実装です。このサーバーは、LLM(大規模言語モデル)がモデルコンテキストプロトコルを通じてRailsプロジェクトとやり取りできるようにし、コード解析、探索、開発支援の機能を提供します。 モデルコンテキストプロトコル(MCP)は、AIモデルが環境と相互作用するための標準化された方法です。これは、モデルがツールを要求・使用し、リソースにアクセスし、インタラクション中にコンテキストを維持するための構造化された手法を定義しています。 このRails MCPサーバーはMCP仕様を実装し、AIモデルがRailsプロジェクトにアクセスしてコード解析、探索、支援を受けられるようにしています。
概要(AI 翻訳)
Railsプロジェクト向けのモデルコンテキストプロトコル(MCP)サーバーのRuby実装です。このサーバーは、LLM(大規模言語モデル)がモデルコンテキストプロトコルを通じてRailsプロジェクトとやり取りできるようにし、コード解析、探索、開発支援の機能を提供します。
MCPとは何か?
モデルコンテキストプロトコル(MCP)は、AIモデルが環境と相互作用するための標準化された方法です。これは、モデルがツールを要求・使用し、リソースにアクセスし、インタラクション中にコンテキストを維持するための構造化された手法を定義しています。
このRails MCPサーバーはMCP仕様を実装し、AIモデルがRailsプロジェクトにアクセスしてコード解析、探索、支援を受けられるようにしています。
特徴
- 複数のRailsプロジェクトを管理する
- プロジェクトファイルや構造の閲覧
- フィルター機能付きのRailsルートを見る
- モデル情報と関係の検査(プリズム静解析を用いて)
- データベーススキーマ情報の取得
- コントローラとビューの関係を分析する
- 環境構成の解析
- 包括的なRails、Turbo、Stimulus、Kamalのドキュメントへのアクセス
- プログレッシブなツール発見を伴うコンテキスト効率的なアーキテクチャ
- LLMクライアントとのシームレスな統合
設置
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Rails MCP Server
A Ruby implementation of a Model Context Protocol (MCP) server for Rails projects. This server allows LLMs (Large Language Models) to interact with Rails projects through the Model Context Protocol, providing capabilities for code analysis, exploration, and development assistance.
What is MCP?
The Model Context Protocol (MCP) is a standardized way for AI models to interact with their environment. It defines a structured method for models to request and use tools, access resources, and maintain context during interactions.
This Rails MCP Server implements the MCP specification to give AI models access to Rails projects for code analysis, exploration, and assistance.
Features
- Manage multiple Rails projects
- Browse project files and structures
- View Rails routes with filtering options
- Inspect model information and relationships (with Prism static analysis)
- Get database schema information
- Analyze controller-view relationships
- Analyze environment configurations
- Access comprehensive Rails, Turbo, Stimulus, and Kamal documentation
- Context-efficient architecture with progressive tool discovery
- Seamless integration with LLM clients
Installation
Install the gem:
gem install rails-mcp-server
After installation, the following executables will be available in your PATH:
rails-mcp-server- The MCP server itselfrails-mcp-config- Interactive configuration tool (recommended)rails-mcp-setup-claude- Legacy Claude Desktop setup scriptrails-mcp-server-download-resources- Legacy resource download script
Configuration
Using the Configuration Tool (Recommended)
The easiest way to configure the Rails MCP Server is using the interactive configuration tool:
rails-mcp-config
This provides a user-friendly TUI (Terminal User Interface) for:
- Managing Projects: Add, edit, remove, and validate Rails projects
- Downloading Guides: Download Rails, Turbo, Stimulus, and Kamal documentation
- Importing Custom Guides: Add your own markdown documentation
- Claude Desktop Integration: Automatically configure Claude Desktop
The tool uses Gum for an enhanced experience if installed, but works with a basic terminal fallback.
# Install Gum for best experience (optional)
brew install gum # macOS
sudo apt install gum # Debian/Ubuntu
yay -S gum # Arch Linux
Manual Configuration
The Rails MCP Server follows the XDG Base Directory Specification for configuration files:
- On macOS:
$XDG_CONFIG_HOME/rails-mcpor~/.config/rails-mcpif XDG_CONFIG_HOME is not set - On Windows:
%APPDATA%\rails-mcp
The server will automatically create these directories and an empty projects.yml file the first time it runs.
To configure your projects manually:
- Edit the
projects.ymlfile in your config directory to include your Rails projects:
store: "~/projects/store"
インストール
npx mcp-remote http://localhost:6029/mcp/sse設定
{
"mcpServers": {
"railsMcpServer": {
"command": "ruby",
"args": ["/full/path/to/rails-mcp-server/exe/rails-mcp-server"]
}
}
}