mcp_server_demo
MCP Server Demo
claude mcp add --transport stdio etrex-mcp_server_demo ruby <path_to_repository>/demo.rb \ --env DESCRIPTION="Replace <path_to_repository> with the absolute path to this repository."
How to use
This MCP server demonstrates a simple Ruby-based MCP implementation and serves as a learning example for the MCP protocol, including basic request/response handling and a modular approach to managing tools. You can interact with it using the MCP inspector or via STDIO. The demo exposes a minimal tool registry and sample tool invocations such as a sum calculator, which helps you observe how tools are listed and called through the MCP protocol. To try with the MCP inspector, run commands that connect Ruby-based servers and exercise the list and call capabilities, and you can also test the server directly via STDIO by sending JSON-RPC messages line by line. The setup is designed to illustrate how an MCP server registers tools, handles initialize requests, and processes tool calls with arguments.
How to install
Prerequisites:
- Ruby installed on your system
- Optional: Node.js and npm if you plan to use the MCP inspector tool from Node.js
Steps:
- Clone or download the repository to your local machine.
- Ensure Ruby is installed and accessible in your PATH. Verify with: ruby -v
- Install Node.js and npm if you want to use the MCP inspector: download from nodejs.org and install.
- Prepare the server entry point (demo.rb) and supporting files as provided in the repository.
- Start the MCP server using the command shown in mcp_config (example below).
- (Optional) Install the MCP inspector globally to test via the inspector helper: npm install -g @modelcontextprotocol/inspector
- Test the server using the inspector or via STDIO as described in the README.
Additional notes
Tips and notes:
- The README demonstrates both an inspector-based workflow and STDIO testing. Use the inspector for quick, interactive tests, or run the Ruby script directly and issue JSON-RPC commands per line via STDIN.
- When configuring the integration (e.g., Claude), replace <path_to_repository> with the actual absolute path to this repository so the Ruby entry script can be located.
- If you modify demo.rb or simple_server.rb, ensure the tools registry and call handlers remain compatible with the MCP protocol version you are using.
- The sample includes a calculate_sum tool to illustrate arguments like {"a":1,"b":2}. Extend or adapt tools as needed for your use case.
- Ensure port/firewall/network settings allow the interaction method you choose (inspector vs STDIO).
- If you encounter issues, verify Ruby script permissions and that Ruby can load any required dependencies used by the server implementation.
Related MCP Servers
fast
A Ruby Implementation of the Model Context Protocol
rails
A Ruby gem implementation of a Model Context Protocol (MCP) server for Rails projects. This server allows LLMs (Large Language Models) to interact with Rails projects through the Model Context Protocol.
mcp-rb
A lightweight Ruby framework for building MCP servers with a Sinatra-like DSL
sketchup
Sketchup Model Context Protocol
rails-pg-extras
MCP (Model Context Protocol) LLM interface for rails-pg-extras gem
nvim
A Ruby implementation of the MCP server protocol for Neovim