
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A Ruby framework for building MCP servers that expose tools, resources, prompts, and security features over the streamable HTTP transport.
VectorMCP is cataloged as an MCP server attributed to sergiobayona. A Ruby framework for building MCP servers that expose tools, resources, prompts, and security features over the streamable HTTP transport. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for VectorMCP are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes, VectorMCP supports image resources and image-aware tools and prompts.
Yes, each request is dispatched through its own invocation, so concurrent requests on a session cannot observe each other's headers or auth.
README.md · 938ab8df3557 · 采集于 2026-11-13 10:07:44 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
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.
VectorMCP::Tool, plus the original block-based register_tool APIserver.rack_appgem install vector_mcp
gem "vector_mcp"
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:
server.register_tool(
name: "echo",
description: "Echo back the supplied text",
input_schema: {
type: "object",
properties: { text: { type: "string" } },
required: ["text"]
}
) { |args| args["text"] }
VectorMCP can run as a standalone HTTP server or be mounted inside an existing Rack app:
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:
mount MCP_APP => "/mcp"
For ActiveRecord-backed tools, opt into VectorMCP::Rails::Tool:
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.
Expose callable tools:
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:
server.register_resource(
uri: "file://config.json",
name: "App Configuration",
description: "Current application settings"
) { File.read("config.json") }
Define prompt templates:
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:
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).
VectorMCP keeps security opt-in, but the primitives are built in:
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:
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.
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.
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)
POST /mcp accepts a single JSON-RPC request, notification, or response; batch arrays are rejectedGET /mcp opens an SSE stream for server-initiated messagesDELETE /mcp terminates the session2025-11-25 and accepts 2025-03-26 and 2024-11-05 headers for compatibilitymax_body_bytes: on run or rack_app when neededInitialize a session with curl:
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"}}}'
register_root and register_root_from_pathBug reports and pull requests are welcome on GitHub.
Available as open source under the MIT License.
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for VectorMCP from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mcpruby)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.