Claude Marketplaces
SkillsMCP serversMarketplacesDigestTools
Submit

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP servers by category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control
Claude Marketplaces

An independent directory of skills, plugins and MCP servers for Claude Code. Not affiliated with Anthropic.

Browse

  • Skills
  • MCP servers
  • Marketplaces
  • Weekly digest
  • Skill index
  • MCP index
  • Marketplace index

Site

  • About
  • Tools
  • Submit
  • Feedback
  • Privacy
  • llms.txt
  • Plugins reference

Maker

  • Snug
  • Agent Caffeine
  • knobs
  • Wax
  • Vectoys
  • mertduzgun.com
Crafted at
MCP servers/Data & Analytics
modelcontextprotocol avatar

MCP Ruby SDK

modelcontextprotocol/ruby-sdkOfficial

The Ruby SDK provides the official library for building Model Context Protocol servers and clients in Ruby, implementing JSON-RPC 2.0 message handling with support for tool registration and invocation, prompt management, resource retrieval, and sampling capabilities. It offers multiple transport options including stdio and HTTP (SSE), enabling developers to create MCP servers that handle protocol initialization, capability negotiation, and server-to-client LLM completion requests. The SDK solves the problem of integrating Ruby applications with the Model Context Protocol by providing standardized abstractions for implementing protocol methods like tool listing, resource reading, and autocompletion suggestions.

GitHub stars
817
last updated
Jan 28, 2026
View on GitHubSave

Sponsors

SnugThe clipboard manager you and your agent can use, safelyAgent CaffeineClose your lid, come back to finished workWaxBlock anything with supervision, without erasing your iPhoneOpen StepsSponsoredFree and open-source skills that make AI coding agents easier to understand, verify, and control.

Readme

MCP Ruby SDK Gem Version Apache 2.0 licensed CI

The official Ruby SDK for Model Context Protocol servers and clients.

Detailed guides are available at https://ruby.sdk.modelcontextprotocol.io.

Features

  • Build MCP servers that expose tools, prompts, and resources to any MCP host, with OAuth 2.1 resource-server protection
  • Build MCP clients that connect to any MCP server, with automatic lifecycle negotiation and OAuth 2.1 authorization
  • Speak every standard transport: stdio and Streamable HTTP (including SSE), with a Rails integration
  • Cover the full protocol surface: server-to-client requests, multi round-trip requests, notifications, progress, logging, cancellation, completions, and pagination

Installation

Add this line to your application's Gemfile:

gem "mcp"

And then execute:

$ bundle install

Or install it yourself as:

$ gem install mcp

You may need to add additional dependencies depending on which features you wish to access.

Quick Start

The following minimal programs show both sides of the protocol: a server that exposes a single tool, and a client that spawns such a server and drives it over stdio.

MCP Server

A minimal server defines a tool and serves it over the stdio transport:

require "mcp"

# Create a simple tool
class ExampleTool < MCP::Tool
  description "A simple example tool that echoes back its arguments"
  input_schema(
    properties: {
      message: { type: "string" },
    },
    required: ["message"]
  )

  class << self
    def call(message:, server_context:)
      MCP::Tool::Response.new([{
        type: "text",
        text: "Hello from example tool! Message: #{message}",
      }])
    end
  end
end

# Set up the server
server = MCP::Server.new(
  name: "example_server",
  tools: [ExampleTool],
)

# Create and start the transport
transport = MCP::Server::Transports::StdioTransport.new(server)
transport.open

Save the script as server.rb, run it, and send JSON-RPC requests via stdin:

$ ruby server.rb
{"jsonrpc":"2.0","id":"1","method":"ping"}
{"jsonrpc":"2.0","id":"2","method":"tools/list"}
{"jsonrpc":"2.0","id":"3","method":"tools/call","params":{"name":"example_tool","arguments":{"message":"Hello"}}}

The same server can also run over Streamable HTTP, including mounted inside a Rails application; see Server Transports.

MCP Client

A minimal client spawns a stdio server as a subprocess, connects, and lists and calls its tools:

require "mcp"

stdio_transport = MCP::Client::Stdio.new(
  command: "bundle",
  args: ["exec", "ruby", "path/to/server.rb"],
  env: { "API_KEY" => "my_secret_key" },
  read_timeout: 30
)
client = MCP::Client.new(transport: stdio_transport)

# Negotiate the protocol lifecycle before sending any requests.
client.connect

# List available tools.
tools = client.tools
tools.each do |tool|
  puts "Tool: #{tool.name} - #{tool.description}"
end

# Call a specific tool.
response = client.call_tool(
  tool: tools.first,
  arguments: { message: "Hello, world!" }
)

# Close the transport when done.
stdio_transport.close

The same client can connect to Streamable HTTP servers with MCP::Client::HTTP; see Client Transports.

Examples

Runnable examples are available in examples, including a complete Rails application in examples/rails.

Documentation

  • SDK guides
  • SDK API documentation
  • Model Context Protocol documentation

License

This project is licensed under the Apache License 2.0 for new contributions, with existing code under MIT. See the LICENSE file for details.

Details

Repository
github.com/modelcontextprotocol/ruby-sdk
Category
Data & Analytics

More from modelcontextprotocol

  • Everything85.8K
  • MCP Registry Server6.9K
  • QR Rápido6.9K
  • Fetch85.8K
  • Sequential Thinking85.8K
  • Time85.8K
  • Memory85.8K
  • Git85.8K
  • Calculator1.5K

Related Data & Analytics MCP servers

View all
1clickhouse avatarClickHouseclickhouse/mcp-clickhouseQueries and manages data from ClickHouse and chDB sources via MCP endpoints.780stars
2hyperbrowserai avatarHyperbrowserhyperbrowserai/mcpProvides data scraping, structured data extraction, and web crawling through MCP clients with browser-use agents.761stars
3alpacahq avatarAlpacaalpacahq/alpaca-mcp-serverAlpaca’s official MCP Server lets you trade stocks, ETFs, crypto, and options, run data analysis, and build strategies in plain English directly from your favor736stars
4softeria avatarMicrosoft 365softeria/ms-365-mcp-serverProvides programmatic access to Microsoft 365 data and actions via MCP using Graph API across personal and organization clouds.713stars
5elastic avatarElasticsearchelastic/mcp-server-elasticsearchProvides MCP access to Elasticsearch data, enabling index discovery, mappings, searches, and shard information.662stars
624mlight avatara-share-mcp24mlight/a-share-mcp-is-just-i-needProvides access to A股 stock data, including historical prices, fundamentals, macro data, and analytical reports through an MCP interface.644stars