YF

yjacquin/fast-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

1192 stars 105 forks 品質 74 トレンド 23MIT

モデルコンテキストプロトコルのRuby実装

概要

AIモデルをRubyアプリケーションに簡単に接続できます。複雑なプロトコルも統合の煩わしさも互換性の問題もなく、ただ美しく表現力豊かなRubyコードだけです。 AIモデルは強力ですが、真に有用であるためにはアプリケーションと相互作用する必要があります。従来のアプローチでは、以下の点に取り組む必要があります: - 🔄 複雑な通信プロトコルとカスタムJSONフォーマット - 🔌 異なるモデルプロバイダーとの統合課題 - 🧩 アプリとAIツール間の互換性の問題- 🧠 AIとの相互作用とデータ間の状態管理 Fast MCPは、モデルコンテキストプロトコルのクリーンでRubyに焦点を当てた実装を提供することで、これらの問題をすべて解決し、AI統合を面倒ではなく楽しませます。 - 🛠️ - AIモデルがRuby関数を安全に呼び出し、Dry-Schemaによる詳細な引数検証を行えるようにします。- 📚 - アプリとAIモデル間でデータ共有 - 🔄 - ニーズに応じてSTDIO、HTTP、SSEから選択- 🧩 - Rails、Sinatra、またはRackアプリとシームレスに連携。

概要(AI 翻訳)

AIモデルをRubyアプリケーションに簡単に連携させましょう 複雑なプロトコルも統合の煩わしさも互換性の問題もなく、ただ美しく表現力豊かなRubyコードだけです。

🌟 サーバーを数分でLLMと連携させる

AIモデルは強力ですが、真に有用であるためにはアプリケーションと相互作用する必要があります。従来のアプローチでは、以下の点に取り組む必要があります:

  • 🔄 複雑な通信プロトコルとカスタムJSONフォーマット
  • 🔌 異なるモデルプロバイダーとの統合課題
  • 🧩 アプリとAIツール間の互換性の問題
  • 🧠 AIとのやり取りとあなたのデータとの間の状態管理

Fast MCPは、モデルコンテキストプロトコルのクリーンでRubyに焦点を当てた実装を提供することで、これらの問題をすべて解決し、AI統合を面倒ではなく楽しませます。

✨ 特徴

  • 🛠️ Tools API - AIモデルがRuby関数を安全に呼び出し、Dry-Schemaによる詳細な引数検証を可能にします。
  • 📚 リソースAPI - アプリとAIモデル間でデータ共有
  • 🔄 複数トランスポート - 必要に応じてSTDIO、HTTP、SSEのいずれかを選択できます
  • 🧩 Framework Integration - Rails、Sinatra、またはあらゆるRackアプリとシームレスに動作します。

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Fast MCP 🚀

🌟 Interface your Servers with LLMs in minutes

AI models are powerful, but they need to interact with your applications to be truly useful. Traditional approaches mean wrestling with:

  • 🔄 Complex communication protocols and custom JSON formats
  • 🔌 Integration challenges with different model providers
  • 🧩 Compatibility issues between your app and AI tools
  • 🧠 Managing the state between AI interactions and your data

Fast MCP solves all these problems by providing a clean, Ruby-focused implementation of the Model Context Protocol, making AI integration a joy, not a chore.

✨ Features

  • 🛠️ Tools API - Let AI models call your Ruby functions securely, with in-depth argument validation through Dry-Schema.
  • 📚 Resources API - Share data between your app and AI models
  • 🔄 Multiple Transports - Choose from STDIO, HTTP, or SSE based on your needs
  • 🧩 Framework Integration - Works seamlessly with Rails, Sinatra or any Rack app.
  • 🔒 Authentication Support - Secure your AI-powered endpoints with ease
  • 🚀 Real-time Updates - Subscribe to changes for interactive applications
  • 🎯 Dynamic Filtering - Control tool/resource access based on request context (permissions, API versions, etc.)

💎 What Makes FastMCP Great

# Define tools for AI models to use
server = FastMcp::Server.new(name: 'popular-users', version: '1.0.0')

# Define a tool by inheriting from FastMcp::Tool
class CreateUserTool < FastMcp::Tool
  description "Create a user"
    # These arguments will generate the needed JSON to be presented to the MCP Client
    # And they will be validated at run time.
    # The validation is based off Dry-Schema, with the addition of the description.
  arguments do
    required(:first_name).filled(:string).description("First name of the user")
    optional(:age).filled(:integer).description("Age of the user")
GitHub で README 全文を見る

インストール

npx @modelcontextprotocol/inspector examples/server_with_stdio_transport.rb
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "my-great-server": { "command": "ruby", "args": ["/Users/path/to/your/awesome/fast-mcp/server.rb"] } } }