Expand description
§mcp_rust_server
High-performance Model Context Protocol (MCP) server for code analysis, security scanning, and project insights.
§Features
- Fast & Scalable: async Rust on Tokio runtime
- Protocols: stdio and SSE (Server-Sent Events) transports
- Extensible: easy to add new handlers and endpoints
- Production-Ready: optimized release profile and structured logging
§Installation
As a library
Add to your Cargo.toml
dependencies:
[dependencies]
mcp-rust-server = "0.1.0"
As CLI binaries
Install from crates.io with Cargo:
cargo install mcp-rust-server
Binaries (mcp-stdio
and mcp-sse
) are placed in $CARGO_HOME/bin
.
§Usage
§Library
use mcp_rust_server::{start_stdio, start_sse};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Run as stdio MCP server
start_stdio().await?;
// Or run as SSE MCP server
// start_sse().await?;
Ok(())
}
§CLI
# Start stdio server
mcp-stdio
# Start SSE server
mcp-sse
§Examples
See each function’s docs below for more examples.
Functions§
- start_
sse - Starts the MCP server in SSE (Server-Sent Events) mode.
- start_
stdio - Starts the MCP server in stdio mode.