technical February 28, 2026 · 3 min read

Building MCP Servers in Rust: A Practical Guide

How to build high-performance MCP servers in Rust using the rmcp SDK. From zero to a working server in 15 minutes.

Why Rust for MCP?

The Model Context Protocol (MCP) is the emerging standard for giving AI agents access to tools and data. Most MCP server implementations today are in TypeScript — they work, but they come with Node.js overhead: cold start times, memory usage, and the npm dependency tree.

Jupiter’s entire ecosystem runs on Rust MCP servers. The difference is measurable:

MetricTypeScript (Node.js)Rust
Cold start~200ms~5ms
Memory (idle)~50MB~3MB
Binary size80MB+ (with node_modules)~5MB
Dependencieshundredsminimal

For a system like Jupiter that spawns multiple MCP servers per worker session, these numbers compound fast.

Getting started with rmcp

The rmcp crate is the Rust SDK for building MCP servers. Let’s build a simple one.

use rmcp::{Server, Tool, tool};

#[tool(description = "Add two numbers")]
async fn add(a: f64, b: f64) -> f64 {
    a + b
}

#[tool(description = "Get current timestamp")]
async fn now() -> String {
    chrono::Utc::now().to_rfc3339()
}

#[tokio::main]
async fn main() {
    Server::new("my-tools")
        .tool(add)
        .tool(now)
        .serve_stdio()
        .await
        .unwrap();
}

That’s a complete MCP server. Two tools, stdio transport, zero boilerplate.

Adding resources

MCP servers can also expose resources — read-only data that agents can access. This is perfect for configuration files, documentation, or database schemas.

use rmcp::{Server, Resource, resource};

#[resource(
    uri = "config://app",
    description = "Application configuration"
)]
async fn app_config() -> String {
    std::fs::read_to_string("config.toml")
        .unwrap_or_default()
}

Transport options

MCP supports multiple transport protocols:

  • stdio — the default. Server reads from stdin, writes to stdout. Simple, works everywhere.
  • SSE (Server-Sent Events) — HTTP-based, good for remote servers. Jupiter uses this for distributed worker deployments.
  • Streamable HTTP — the newest transport, bi-directional over HTTP.
// SSE transport
Server::new("my-tools")
    .tool(add)
    .serve_sse("0.0.0.0:8080")
    .await?;

Jupiter’s MCP ecosystem

Every MCP server in Jupiter’s orbit is a Rust binary. Here are the ones we use daily:

  • rust-mcp-filesystem — file operations (read, write, search, move)
  • cargo-mcp — full Cargo toolchain (build, test, clippy, crates.io API)
  • narsil-mcp — code intelligence with 90 tools across 32 languages
  • mcp-tools — multi-tool suite: code analysis, git, system ops

These are open source community projects that we integrate, not fork. Each one becomes a “moon” in Jupiter’s orbit — a capability that every worker can access.

Testing your server

The mcp-probe tool (installable via cargo install mcp-cli) gives you a TUI debugger for any MCP server:

mcp-probe stdio -- cargo run --bin my-tools

This opens an interactive terminal where you can browse tools, call them with parameters, and inspect responses. Essential for development.

Next steps

If you’re building MCP servers for Jupiter or any other MCP-compatible system, the Rust ecosystem has everything you need. Start with rmcp, test with mcp-probe, and ship a single binary with zero runtime dependencies.

The Rust MCP ecosystem is growing fast. Check out our MCP Ecosystem page for the full list of servers in Jupiter’s orbit.