Rust MCP Core

v1.0.0Developer Toolsstable

A config-driven MCP server core built on the official Rust SDK. Define tools, auth, prompts, resources, and HTTP behavior in YAML or JSON configuration -- the library handles execution, validation, and protocol compliance with minimal Rust code.

agentsaiclaude-codecodex-cliconfiguration
Share:
9
Stars
0
Downloads
0
Weekly
0/5

What is Rust MCP Core?

Rust MCP Core is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to config-driven mcp server core built on the official rust sdk. define tools, auth, prompts, resources, and http behavior in yaml or json configuration -- the library handles execution, validation, and ...

A config-driven MCP server core built on the official Rust SDK. Define tools, auth, prompts, resources, and HTTP behavior in YAML or JSON configuration -- the library handles execution, validation, and protocol compliance with minimal Rust code.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A config-driven MCP server core built on the official Rust S

Use Cases

Config-driven MCP server implementation
YAML/JSON-based tool definition
nullablevariant

Maintainer

LicenseMIT
Languagerust
Versionv1.0.0
UpdatedApr 4, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx rust-mcp-core

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Rust MCP Core

Rust MCP Core is a config-driven library for building MCP servers on top of the official Rust SDK. Rather than writing protocol boilerplate, developers declare tools, HTTP upstreams, authentication rules, prompts, and resources in a YAML or JSON file; the library handles execution, input validation, rate limiting, and full MCP protocol compliance. It supports both stdio and streamable HTTP transport modes.

Prerequisites

  • Rust toolchain (stable) installed via rustup
  • Tokio async runtime (pulled in automatically as a dependency)
  • Cargo package manager (ships with Rust)
  • For HTTP transport: network access on the configured port
  • For authentication features: bearer token, JWT, or OAuth provider details
1

Add rust-mcp-core to your Cargo project

Create a new Rust binary project or add the dependency to an existing one. Reference the crate from crates.io or directly from GitHub.

cargo new my-mcp-server
cd my-mcp-server

# Add to Cargo.toml:
# [dependencies]
# rust-mcp-core = "0.1"

# Or from GitHub:
# rust-mcp-core = { git = "https://github.com/nullablevariant/rust-mcp-core" }
2

Write the minimal main.rs

The entry point needs only a few lines. Load the YAML config file and call runtime::run_from_config — the library does the rest.

use rust_mcp_core::{load_mcp_config_from_path, runtime, PluginRegistry};

#[tokio::main]
async fn main() -> Result<(), rust_mcp_core::McpError> {
    let config = load_mcp_config_from_path("config/mcp_config.yml".into())?;
    runtime::run_from_config(config, PluginRegistry::new()).await
}
3

Create the YAML configuration file

Define the server transport, upstream HTTP APIs, and tools in config/mcp_config.yml. Environment variables can be injected using the ${env:VAR_NAME} syntax.

version: 1
server:
  host: 0.0.0.0
  port: 3000
  endpoint_path: /mcp
  transport:
    mode: streamable_http
  auth:
    enabled: false
  logging:
    level: info

upstreams:
  api:
    base_url: ${env:API_BASE_URL}

tools:
  items:
    - name: api.list_items
      description: List items from the upstream API
      input_schema:
        type: object
        properties:
          query:
            type: string
      execute:
        type: http
        upstream: api
        method: GET
        path: /items
        query:
          q: "${query}"
4

Build with the appropriate feature flags

Select only the features your server needs. The default build includes streamable HTTP support. Add auth, http_hardening, or other features as required.

# Default build (streamable HTTP included)
cargo build --release

# Minimal build: stdio transport only
cargo build --release --no-default-features

# Selective features
cargo build --release --no-default-features --features http_tools,auth,prompts
5

Register the server in your MCP client

Point your MCP client at the running HTTP endpoint or configure it to launch the binary via stdio transport.

{
  "mcpServers": {
    "my-rust-server": {
      "command": "/path/to/my-mcp-server/target/release/my-mcp-server",
      "args": [],
      "env": {
        "API_BASE_URL": "https://api.example.com"
      }
    }
  }
}

Rust MCP Core Examples

Client configuration

Claude Desktop configuration for a rust-mcp-core binary running in stdio mode. Set any upstream API URLs via environment variables.

{
  "mcpServers": {
    "my-rust-mcp": {
      "command": "/home/user/my-mcp-server/target/release/my-mcp-server",
      "args": [],
      "env": {
        "API_BASE_URL": "https://internal-api.example.com",
        "RUST_LOG": "info"
      }
    }
  }
}

Prompts to try

Once tools are declared in your YAML config, you can invoke them through the AI client naturally.

- "List all items matching the query 'invoices' from the API"
- "Call the api.list_items tool with query set to 'active users'"
- "What tools are available in this MCP server?"
- "Use the HTTP tool to fetch data from the upstream and summarize the results"

Troubleshooting Rust MCP Core

Compilation fails with 'feature not found' or missing dependency errors

Ensure your Rust toolchain is up to date (rustup update stable). Check that the feature flags in your Cargo.toml match those documented in the repository — feature names are case-sensitive. Run cargo check before a full build to see detailed errors.

Environment variable substitution (${env:VAR}) is not working in YAML config

The variable must be set in the environment before the binary starts. If using Claude Desktop, set it in the env block of the mcpServers config object. Verify with echo $VAR_NAME in your shell to confirm the variable is exported.

HTTP transport mode returns connection refused errors

Confirm the host and port in mcp_config.yml are not blocked by a firewall or already in use by another process. For local development use 127.0.0.1 instead of 0.0.0.0. Run lsof -i :3000 (macOS/Linux) to check port availability.

Frequently Asked Questions about Rust MCP Core

What is Rust MCP Core?

Rust MCP Core is a Model Context Protocol (MCP) server that config-driven mcp server core built on the official rust sdk. define tools, auth, prompts, resources, and http behavior in yaml or json configuration -- the library handles execution, validation, and protocol compliance with minimal rust code. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Rust MCP Core?

Follow the installation instructions on the Rust MCP Core GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Rust MCP Core?

Rust MCP Core works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Rust MCP Core free to use?

Yes, Rust MCP Core is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "rust-mcp-core": { "command": "npx", "args": ["-y", "rust-mcp-core"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Rust MCP Core?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides