Get the FREE Ultimate OpenClaw Setup Guide →

mcp_server_demo

MCP Server Demo

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone or download the repository to your local machine.
  2. Ensure Ruby is installed and accessible in your PATH. Verify with: ruby -v
  3. Install Node.js and npm if you want to use the MCP inspector: download from nodejs.org and install.
  4. Prepare the server entry point (demo.rb) and supporting files as provided in the repository.
  5. Start the MCP server using the command shown in mcp_config (example below).
  6. (Optional) Install the MCP inspector globally to test via the inspector helper: npm install -g @modelcontextprotocol/inspector
  7. 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

Sponsor this space

Reach thousands of developers