MCP-RB
by funwarioisii
MCP-RB is a lightweight Ruby framework designed for implementing MCP (Model Context Protocol) servers. It offers a Sinatra-like DSL for defining resources and tools.
Last updated: N/A
What is MCP-RB?
MCP-RB is a Ruby framework that simplifies the creation of MCP servers. It provides a domain-specific language (DSL) inspired by Sinatra, making it easy to define resources and tools that adhere to the Model Context Protocol.
How to use MCP-RB?
To use MCP-RB, add the gem to your Gemfile and then define your server logic using the provided DSL. You can define resources, resource templates, and tools with arguments and associated call blocks. Refer to the provided examples for defining resources, resource templates, and tools. The 'Test with MCP Inspector' section provides a command to test.
Key features of MCP-RB
Sinatra-like DSL
Resource definition
Resource template definition
Tool definition with arguments
Support for nested arguments
Support for Array arguments
MCP specification compliance
Use cases of MCP-RB
Building MCP servers
Creating APIs for model context interaction
Implementing tools for interacting with models
Defining resources for accessing model data
Developing services based on the Model Context Protocol
FAQ from MCP-RB
What is MCP?
What is MCP?
MCP stands for Model Context Protocol, a protocol for interacting with models.
What is a resource in MCP-RB?
What is a resource in MCP-RB?
A resource represents a specific piece of data or functionality exposed by the server.
What is a tool in MCP-RB?
What is a tool in MCP-RB?
A tool represents an executable function that can be called on the server.
How do I define arguments for a tool?
How do I define arguments for a tool?
You can define arguments using the argument
method within a tool definition, specifying the name, type, and other properties.
How do I test my MCP-RB server?
How do I test my MCP-RB server?
The README provides instructions for running tests using rake test
and for testing with the MCP Inspector using bunx @modelcontextprotocol/inspector
.