mcp
A crate for making MCP (Model Context Protocol) compatible programs with rust
claude mcp add --transport stdio emillindfors-mcp cargo run --bin server -- --config ../servers/test.json
How to use
mcp.rs is a Rust-based MCP server implementation that enables AI models to access external context and resources via a configurable server. It supports multiple transport options (stdio for CLI tooling and HTTP with SSE for web integrations) and exposes resources such as files and data through a flexible resource layer. To run the server locally, build and start it with Cargo, then connect a client to the server over the configured transport (stdio or SSE). The README demonstrates typical usage patterns for both the client and the server, including how to launch the server with a test configuration and how to exercise basic MCP capabilities like reading resources, listing resources, and invoking tools via the MCP protocol.
How to install
Prerequisites:
- Rust toolchain installed (rustup, cargo). If you don’t have Rust, install it from https://rust-lang.org or by running your OS package manager’s recommended method.
- Clone the repository:
- git clone https://github.com/EmilLindfors/mcp
- cd mcp
- Build the server locally:
- cargo build --release
- Run the server (example using a test configuration):
- cargo run --bin server -- --config "../servers/test.json"
- Optional: run the client to interact with the server (examples assume the server is running with a suitable transport like SSE on port 3000):
- cargo run --bin client list-resources
- cargo run --bin client read-resource -u "file:///path/to/file"
- If you prefer a specific transport, adjust your configuration or command-line flags accordingly (e.g., stdio or SSE) as shown in the Quick Start section of the README.
Additional notes
Tips and notes:
- The server supports multiple transports; choose stdio for CLI interactions or SSE for web-based integrations.
- Resource management includes file system access and templating; ensure proper security controls are in place (authentication, origin checks, and access policies).
- When testing, a test.json configuration file is convenient to quickly boot the server with sensible defaults.
- If you encounter port or binding issues, verify that the port is not in use and that firewall rules permit traffic to the configured transport.
- For debugging, you can enable verbose logging (if supported by your build) to trace requests, resource access, and tool invocations.
- The README mentions cargo doc for API exploration; you can generate documentation with: cargo doc --open
Related MCP Servers
offeryn
Build tools for LLMs in Rust using Model Context Protocol
askimo
AI Native App Client App with Built-in Knowledge Base & Multi-Provider Support (OpenAI, Gemini, Ollama, ...)
mcp-protocol-sdk
[DEPRECATED] Moved to prism-mcp-rs - Enterprise-grade Rust MCP SDK
cursor-feedback-extension
Save your Cursor monthly quota! Unlimited AI interactions in one conversation via MCP feedback loop.
scraper
Context-optimized MCP server for web scraping. Reduces LLM token usage by 70-90% through server-side CSS filtering and HTML-to-markdown conversion.
mcp-gateway
Universal MCP Gateway - Single-port multiplexing with Meta-MCP for ~95% context token savings