Get the FREE Ultimate OpenClaw Setup Guide →

mcp -hello

A hello-world server for the Model Context Protocol

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio teamdman-mcp-server-hello mcp-rs-template --mcp \
  --env API_KEY="xxxx"

How to use

This MCP server implements a Rust-based MCP CLI server template. It demonstrates how to expose prompts, resources, and tools via the MCP protocol using a JSON-RPC router built on Rust. The server is driven by the command-line interface (CLI) and can be started with the --mcp flag to enable MCP mode. Tools, prompts, and resources are defined in the src/mcp modules and can be customized to integrate external data sources or actions. To use it, run the server with the MCP flag, then interact with it through the MCP-compatible client, such as Claude Desktop or another LLM-enabled application, to fetch prompts, resources, or to execute tools through the JSON-RPC interface.

Key capabilities include:

  • Prompts: pre-defined prompts that guide the LLM’s behavior or provide templates for common interactions.
  • Resources: external data or endpoints that can be queried by the MCP client.
  • Tools: callable actions that the MCP client can invoke to perform tasks or retrieve data.
  • CLI options: --mcp to enable MCP, --resources, --prompts, and --tools to display respective information.

To interact, ensure your client config points to this server’s mcp-rs-template instance with the --mcp flag, and use the standard MCP commands to list or invoke prompts, resources, and tools as exposed by the server.

How to install

Prerequisites:

  • Rust and Cargo installed on your system
  • Basic familiarity with Rust project structure and cargo commands

Installation steps:

  1. prerequisites
  1. Clone the repository
git clone https://github.com/your-org/mcp-rs-template.git
cd mcp-rs-template
  1. Configure the project (optional)
  • Update Cargo.toml and src/mcp/* files to customize server name, prompts, resources, and tools as needed
  1. Build the project
cargo build --release
  1. Run the server in MCP mode
./target/release/mcp-rs-template --mcp
  1. Verify MCP is running
  • Connect with an MCP-compatible client (e.g., Claude Desktop) using the server address and port configured for MCP access.

Additional notes

Tips and common issues:

  • Ensure you’ve enabled the --mcp flag when starting the server to expose MCP endpoints.
  • If you modify prompts/resources/tools, rebuild the binary to apply changes.
  • When integrating with Claude Desktop, add a corresponding entry in claude_desktop_config.json under the servers section with the correct command, args, and any required environment variables.
  • Monitor logs to debug issues: tail -n 20 -f path/to/your/logs/mcp*.log as referenced in the README example.
  • If you encounter JSON-RPC routing issues, verify that your rust-rpc-router setup in Cargo.toml is compatible with the version used by your MCP server template.
  • Environment variables (e.g., API keys) should be kept secure and not hard-coded in production; consider using a secrets manager or environment file.

Related MCP Servers

Sponsor this space

Reach thousands of developers