
nagstler/mcp_on_ruby
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
nagstler/mcp_on_ruby는 [[T0]에서 가져온 MCP 서버 후보입니다.
개요
nagstler/mcp_on_ruby는 [[T0]에서 가져온 MCP 서버 후보입니다.
개요(AI 번역)
Rails 애플리케이션을 위한 모델 컨텍스트 프로토콜(MCP) 서버
Rails 앱을 AI 접근 가능한 인터페이스로 노출하세요 — Rails 방식대로 도구와 자원을 정의하세요.
특징
🚀 Production-Ready - 인증, 속도 제한, 오류 처리, 보안 🔧 레일 통합 - 발전기, 자동 로딩, 미들웨어, 레일타이 🛠️ 도구 시스템 - JSON 스키마 검증이 가능한 호출 가능한 함수 📊 리소스 시스템 - URI 템플릿을 이용한 데이터 노출 🔒 보안 - DNS 재바인딩 보호, CORS, 토큰 인증 ⚡ 실시간 - 서버 이벤트(SSE) 기초 (완전 구현 예정) 🎯 개발자 친화적 - 깔끔한 DSL, 생성기, 테스트 지원
설치
Gemfile에 추가:
그다음 다음을 실행하세요:
퀵 스타트
1. 설치 및 구성
2. MCP 서버 구성
3. 도구 만들기
4. 자료 만들기
5. 서버 시작
건축
예시
Rails MCP 서버를 다양한 AI 클라이언트와 연결하세요:
👉 Claude 데스크탑 - 브리지 스크립트가 포함된 완전한 설정 가이드
👉 MCP 등록 및 제어 평면 - Rails MCP 엔드포인트를 다음과 같이 등록합니다
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
class OrdersController < ApplicationController
before_action :authenticate_user!
mcp_tool :index, description: "Search the current user's orders",
params: { status: { type: :string, enum: %w[pending paid shipped] } }
mcp_tool :show, description: "Fetch one order by id"
def index
render json: current_user.orders.where(params.permit(:status))
end
def show
render json: current_user.orders.find(params[:id])
end
end
That’s the whole integration. Claude, Cursor, or any MCP client can now search and read orders as the signed-in user. Your before_action authenticates the agent, your scopes and policies decide what it can see, and your existing JSON comes back to it. You don’t write new tool classes or a second permission system.
Why MCP on Ruby
Most MCP libraries ask you to build a parallel API for agents: new tool classes, new argument parsing, new authorization checks. Over time that second API drifts from the real one, and every rule has to be secured twice.
MCP on Ruby takes the opposite approach. Your app already has an API: your controllers. MCP on Ruby makes it callable by agents.
- One source of truth. Agents go through the same routes, filters, policies, validations, and serializers as your users.
- Real identity. Every tool call runs as a real user, using the auth you already have: API tokens, Devise, or Warden.
- Safe by default. Actions that change data must be marked
write: true, and every tool tells the client whether it is read-only or destructive. - Local and remote. Serve Streamable HTTP in production, and stdio for Claude Code, Claude Desktop, and Cursor on your machine.
설치
npx @modelcontextprotocol/inspector bin/rails mcp:stdio설정
{
"mcpServers": {
"my-app": {
"command": "/Users/you/.rbenv/versions/3.4.7/bin/ruby",
"args": ["-C", "/path/to/my-app", "bin/rails", "mcp:stdio"],
"env": { "MCP_USER": "[email protected]" }
}
}
}