rust_mcp
a minimal rust implementation of the model completion protocol (MCP) server for building ai assistant tools.
overview
rust_mcp is a lightweight library that lets you build custom tools for ai assistants like claude using the model completion protocol. it handles the json-rpc communication layer and provides a simple api for registering tool handlers.
features
- simple async api for registering tool handlers
- json schema validation for tool parameters
- bidirectional communication over stdin/stdout
- minimal dependencies
usage
add to your project:
import and use the library:
use McpServer;
use json;
use Error;
async
see the examples directory for complete working examples.
mcp integration
this library allows your tools to be used directly by ai assistants that support the model completion protocol, providing seamless integration with systems like claude code.
implementation details
the server communicates over stdin/stdout using json-rpc messages defined by the mcp spec. tool handlers are async functions that take json parameters and return json results.