fast-mcp

MCP开发工具

提供方 yjacquin · 包名 fast-mcp

开发工具 stdio · 本地进程 未标注 社区 / 第三方 Claude DesktopCursorClineClaude Code
查看接入方式

A Ruby Implementation of the Model Context Protocol

一句话选型结论

按资料字段整理

fast-mcp 属于开发工具类 MCP 服务器,stdio · 本地进程,鉴权方式未标注,可直接接入 Claude Desktop、Cursor、Cline 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类开发工具 传输方式stdio · 本地进程 鉴权未标注 部署方式本地部署
GitHub 星标 1,163 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

开发工具
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

fast-mcp ai llm mcp rack

支持客户端

适用场景

fast-mcpaillm

安装与配置

stdio · 本地进程 未标注
客户端在本机拉起子进程,数据不出本机
git clone https://github.com/yjacquin/fast-mcp && cd fast-mcp

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Cross-platform,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
代码与仓库操作

在对话里直接查代码、提 issue、走 PR,省掉来回切工具。

本地命令与脚本

把构建、测试、格式化这类重复命令交给模型执行。

接口联调与测试

让模型调你的接口、跑一遍用例,快速定位问题。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Cursor、Cline,换客户端不用重新研究配置。
  • 仓库有一定关注度(星标 1,163),遇到问题更容易搜到资料。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
fast-mcp当前 未标注 stdio · 本地进程 本地部署 有 2026-04-08
Git 838e2ec1 12 stdio · 本地进程 本地部署 有 2026-05-17
Markitdown MCP 2c653a5f 1 stdio · 本地进程 本地部署 有 2026-05-17
JavaGuide 未标注 stdio · 本地进程 本地部署 有 2026-04-11
awesome-claude-skills 未标注 stdio · 本地进程 本地部署 有 2026-04-26
Context7 831acf40 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

开发工具
字段来自项目仓库与公开索引,中文说明由本站标注
提供方yjacquin上游标注的维护方 yjacquin
分类开发工具本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式未标注远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时fast-mcp · Cross-platform本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-04-08上游最后核验时间

详细介绍

13.2 KB
来自项目仓库与上游目录的原文,未做删改

Fast MCP 🚀

Connect AI models to your Ruby applications with ease

No complex protocols, no integration headaches, no compatibility issues – just beautiful, expressive Ruby code.

🌟 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```ruby

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")
required(:address).description("The shipping address").hash do
required(:street).filled(:string).description("Street address")
optional(:city).filled(:string).description("City name")
optional(:zipcode).maybe(:string).description("Postal code")
end
end

def call(first_name:, age: nil, address: {})
User.create!(first_name:, age:, address:)
end
end

Register the tool with the server

server.register_tool(CreateUserTool)

Share data resources with AI models by inheriting from FastMcp::Resource

class PopularUsers < FastMcp::Resource
uri "myapp:///users/popular"
resource_name "Popular Users"
mime_type "application/json"

def content
JSON.generate(User.popular.limit(5).as_json)
end
end

class User < FastMcp::Resource
uri "myapp:///users/{id}" # This is a resource template
resource_name "user"
mime_type "application/json"

def content
id = params[:id] # params are computed from the uri pattern

JSON.generate(User.find(id).as_json)

end
end

Register the resource with the server

server.register_resources(PopularUsers, User)

Accessing the resource through the server

server.read_resource(PopularUsers.uri)

Notify the resource content has been updated to clients

server.notify_resource_updated(PopularUsers.variabilized_uri)

Notifiy the content of a resource from a template has been updated to clients

server.notify_resource_updated(User.variabilized_uri(id: 1))


### 🎯 Dynamic Tool Filtering

Control which tools and resources are available based on request context:```ruby
# Tag your tools for easy filtering
class AdminTool &lt; FastMcp::Tool
  tags :admin, :dangerous
  description &quot;Perform admin operations&quot;

  def call
    # Admin only functionality
  end
end

# Filter tools based on user permissions
server.filter_tools do |request, tools|
  user_role = request.params[&#x27;role&#x27;]

  case user_role
  when &#x27;admin&#x27;
    tools # Admins see all tools
  when &#x27;user&#x27;
    tools.reject { |t| t.tags.include?(:admin) }
  else
    tools.select { |t| t.tags.include?(:public) }
  end
end

🚂 Fast Ruby on Rails implementation```shell

bundle add fast-mcp
bin/rails generate fast_mcp:install


This will add a configurable `fast_mcp.rb` initializer```ruby
require &#x27;fast_mcp&#x27;

FastMcp.mount_in_rails(
  Rails.application,
  name: Rails.application.class.module_parent_name.underscore.dasherize,
  version: &#x27;1.0.0&#x27;,
  path_prefix: &#x27;/mcp&#x27;, # This is the default path prefix
  messages_route: &#x27;messages&#x27;, # This is the default route for the messages endpoint
  sse_route: &#x27;sse&#x27;, # This is the default route for the SSE endpoint
  # Add allowed origins below, it defaults to Rails.application.config.hosts
  # allowed_origins: [&#x27;localhost&#x27;, &#x27;127.0.0.1&#x27;, &#x27;example.com&#x27;, /.*\.example\.com/],
  # localhost_only: true, # Set to false to allow connections from other hosts
  # whitelist specific ips to if you want to run on localhost and allow connections from other IPs
  # allowed_ips: [&#x27;127.0.0.1&#x27;, &#x27;::1&#x27;]
  # authenticate: true,       # Uncomment to enable authentication
  # auth_token: &#x27;your-token&#x27; # Required if authenticate: true
) do |server|
  Rails.application.config.after_initialize do
    # FastMcp will automatically discover and register:
    # - All classes that inherit from ApplicationTool (which uses ActionTool::Base)
    # - All classes that inherit from ApplicationResource (which uses ActionResource::Base)
    server.register_tools(*ApplicationTool.descendants)
    server.register_resources(*ApplicationResource.descendants)
    # alternatively, you can register tools and resources manually:
    # server.register_tool(MyTool)
    # server.register_resource(MyResource)
  end
end

The install script will also:

  • add app/resources folder
  • add app/tools folder
  • add app/tools/sample_tool.rb
  • add app/resources/sample_resource.rb
  • add ApplicationTool to inherit from
  • add ApplicationResource to inherit from as well

Rails-friendly class naming conventions

For Rails applications, FastMCP provides Rails-style class names to better fit with Rails conventions:

  • ActionTool::Base - An alias for FastMcp::Tool
  • ActionResource::Base - An alias for FastMcp::Resource

These are automatically set up in Rails applications. You can use either naming convention in your code:```ruby

Using Rails-style naming:

class MyTool < ActionTool::Base
description "My awesome tool"

arguments do
required(:input).filled(:string)
end

def call(input:)
# Your implementation
end
end

Using standard FastMcp naming:

class AnotherTool < FastMcp::Tool
# Both styles work interchangeably in Rails apps
end


When creating new tools or resources, the generators will use the Rails naming convention by default:```ruby
# app/tools/application_tool.rb
class ApplicationTool &lt; ActionTool::Base
  # Base methods for all tools
end

# app/resources/application_resource.rb
class ApplicationResource &lt; ActionResource::Base
  # Base methods for all resources
end

Easy Sinatra setup

I'll let you check out the dedicated sinatra integration docs.

🚀 Quick Start

Create a Server with Tools and Resources and STDIO transport```ruby

require 'fast_mcp'

Create an MCP server

server = FastMcp::Server.new(name: 'my-ai-server', version: '1.0.0')

Define a tool by inheriting from FastMcp::Tool

class SummarizeTool < FastMcp::Tool
description "Summarize a given text"

arguments do
required(:text).filled(:string).description("Text to summarize")
optional(:max_length).filled(:integer).description("Maximum length of summary")
end

def call(text:, max_length: 100)
# Your summarization logic here
text.split('.').first(3).join('.') + '...'
end
end

Register the tool with the server

server.register_tool(SummarizeTool)

Create a resource by inheriting from FastMcp::Resource

class StatisticsResource < FastMcp::Resource
uri "data/statistics"
resource_name "Usage Statistics"
description "Current system statistics"
mime_type "application/json"

def content
JSON.generate({
users_online: 120,
queries_per_minute: 250,
popular_topics: ["Ruby", "AI", "WebDev"]
})
end
end

Register the resource with the server

server.register_resource(StatisticsResource)

Start the server

server.start


## 🧪 Testing with the inspector

MCP has developed a very useful inspector.
You can use it to validate your implementation. I suggest you use the examples I provided with this project as an easy boilerplate.
Clone this project, then give it a go !```shell
npx @modelcontextprotocol/inspector examples/server_with_stdio_transport.rb

Or to test with an SSE transport using a rack middleware:```shell
npx @modelcontextprotocol/inspector examples/rack_middleware.rb


Or to test over SSE with an authenticated rack middleware:```shell
npx @modelcontextprotocol/inspector examples/authenticated_rack_middleware.rb

You can test your custom implementation with the official MCP inspector by using:```shell

Test with a stdio transport:

npx @modelcontextprotocol/inspector path/to/your_ruby_file.rb

Test with an HTTP / SSE server. In the UI select SSE and input your address.

npx @modelcontextprotocol/inspector


#### Sinatra```ruby
# app.rb
require &#x27;sinatra&#x27;
require &#x27;fast_mcp&#x27;

use FastMcp::RackMiddleware.new(name: &#x27;my-ai-server&#x27;, version: &#x27;1.0.0&#x27;) do |server|
  # Register tools and resources here
  server.register_tool(SummarizeTool)
end

get &#x27;/&#x27; do
  &#x27;Hello World!&#x27;
end

Integrating with Claude Desktop

Add your server to your Claude Desktop configuration at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: `%APPDATA%\Claude\claude_desktop_config.json````json
    {
    "mcpServers": {
    "my-great-server": {
    "command": "ruby",
    "args": ["/Users/path/to/your/awesome/fast-mcp/server.rb"]
    }
    }
    }

## How to add a MCP server to Claude, Cursor, or other MCP clients?

Please refer to configuring_mcp_clients

## 📊 Supported Specifications

| Feature                                         | Status                                                    |
| ----------------------------------------------- | --------------------------------------------------------- |
| ✅ **JSON-RPC 2.0**                             | Full implementation for communication                     |
| ✅ **Tool Definition &amp; Calling**                | Define and call tools with rich argument types            |
| ✅ **Resource &amp; Resource Templates Management** | Create, read, update, and subscribe to resources          |
| ✅ **Transport Options**                        | STDIO, HTTP, and SSE for flexible integration             |
| ✅ **Framework Integration**                    | Rails, Sinatra, Hanami, and any Rack-compatible framework |
| ✅ **Authentication**                           | Secure your AI endpoints with token authentication        |
| ✅ **Schema Support**                           | Full JSON Schema for tool arguments with validation       |

## 🗺️ Use Cases

- 🤖 **AI-powered Applications**: Connect LLMs to your Ruby app&#x27;s functionality
- 📊 **Real-time Dashboards**: Build dashboards with live AI-generated insights
- 🔗 **Microservice Communication**: Use MCP as a clean protocol between services
- 📚 **Interactive Documentation**: Create AI-enhanced API documentation
- 💬 **Chatbots and Assistants**: Build AI assistants with access to your app&#x27;s data

## 🔒 Security Features

Fast MCP includes built-in security features to protect your applications:

### DNS Rebinding Protection

The HTTP/SSE transport validates the Origin header on all incoming connections to prevent DNS rebinding attacks, which could allow malicious websites to interact with local MCP servers.```ruby
# Configure allowed origins (defaults to [&#x27;localhost&#x27;, &#x27;127.0.0.1&#x27;])
FastMcp.rack_middleware(app,
  allowed_origins: [&#x27;localhost&#x27;, &#x27;127.0.0.1&#x27;, &#x27;your-domain.com&#x27;, /.*\.your-domain\.com/],
  localhost_only: false,
  allowed_ips: [&#x27;192.168.1.1&#x27;, &#x27;10.0.0.1&#x27;],
  # other options...
)

Authentication

Fast MCP supports token-based authentication for all connections:```ruby

Enable authentication

FastMcp.authenticated_rack_middleware(app,
auth_token: 'your-secret-token',
# other options...
)
```

📖 Documentation

  • 🚀 Getting Started Guide
  • 🧩 Integration Guide
  • 🛤️ Rails Integration
  • 🌐 Sinatra Integration
  • 📚 Resources
  • 🛠️ Tools
  • 🔒 Security
  • 🎯 Dynamic Filtering

💻 Examples

Check out the examples directory for more detailed examples:

  • 🔨 Basic Examples:

  • Simple Server

  • Tool Examples

  • 🌐 Web Integration:

  • Rack Middleware
  • Authenticated Endpoints

🧪 Requirements

  • Ruby 3.2+

👥 Contributing

We welcome contributions to Fast MCP! Here's how you can help:

  1. Fork the repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am &#x27;Add some feature&#x27;)
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Please read our Contributing Guide for more details.

📄 License

This project is available as open source under the terms of the MIT License.

🙏 Acknowledgments

  • The Model Context Protocol team for creating the specification
  • The Dry-Schema team for the argument validation.
  • All contributors to this project

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
fast-mcp 怎么安装?

在客户端按下面的安装命令接入:git clone https://github.com/yjacquin/fast-mcp && cd fast-mcp。对应的包名是 fast-mcp。装完在客户端配置里引用同一个包或端点。

fast-mcp 怎么在 Claude Desktop、Cursor、Cline 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

fast-mcp 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

fast-mcp 需要 API Key 吗?

资料没有标注鉴权方式,是否需要密钥取决于服务本身,接入前按官方文档确认。

fast-mcp 支持哪些客户端?

资料标注支持 Claude Desktop、Cursor、Cline、Claude Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

fast-mcp 能提供哪些能力?

资料显示能力标签包括 fast-mcp、ai、llm、mcp、rack。具体工具清单以官方文档为准。

fast-mcp 需要什么运行环境?

运行时为 Cross-platform;属于本地进程,需要在本机装好运行环境。

fast-mcp 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-04-08。