MCP Rust CLI server template

MCP开发工具

提供方 MCP-Mirror

开发工具 未标注 API Key 社区 / 第三方 Claude DesktopClaudeCursorCodex
查看接入方式

Mirror of

一句话选型结论

按资料字段整理

MCP Rust CLI server template 属于开发工具类 MCP 服务器,传输方式未标注,API Key,可直接接入 Claude Desktop、Claude、Cursor 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类开发工具 传输方式未标注 鉴权API Key 部署方式未标注
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

开发工具
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

mcp rust cli server template

支持客户端

适用场景

mcprustcli

安装与配置

未标注 API Key
上游未给出传输方式
mcp-rs-template --mcp

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
代码与仓库操作

在对话里直接查代码、提 issue、走 PR,省掉来回切工具。

本地命令与脚本

把构建、测试、格式化这类重复命令交给模型执行。

接口联调与测试

让模型调你的接口、跑一遍用例,快速定位问题。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • 使用前要准备好API Key对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Rust CLI server template当前 未标注 未标注 未标注 有 未标注
Git 838e2ec1 12 stdio · 本地进程 本地部署 有 2026-05-17
Markitdown MCP 2c653a5f 1 stdio · 本地进程 本地部署 有 2026-05-17
JavaGuide 未标注 stdio · 本地进程 本地部署 有 2026-04-11
awesome-claude-skills 未标注 stdio · 本地进程 本地部署 有 2026-04-26
Context7 831acf40 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

开发工具
字段来自项目仓库与公开索引,中文说明由本站标注
提供方MCP-Mirror上游标注的维护方 MCP-Mirror
分类开发工具本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式API Key远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · Cross-platform本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

10.4 KB
来自项目仓库与上游目录的原文,未做删改

rpc-router - JSON-RPC Routing Library

API changes for v0.2.0
- RpcId - Now uses a concrete type for RpcId.
- RpcRequest - The old Request is now renamed RpcRequest. The design is that raw JSON-RPC constructs are prefixed with Rpc.
- RpcNotification - New type (Like RpcRequest but with no .id as per the spec).
- RpcResponse - New type.

Getting Started

rpc-router is a JSON-RPC routing library in Rust for asynchronous dynamic dispatch with support for variadic arguments (up to 8 resources + 1 optional parameter). (Code snippets below are from: examples/c00-readme.rs)

The goal of this library is to enable application functions with different argument types and signatures as follows:```rust
pub async fn create_task(mm: ModelManager, aim: AiManager, params: TaskForCreate) -> Result<i64, MyError> {
// ...
}
pub async fn get_task(mm: ModelManager, params: ParamsIded) -> Result<Task, MyError> {
// ...
}


To be callable from a JSON-RPC request as follows:```rust
// JSON-RPC request coming from Axum route payload, Tauri command params, ...
let rpc_request = json!(
   { jsonrpc: &quot;2.0&quot;, id: 1,          // required by JSON-RPC
     method:  &quot;create_task&quot;,         // method name (matches function name)
     params:  {title: &quot;First Task&quot;}  // optional params (last function argument)
   }).try_into()?;

// Async execute the RPC request
let call_response = rpc_router.call(rpc_request).await?;

For this, we just need to build the router, the resources, parse the JSON-RPC request, and execute the call from the router as follows:``rust // Build the Router with the handlers and common resources let rpc_router = router_builder!( handlers: [get_task, create_task], // will be turned into routes resources: [ModelManager {}, AiManager {}] // common resources for all calls ) .build(); // Can do the same withRouter::builder().append(...)/append_resource(...)`

// Create and parse rpc request example.
let rpc_request: rpc_router::Request = json!({
"jsonrpc": "2.0",
"id": "some-client-req-id", // JSON-RPC request id. Can be null, num, string, but must be present.
"method": "create_task",
"params": { "title": "First task" } // optional.
}).try_into()?;

// Async execute the RPC request.
let call_response = rpc_router.call(rpc_resources, rpc_request).await?;

// Or call_with_resources for additional per-call resources that override router common resources.
// e.g., rpc_router.call_with_resources(rpc_request, additional_resources)

// Display the response.
let CallSuccess { id, method, value } = call_response;
println!(
r#"RPC call response:

id:  {id:?},

method: {method},
value: {value:?},
"#
);


See examples/c00-readme.rs for the complete working code.

For the above to work, here are the requirements for the various types:

- `ModelManager` and `AiManager` are rpc-router **Resources**. These types just need to implement `rpc_router::FromResources` (the trait has a default implementation, and `RpcResource` derive macros can generate this one-liner implementation).```rust
// Make it a Resource with RpcResource derive macro
#[derive(Clone, RpcResource)]
pub struct ModelManager {}

// Make it a Resource by implementing FromResources
#[derive(Clone)]
pub struct AiManager {}
impl FromResources for AiManager {}
  • TaskForCreate and ParamsIded are used as JSON-RPC Params and must implement the rpc_router::IntoParams trait, which has a default implementation, and can also be implemented by RpcParams derive macros.```rust
    // Make it a Params with RpcParams derive macro

[derive(Serialize, Deserialize, RpcParams)]

pub struct TaskForCreate {
title: String,
done: Option<bool>,
}

// Make it a Params by implementing IntoParams

[derive(Deserialize)]

pub struct ParamsIded {
pub id: i64,
}
impl IntoParams for ParamsIded {}


- `Task`, as a returned value, just needs to implement `serde::Serialize````rust
#[derive(Serialize)]
pub struct Task {
    id: i64,
    title: String,
    done: bool,
}
  • MyError must implement IntoHandlerError, which also has a default implementation, and can also be implemented by RpcHandlerError derive macros.```rust

[derive(Debug, thiserror::Error, RpcHandlerError)]

pub enum MyError {
// TBC
#[error("TitleCannotBeEmpty")]
TitleCannotBeEmpty,
}


By the Rust type model, these application errors are set in the `HandlerError` and need to be retrieved by `handler_error.get::()`. See examples/c05-error-handling.rs.

Full code: examples/c00-readme.rs

&gt; **IMPORTANT**
&gt;
&gt; For the `0.1.x` releases, there may be some changes to types or API naming. Therefore, the version should be locked to the latest version used, for example, `=0.1.0`. I will try to keep changes to a minimum, if any, and document them in the future CHANGELOG.
&gt;
&gt; Once `0.2.0` is released, I will adhere more strictly to semantic versioning.

### Concepts

This library has the following main constructs:

1) `Router` - Router is the construct that holds all of the Handler Functions and can be invoked with `router.call(resources, rpc_request)`. Here are the two main ways to build a `Router` object:
    - **RouterBuilder** - via `RouterBuilder::default()` or `Router::builder()`, then call `.append(name, function)` or `.append_dyn(name, function.into_dyn())` to avoid type monomorphization at the &quot;append&quot; stage.
    - **router_builder!** - via the macro `router_builder!(function1, function2, ...)`. This will create, initialize, and return a `RouterBuilder` object.
    - In both cases, call `.build()` to construct the immutable, shareable (via inner Arc) `Router` object.

2) `Resources` - Resources is the type map construct that holds the resources that an RPC handler function might request.
    - It&#x27;s similar to Axum State/RequestExtractor or the Tauri State model. In the case of `rpc-router`, there is one &quot;domain space&quot; for those states called resources.
    - It&#x27;s built via `ResourcesBuilder::default().append(my_object)...build()`.
    - Or via the macro `resources_builder![my_object1, my_object2].build()`.
    - The `Resources` hold the type map in an `Arc&lt;&gt;` and are completely immutable and can be cloned effectively.
    - `ResourcesBuilder` is not wrapped in an `Arc&lt;&gt;`, and cloning it will clone the full type map. This can be very useful for sharing a common base resources builder across various calls while allowing each call to add more per-request resources.
    - All the values/objects inserted into the Resources must implement `Clone + Send + Sync + &#x27;static` (here `&#x27;static` means the type cannot have any references other than static ones).

3) `Request` - Is the object that has the JSON-RPC Request `id`, `method`, and `params`.
    - To make a struct a `params`, it has to implement the `rpc_router::IntoParams` trait, which has a default implementation.
    - So, implement `impl rpc_router::IntoParams for ... {}` or `#[derive(RpcParams)]`.
    - `rpc_router::Request::from_value(serde_json::Value) -&gt; Result` will return a `RequestParsingError` if the Value does not have `id: Value`, `method: String` or if the Value does not contain `&quot;jsonrpc&quot;: &quot;2.0&quot;` as per the JSON-RPC spec.
    - `let request: rpc_router::Request = value.try_into()?` uses the same `from_value` validation steps.
    - Doing `serde_json::from_value::(value)` will not change the `jsonrpc`.

4) `Handler` - RPC handler functions can be any async application function that takes up to 8 resource arguments, plus an optional Params argument.
    - For example, `async fn create_task(_mm: ModelManager, aim: AiManager, params: TaskForCreate) -&gt; MyResult`

5) `HandlerError` - RPC handler functions can return their own `Result` as long as the error type implements `IntoHandlerError`, which can be easily implemented as `rpc_router::HandlerResult` which includes an `impl IntoHandlerError for MyError {}`, or with the `RpcHandlerError` derive macro.
    - To allow handler functions to return their application error, `HandlerError` is essentially a type holder that allows the extraction of the application error with `handler_error.get()`.
    - This requires the application code to know which error type to extract but provides flexibility to return any Error type.
    - Typically, an application will have a few application error types for its handlers, so this ergonomic trade-off still has net positive value as it enables the use of application-specific error types.

6) `CallResult` - `router.call(...)` will return a `CallResult`, which is a `Result` where both include the JSON-RPC `id` and `method` name context for future processing.
    - `CallError` contains `.error: rpc_router::Error`, which includes `rpc_router::Error::Handler(HandlerError)` in the event of a handler error.
    - `CallSuccess` contains `.value: serde_json::Value`, which is the serialized value returned by a successful handler call.

### Derive Macros

`rpc-router` has some convenient derive proc macros that generate the implementation of various traits.

This is just a stylistic convenience, as the traits themselves have default implementations and are typically one-liner implementations.

&gt; Note: These derive proc macros are prefixed with `Rpc` since macros often have generic names, so the prefix adds clarity. Other `rpc-router` types are without the prefix to follow Rust customs.

### `#[derive(rpc_router::RpcParams)]`

Implements `rpc_router::IntoParams` for the type.

Works on simple types.```rust
#[derive(serde::Deserialize, rpc_router::RpcParams)]
pub struct ParamsIded {
    id: i64
}

// Will generate:
// impl rpc_router::IntoParams for ParamsIded {}

Works with generic types (all will be bound to DeserializeOwned + Send):```rust

[derive(rpc_router::RpcParams)]

pub struct ParamsForUpdate<D> {
id: i64,
D
}
// Will generate
// impl<D> IntoParams for ParamsForUpdate<D> where D: DeserializeOwned + Send {}


### `#[derive(rpc_router::RpcResource)]`

Implements the `rpc_router::FromResource` trait.```rust
#[derive(Clone, rpc_router::RpcResource)]
pub struct ModelManager;

// Will generate:
// impl FromResources for ModelManager {}

The FromResources trait has a default implementation to get the T type (here ModelManager) from the rpc_router::Resources type map.

#[derive(rpc_router::RpcHandlerError)]

Implements the rpc_router::IntoHandlerError trait.```rust

[derive(Debug, Serialize, RpcHandlerError)]

pub enum MyError {
InvalidName,
// ...
}

// Will generate:
// impl IntoHandlerError for MyError {}
```

Related Links

  • GitHub Repo
  • crates.io
  • Rust10x rust-web-app (web-app code blueprint using rpc-router with Axum)

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
MCP Rust CLI server template 怎么安装?

在客户端按下面的安装命令接入:mcp-rs-template --mcp。装完在客户端配置里引用同一个包或端点。

MCP Rust CLI server template 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

MCP Rust CLI server template 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Rust CLI server template 需要 API Key 吗?

资料标注需要API Key认证,使用前准备好对应凭据,并按最小权限配置。

MCP Rust CLI server template 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

MCP Rust CLI server template 能提供哪些能力?

资料显示能力标签包括 mcp、rust、cli、server、template。具体工具清单以官方文档为准。

MCP Rust CLI server template 需要什么运行环境?

运行时为 Cross-platform。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。