What is VectorMCP?
VectorMCP is a Ruby library for implementing the Model Context Protocol (MCP) specification. It allows developers to create MCP servers that expose tools, resources, and prompts to LLM clients such as the Claude Desktop app or custom clients.
How to use VectorMCP?
Install the gem with gem install vector_mcp or add it to your Gemfile. Create a server instance with VectorMCP.new, register tools and resources using register_tool and register_resource, then call server.run to start listening on STDIN/STDOUT. Requests must be newline-delimited JSON-RPC objects.
Key features of VectorMCP
- Implements core server-side MCP specification.
- Define and register custom tools for LLM invocation.
- Expose data sources as resources for LLM reading.
- Provide structured prompt templates.
- Stdio transport (stable); SSE transport (work-in-progress).
- Extensible handlers with default MCP method implementations.
- Ruby-like API using blocks for registration.
- Automatic conversion of return values to MCP content format.
Use cases of VectorMCP
- Expose your Ruby application’s functions to an LLM client like Claude Desktop.
- Let LLMs read dynamic data from databases, APIs, or files via resources.
- Provide reusable prompt templates for consistent LLM interactions.
- Build a process-based MCP server for automated tool calling workflows.
- Add custom authentication or per-connection state using session objects.
Comments