1. Conduid
  2. AI
  3. Rmcp
MCP server · AI

Rmcp

BEST Rust SDK for MCP (Model Context Protocol)

Unclaimed Apache-2.0 last commit a year ago llmmcpmodelcontextprotocolrustsdksdk-rust
44Fair

Scored 7 hours ago · breakdown

About Rmcp

Rmcp is an MCP server published by 4t145 in the AI category: bEST Rust SDK for MCP (Model Context Protocol).

The repository has 72 stars and 11 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

From source
git clone https://github.com/4t145/rmcp

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Rmcp

Powered by Claude · Grounded in docs

I know everything about Rmcp. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 5 hours ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • ✓Tests presentA test suite exists in the repository.
  • !Dependencies pinnedNo lockfile. Installs can pull different code over time.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.

1 check has not been run yet.

Releases

release-0.1.5release 0.1.5 · 24 Mar 2025Features: [x] Easy-to-use sse server transport type #27 Bugs: [x] Incompatibilities with python SDK and Js/Ts SDK #32 #31 [x] new SSE implementation bugs #26 Documents: [x] Websocket transport example #28
release-0.1.4release 0.1.4 · 21 Mar 2025Feature [x] Make it easier to startup service cf33783 [x] Add list all helper methods a966125 [x] Replace the SSE implementation so users can customize their client 84d72a1 Document [x] Readme in Chinese 中文README e8ab5f0 [x] Add http…
release-0.1.3release 0.1.3 · 20 Mar 2025What's Changed issue: #10 [x] Timeout 0ce8a43 for single request, 028cd5f for…
release-0.1.2release-0.1.2 · 18 Mar 20251. Fix Typos. 2. New transport interface with less functions. 3. Better user interface to get methods and datas under Peer. 4. Fix several bugs. 5. Change some package setiings for document generate. 6. Change license. related issues 5 6…
release-0.1.1release 0.1.1 🎉 · 16 Mar 2025Full Changelog: https://github.com/4t145/rmcp/compare/release-0.1.0...release-0.1.1

README

NOTICE

This crate was merged into official sdk. We will continue our development there.

RMCP

Crates.io Version Release status docs.rs

A better and clean rust Model Context Protocol SDK implementation with tokio async runtime.

Comparing to official SDK

The Official SDK has too much limit and it was originally built for goose rather than general using purpose.

All the features listed on specification would be implemented in this crate. And the first and most important thing is, this crate has the correct and intact data types. See it yourself.

Usage

Import

rmcp = { version = "0.1", features = ["server"] }
## or dev channel
rmcp = { git = "https://github.com/4t145/rmcp", branch = "dev" }

Quick start

Start a client in one line:

use rmcp::{ServiceExt, transport::TokioChildProcess};
use tokio::process::Command;

let client = ().serve(
    TokioChildProcess::new(Command::new("npx").arg("-y").arg("@modelcontextprotocol/server-everything"))?
).await?;

1. Build a transport

use tokio::io::{stdin, stdout};
let transport = (stdin(), stdout());

The transport type must implemented IntoTransport trait, which allow split into a sink and a stream.

For client, the sink item is ClientJsonRpcMessage and stream item is ServerJsonRpcMessage

For server, the sink item is ServerJsonRpcMessage and stream item is ClientJsonRpcMessage

These types is automatically implemented IntoTransport trait
  1. The types that already implement both Sink and Stream trait.
  2. A tuple of sink Tx and stream Rx: (Tx, Rx).
  3. The type that implement both [tokio::io::AsyncRead] and [tokio::io::AsyncWrite] trait.
  4. A tuple of [tokio::io::AsyncRead] R and [tokio::io::AsyncWrite] W: (R, W).

For example, you can see how we build a transport through TCP stream or http upgrade so easily. examples

2. Build a service

You can easily build a service by using ServerHandler or ClientHandler.

let service = common::counter::Counter::new();

3. Serve them together

// this call will finish the initialization process
let server = service.serve(transport).await?;

4. Interact with the server

Once the server is initialized, you can send requests or notifications:

// request 
let roots = server.list_roots().await?;

// or send notification
server.notify_cancelled(...).await?;

5. Waiting for service shutdown

let quit_reason = server.waiting().await?;
// or cancel it
let quit_reason = server.cancel().await?;

Use marcos to declaring tool

Use toolbox and tool macros to create tool quickly.

Check this file.

use rmcp::{ServerHandler, model::ServerInfo, schemars, tool};

use super::counter::Counter;

#[derive(Debug, serde::Deserialize, schemars::JsonSchema)]
pub struct SumRequest {
    #[schemars(description = "the left hand side number")]
    pub a: i32,
    #[schemars(description = "the right hand side number")]
    pub b: i32,
}
#[derive(Debug, Clone)]
pub struct Calculator;

// create a static toolbox to store the tool attributes
#[tool(tool_box)]
impl Calculator {
    // async function
    #[tool(description = "Calculate the sum of two numbers")]
    async fn sum(&self, #[tool(aggr)] SumRequest { a, b }: SumRequest) -> String {
        (a + b).to_string()
    }

    // sync function
    #[tool(description = "Calculate the sum of two numbers")]
    fn sub(
        &self,
        #[tool(param)]
        // this macro will transfer the schemars and serde's attributes
        #[schemars(description = "the left hand side number")]
        a: i32,
        #[tool(param)]
        #[schemars(description = "the right hand side number")]
        b: i32,
    ) -> String {
        (a - b).to_string()
    }
}

// impl call_tool and list_tool by querying static toolbox
#[tool(tool_box)]
impl ServerHandler for Calculator {
    fn get_info(&self) -> ServerInfo {
        ServerInfo {
            instructions: Some("A simple calculator".into()),
            ..Default::default()
        }
    }
}

The only thing you should do is to make the function's return type implement IntoCallToolResult.

And you can just implement IntoContents, and the return value will be marked as success automatically.

If you return a type of Result<T, E> where T and E both implemented IntoContents, it's also OK.

Manage Multi Services

For many cases you need to manage several service in a collection, you can call into_dyn to convert services into the same type.

let service = service.into_dyn();

Examples

See examples

Features

  • client: use client side sdk
  • server: use server side sdk
  • macros: macros default

Transports

  • transport-io: Server stdio transport
  • transport-sse-server: Server SSE transport
  • transport-child-process: Client stdio transport
  • transport-sse: Client sse transport

Related Resources

README fetched from the repository 5 hours ago. The original is authoritative.

Questions

About Rmcp

How do I install Rmcp?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is Rmcp safe to use with an AI agent?

Its trust score is 44 out of 100 (fair). It passes 4 of the 5 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Rmcp still maintained?

The last commit was a year ago and 6 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.