mcp-stama: High-Performance Rust MCP Server for AI Agents
mcp-stama is a high-performance Model Context Protocol (MCP) server written in Rust, designed to provide AI coding agents with local context through a single static binary. It eliminates the overhead associated with Node.js or Python runtimes, reducing cold startup times from seconds to under 2 milliseconds and lowering memory usage from hundreds of megabytes to under 10MB.
Performance Benchmarks
mcp-stama significantly outperforms legacy MCP servers built on Node.js or Python across all primary resource metrics. By utilizing a native Rust implementation, it achieves near-instant execution and minimal system impact.
| Metric | Legacy MCP Servers (Node / Python) | mcp-stama (Rust) |
|---|---|---|
| Cold Startup Time | 1,500ms – 3,000ms | < 2ms |
| p50 Execution Latency | 150ms – 800ms | 300µs – 5ms |
| Memory Footprint (RSS) | 180 MB – 350 MB | < 10 MB |
| Dependencies | 100+ packages | Zero external runtimes |
| Installation | Requires Node.js / Python setup | Single static binary |
Internal micro-benchmarks for specific tools further demonstrate this efficiency:
| Tool Name | Invocations | p50 Latency | p99 Latency | Memory Footprint (RSS) |
|---|---|---|---|---|
docker_watcher |
100 | 327 µs | 1.66 ms | < 10 MB |
git_snapshot |
100 | 462 µs | 1.36 ms | < 10 MB |
fast_grep |
100 | 5.05 ms | 8.72 ms | < 10 MB |
Built-in High-Performance Tools
mcp-stama includes several specialized tools engineered to provide deep local context to AI agents without spawning heavy child processes or wasting prompt tokens.
fast_grep
This tool provides sub-millisecond file search and regex scanning. It utilizes ignore::WalkBuilder to automatically respect .gitignore and .ignore files while skipping binary and hidden files.
git_snapshot
Powered by gix (gitoxide), this is a pure-Rust Git inspector. It fetches HEAD commits, branch information, line deltas, and file status natively, removing the need to call the external git executable.
docker_watcher
This tool provides instant host and container diagnostics using bollard and sysinfo. It gives AI agents visibility into running Docker containers, system memory, CPU cores, and mapped ports.
Installation and Configuration
mcp-stama is distributed as a single static binary and includes an auto-configurator to streamline integration with AI editors.
Installation
- macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/StamManif/mcp-stama/main/install.sh | sh - Windows (PowerShell):
iwr -useb https://raw.githubusercontent.com/StamManif/mcp-stama/main/install.ps1 | iex - Cargo:
cargo install mcp-stama
Auto-Configuration
Users can automatically inject the server into their editor settings using the following flags:
- Claude Desktop:
mcp-stama --install-claude - Cursor:
mcp-stama --install-cursor
Manual Configuration
For manual setup, add the following to the respective configuration files (~/.cursor/mcp.json for Cursor or claude_desktop_config.json for Claude Desktop):
{
"mcpServers": {
"mcp-stama": {
"command": "mcp-stama",
"args": []
}
}
}
Technical Architecture
mcp-stama implements a Pure Stdio JSON-RPC 2.0 interface. To maintain strict compliance with the JSON-RPC frame protocol, all diagnostic and logging outputs are routed to stderr, ensuring that stdout remains dedicated exclusively to protocol traffic.
The request flow follows a linear path: AI Client (Cursor/Claude) $\rightarrow$ StdioTransport $\rightarrow$ JsonRpcRequest/Response $\rightarrow$ ToolRegistry $\rightarrow$ Specific Tool (fast_grep, git_snapshot, or docker_watcher).
Sources
Related
- Project
- Project
- Project
- Project
- Project