VectorMCP

MCP文档知识

提供方 sergiobayona

文档知识 未标注 OAuth 授权 社区 / 第三方 Claude DesktopClaudeCursorCline

A server implementation for the Model Context Protocol (MCP) in Ruby.

一句话选型结论

按资料字段整理

VectorMCP 属于文档知识类 MCP 服务器,传输方式未标注,OAuth 授权,可直接接入 Claude Desktop、Claude、Cursor 等,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类文档知识 传输方式未标注 鉴权OAuth 授权 部署方式未标注
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

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

能力标签

mcp model context protocol mcp servers mcp server model context protocol servers mcp sdk

支持客户端

适用场景

mcpmodel context protocolmcp servers

安装与配置

未标注 OAuth 授权
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

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

  3. 3
    写入客户端配置

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

  4. 4
    验证是否可用

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

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
文档检索问答

在你的文档库里按问题找答案。

知识库读写

把新资料写进知识库,随用随取。

内容整理

把零散资料归纳成结构化笔记。

选择建议

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

值得选的地方

  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

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

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
VectorMCP当前 未标注 未标注 未标注 无 未标注
dify 未标注 stdio · 本地进程 本地部署 有 2026-04-11
open-webui 未标注 stdio · 本地进程 本地部署 有 2026-04-11
JeecgBoot 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Cherry Studio 未标注 未标注 未标注 无 2026-05-17
mempalace 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

文档知识
字段来自项目仓库与公开索引,中文说明由本站标注
提供方sergiobayona上游标注的维护方 sergiobayona
分类文档知识本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · ruby本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

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

VectorMCP

VectorMCP is a Ruby implementation of the Model Context Protocol (MCP) server-side specification. It gives you a framework for exposing tools, resources, prompts, roots, sampling, middleware, and security over the MCP streamable HTTP transport.

Highlights

  • Streamable HTTP is the built-in transport, with session management, resumability, and MCP 2025-11-25 compliance
  • Class-based tools via VectorMCP::Tool, plus the original block-based register_tool API
  • Rack and Rails mounting through server.rack_app
  • Opt-in authentication and authorization, structured logging, and middleware hooks
  • Request-scoped identity: every request is dispatched through its own invocation, so concurrent requests on one session can never observe each other's headers or auth
  • Image-aware tools/resources/prompts, roots, and server-initiated sampling
  • Token-based field anonymization middleware to keep sensitive values out of LLM context

Requirements

  • Ruby 3.2+

Installation```bash

gem install vector_mcp
``````ruby
gem "vector_mcp"


## Quick Start```ruby
require "vector_mcp"

class Greet < VectorMCP::Tool
  description "Say hello to someone"
  param :name, type: :string, desc: "Name to greet", required: true

  def call(args, _session)
    "Hello, #{args["name"]}!"
  end
end

server = VectorMCP::Server.new(name: "MyApp", version: "1.0.0")
server.register(Greet)
server.run(port: 8080)

The class-based DSL is optional. The existing block-based API still works:```ruby
server.register_tool(
name: "echo",
description: "Echo back the supplied text",
input_schema: {
type: "object",
properties: { text: { type: "string" } },
required: ["text"]
}
) { |args| args["text"] }


## Rack and Rails

VectorMCP can run as a standalone HTTP server or be mounted inside an existing Rack app:```ruby
require "vector_mcp"

server = VectorMCP::Server.new(name: "MyApp", version: "1.0.0")
server.register(Greet)

MCP_APP = server.rack_app

In Rails, mount it in config/routes.rb:```ruby
mount MCP_APP => "/mcp"


For ActiveRecord-backed tools, opt into `VectorMCP::Rails::Tool`:```ruby
require "vector_mcp/rails/tool"

class FindUser < VectorMCP::Rails::Tool
  description "Find a user by id"
  param :id, type: :integer, required: true

  def call(args, _session)
    user = find!(User, args[:id])
    { id: user.id, email: user.email }
  end
end

See docs/rails-setup-guide.md for a full setup guide.

Tools, Resources, and Prompts

Expose callable tools:```ruby
server.register_tool(
name: "calculate",
description: "Performs basic math",
input_schema: {
type: "object",
properties: {
operation: { type: "string", enum: ["add", "subtract", "multiply"] },
a: { type: "number" },
b: { type: "number" }
},
required: ["operation", "a", "b"]
}
) do |args|
case args["operation"]
when "add" then args["a"] + args["b"]
when "subtract" then args["a"] - args["b"]
when "multiply" then args["a"] * args["b"]
end
end


Expose readable resources:```ruby
server.register_resource(
  uri: "file://config.json",
  name: "App Configuration",
  description: "Current application settings"
) { File.read("config.json") }

Define prompt templates:```ruby
server.register_prompt(
name: "code_review",
description: "Reviews code for best practices",
arguments: [
{ name: "language", description: "Programming language", required: true },
{ name: "code", description: "Code to review", required: true }
]
) do |args|
{
messages: [{
role: "user",
content: {
type: "text",
text: "Review this #{args["language"]} code:\n\n#{args["code"]}"
}
}]
}
end


`VectorMCP::Tool` also supports `type: :date` and `type: :datetime`, which are validated as strings in JSON Schema and coerced to `Date` and `Time` before `#call` runs.

Handlers that take a second argument receive the per-request invocation, which exposes session identity, the request's headers/params, and the authenticated user in one place:```ruby
server.register_tool(
  name: "whoami",
  description: "Reports the caller's identity",
  input_schema: { type: "object", properties: {} }
) do |_args, invocation|
  {
    session: invocation.id,
    user: invocation.user,
    api_key_header: invocation.request_header("X-API-Key")
  }
end

Resource handlers get the same invocation as their second argument (it also answers the familiar user / authenticated? / can? queries, so handlers written against the older security-context argument keep working unchanged).

Security and Middleware

VectorMCP keeps security opt-in, but the primitives are built in:```ruby
server.enable_authentication!(
strategy: :api_key,
keys: [ENV.fetch("MCP_API_KEY")],
rate_limit: { max_attempts: 10, window_seconds: 60 }
)

server.enable_authorization! do
authorize_tools do |user, action, tool|
user[:role] == "admin" || !tool.name.start_with?("admin
")
end
end


Custom authentication works too:```ruby
server.enable_authentication!(strategy: :custom) do |request|
  api_key = request[:headers]["X-API-Key"]
  user = User.find_by(api_key: api_key)
  user ? { user_id: user.id, role: user.role } : false
end

When authentication is enabled, VectorMCP applies it centrally to built-in and custom request/notification handlers. Only initialize, ping, and the initialized notification are public; HTTP GET streams and DELETE session requests also require credentials.

For public deployments, enable authentication failure limiting with rate_limit: true (10 attempts per 60 seconds by default), or provide max_attempts, window_seconds, and max_entries. Repeated failures are tracked by client IP and a one-way credential fingerprint; blocked requests return HTTP 429, JSON-RPC -32029, and Retry-After. The limiter is in-process, so multi-process or distributed deployments should also enforce a shared limit at the proxy or gateway. Generate API keys with at least 256 bits of entropy—for example, ruby -rsecurerandom -e 'puts SecureRandom.hex(32)'—and load them from a secret manager or environment variable.

For MCP clients that speak OAuth 2.1 (e.g. Claude Desktop), pass a resource_metadata_url: to turn on RFC 9728 discovery. Unauthenticated requests to /mcp return 401 with a WWW-Authenticate header pointing at the configured metadata document, and the client drives the rest of the OAuth dance automatically. See docs/oauth_resource_server.md for the feature reference and docs/rails_oauth_integration.md for a full Rails + Doorkeeper recipe.

Middleware can hook into tool, resource, prompt, sampling, auth, and transport events, including before_auth, after_auth, on_auth_error, before_request, after_response, and on_transport_error.

See security/README.md for the full security guide.

Field Anonymization

Keep sensitive string values out of the LLM context by substituting them with stable opaque tokens. Values are tokenized on outbound tool results and restored on inbound tool arguments, so the LLM sees only tokens while your handlers receive the original data.```ruby
anonymizer = VectorMCP::Middleware::Anonymizer.new(
store: VectorMCP::TokenStore.new,
field_rules: [
{ pattern: /email/i, prefix: "EMAIL" },
{ pattern: /\bssn\b/i, prefix: "SSN" }
]
)
anonymizer.install_on(server)


## Transport Notes

- VectorMCP ships with streamable HTTP as its built-in transport
- `POST /mcp` accepts a single JSON-RPC request, notification, or response; batch arrays are rejected
- `GET /mcp` opens an SSE stream for server-initiated messages
- `DELETE /mcp` terminates the session
- The server advertises MCP protocol `2025-11-25` and accepts `2025-03-26` and `2024-11-05` headers for compatibility
- Default allowed origins are restricted to localhost and loopback addresses
- POST bodies are capped at 16 MiB by default; configure `max_body_bytes:` on `run` or `rack_app` when needed
- For mounted Rack apps, configure the same limit in the fronting web server or reverse proxy so requests are rejected before Rack buffering

Initialize a session with curl:```bash
curl -X POST http://localhost:8080/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}'

More Features

  • Roots via register_root and register_root_from_path
  • Image resources and image-aware tools/prompts
  • Structured logging with component loggers
  • Server-initiated sampling with streaming/tool-call support
  • Middleware-driven request shaping and observability

Documentation

  • CHANGELOG.md
  • examples/
  • docs/rails-setup-guide.md
  • docs/rails_oauth_integration.md
  • docs/oauth_resource_server.md
  • docs/streamable-http-spec-compliance.md
  • security/README.md
  • MCP Specification

Contributing

Bug reports and pull requests are welcome on GitHub.

License

Available as open source under the MIT License.

常见问题

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

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

VectorMCP 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

VectorMCP 收费吗?

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

VectorMCP 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

VectorMCP 支持哪些客户端?

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

VectorMCP 能提供哪些能力?

资料显示能力标签包括 mcp、model context protocol、mcp servers、mcp server、model context protocol servers、mcp sdk。具体工具清单以官方文档为准。

VectorMCP 需要什么运行环境?

运行时为 ruby。

热门专题

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

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