Get the FREE Ultimate OpenClaw Setup Guide →

vector_mcp

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

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio sergiobayona-vector_mcp ruby -e require 'vector_mcp'; VectorMCP.new(name: 'VectorMCP', version: '0.0.0').run \
  --env VECTOR_MCP_ENV="Placeholder for environment configuration"

How to use

VectorMCP is a Ruby-based MCP server framework that lets you expose tools, resources, prompts, and filesystem roots to clients that speak the MCP protocol. The server runs as a Ruby process using the vector_mcp gem, and provides multiple transports (notably stdio for CLI tools and SSE/HTTP for web integrations) out of the box. You define tooling by registering functions (tools), data sources (resources), and reusable prompts, then start the server to accept calls from LLMs or MCP-enabled clients. The framework emphasizes security through input validation, schema enforcement, and optional authentication/authorization hooks to restrict access to specific tools or resources.

You’ll interact with the server by creating a VectorMCP instance, registering your tools, resources, and prompts, and then calling run to start listening on the default stdio transport or on a specified transport/port if you enable HTTP/SSE. Typical workflows include exposing a calculator tool, reading configuration data as a resource, and supplying a code review or language-specific prompt template that the LLM can invoke.

To use the server effectively, install the gem, require it in your Ruby application, register the components you want to expose, and then run the server. Clients can connect and invoke the registered tools by sending MCP-compliant requests. The documentation also covers advanced security, filesystem roots, and real-world examples to help you tailor access and boundaries for production deployments.

How to install

Prerequisites:

  • Ruby 2.7+ (preferably a recent Ruby version)
  • RubyGems (bundler optional)

Install the vector_mcp gem:

gem install vector_mcp

Or, if you prefer bundler in a project:

bundle add vector_mcp

Create a simple server file (examples/vector_mcp_server.rb):

require 'vector_mcp'

server = VectorMCP.new(name: 'MyApp', version: '1.0.0')

server.register_tool(
  name: 'greet',
  description: 'Greets a user',
  input_schema: {
    type: 'object',
    properties: { name: { type: 'string' } },
    required: ['name']
  }
) { |args| "Hello, #{args['name']}!" }

server.run # default stdio transport

Run the server:

ruby path/to/examples/vector_mcp_server.rb

If you want to customize transports (e.g., SSE/HTTP), modify server.run with transport options per the library’s API (e.g., server.run(transport: :sse, port: 8080)).

Upgrade notes: If you update the gem, adjust any breaking changes in your tool/resource definitions and verify your security and schema validations remain compatible with your MCP clients.

Additional notes

Notes and tips:

  • This MCP server is implemented as a Ruby gem (VectorMCP). There is no dedicated npm/Node.js package for this server, so npm_package is null.
  • Ensure your Ruby environment has bundler if you’re managing dependencies that way.
  • Security is opt-in and relies on the gem’s authentication/authorization hooks; implement API keys or JWT strategies as needed for production.
  • When exposing HTTP/SSE, consider enabling TLS in front of your server and validating inputs with the provided schemas to prevent injection or schema-bypass attacks.
  • For filesystem roots, use the provided root registration methods to constrain tool operations within safe directories.
  • Regularly run your test suite to ensure your registered tools handle edge cases and validate inputs as expected.

Related MCP Servers

Sponsor this space

Reach thousands of developers