
maquina-app/rails-mcp-server
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Реализация сервера Model Context Protocol (MCP) для проектов Rails на Ruby gem. Этот сервер позволяет LLM (Large Language Models) взаимодействовать с проектами Rails через Model Context...
Обзор
Реализация сервера Model Context Protocol (MCP) на Ruby для проектов Rails. Этот сервер позволяет LLM (Large Language Models) взаимодействовать с проектами Rails через протокол Model Context Protocol, предоставляя возможности для анализа кода, исследования и помощи в разработке. Протокол контекста модели (MCP) — это стандартизированный способ взаимодействия ИИ-моделей с их средой. Он определяет структурированный метод, позволяющий моделям запрашивать и использовать инструменты, получать доступ к ресурсам и поддерживать контекст во время взаимодействия. Этот сервер Rails MCP реализует спецификацию MCP, предоставляя ИИ-моделям доступ к проектам Rails для анализа кода, исследования и помощи.
Обзор (машинный перевод)
Реализация сервера Model Context Protocol (MCP) на Ruby для проектов Rails. Этот сервер позволяет LLM (Large Language Models) взаимодействовать с проектами Rails через протокол Model Context Protocol, предоставляя возможности для анализа кода, исследования и помощи в разработке.
Что такое MCP?
Протокол контекста модели (MCP) — это стандартизированный способ взаимодействия ИИ-моделей с их средой. Он определяет структурированный метод, позволяющий моделям запрашивать и использовать инструменты, получать доступ к ресурсам и поддерживать контекст во время взаимодействия.
Этот сервер Rails MCP реализует спецификацию MCP, предоставляя ИИ-моделям доступ к проектам Rails для анализа кода, исследования и помощи.
Особенности
- Управление несколькими проектами Rails
- Просмотр файлов и структур проектов
- Просмотр маршрутов Rails с опциями фильтрации
- Инспектировать информацию и взаимосвязи модели (с помощью статического анализа Prism)
- Получить информацию о схеме базы данных
- Анализ отношений между контроллером и видом
- Анализ конфигураций среды
- Получить доступ к подробной документации по рельсам, турбо, стимулам и камалу
- Контекстно-эффективная архитектура с прогрессивным обнаружением инструментов
- Бесшовная интеграция с клиентами LLM
Установка
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
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"]
}
}
}