소스 정보
- 저장소
- publieople/hermes-config-kit
- 최근 소스 활동
- 2026년 8월 8일 22:00
- 감지된 SKILL.md 언어
- 중국어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/publieople/hermes-config-kit --skill rust-mcp-server명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | rust-mcp-server |
| description | 用 Rust 写 MCP server(rmcp crate)并暴露 CLI/工具为 MCP tools。 |
| category | mcp |
| tags | ["mcp","rust","rmcp","stdio","ai-agent","protocol"] |
用 rmcp crate 把现有 Rust 工具/CLI 暴露为 MCP tools,让协议系 agent 能调用。MCP 是 CLI 的薄适配层——core 只暴露 CLI/函数,server 只做包装。
[dependencies]
rmcp = { version = "3.1", features = ["server", "transport-io", "macros"] }
schemars = { version = "1.0", features = ["derive"] } # ← 必须 1.0,见坑表
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
anyhow = "1"
features 名:server + transport-io(stdio)。没有 server-stdio feature(不存在,写了会 resolve 冲突)。查真实 feature 列表:crates.io/api/v1/crates/rmcp/<version> 的 JSON。
use rmcp::{
ServerHandler, ServiceExt,
handler::server::{router::tool::ToolRouter, wrapper::Parameters},
tool, tool_handler, tool_router,
};
use rmcp::schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone)]
pub struct MyServer { tool_router: ToolRouter<Self> }
impl MyServer {
pub fn new() -> Self { Self { tool_router: Self::tool_router() } }
}
#[tool_handler(router = self.tool_router)]
impl ServerHandler for MyServer {}
#[derive(Serialize, Deserialize, JsonSchema)]
struct ListParam { #[serde(default)] category: Option<String> }
#[tool_router(router = tool_router)]
impl MyServer {
/// 工具描述(agent 看到的就是这个)。
#[tool(name = "list_items", description = "List items. Returns JSON array.")]
pub async fn list_items(&self, p: Parameters<ListParam>) -> String {
// 返回 String(JSON 文本),MCP 会包成 text content
serde_json::to_string(&vec![, , ]).()
}
}
() anyhow::<()> {
= MyServer::().(rmcp::transport::io::()).?;
running.().?;
(())
}
import subprocess, json, select
p = subprocess.Popen(['./target/debug/my-mcp'], stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1)
def send(o): p.stdin.write(json.dumps(o) + '\n'); p.stdin.flush()
def recv(t=3):
r,_,_ = select.select([p.stdout], [], [], t)
return p.stdout.readline().strip() if r else None
send({"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"1"}}})
print("init:", recv())
send({"jsonrpc":"2.0","method":"notifications/initialized"})
send({"jsonrpc":"2.0","id":2,"method":"tools/list"})
print("tools:", recv(5))
stdio 传输是 JSON-Lines(每行一个 JSON + \n),不是 Content-Length 帧。
见 references/rmcp-3.1-pitfalls.md。高频要点:
JsonSchema 和 rmcp 的 Parameters<T> 类型不兼容 → trait bound unsatisfied。要么 rmcp::schemars::JsonSchema(derive 宏要独立 schemars 开 derive feature),要么独立 schemars 1.0 + derive。RunningService::waiting().await 必须调用:serve() 返回后 main 一结束 RunningService 被 drop → 连接关闭 → 进程退出。症状:init 响应正常,但 tools/list 时 BrokenPipe。这是本会话最隐蔽的坑。#[tool(aggr)] 属性:参数就是 Parameters<T> 类型,直接作为 fn 参数,不要加任何 attribute。references/rmcp-3.1-pitfalls.md — rmcp 3.1 完整坑位(版本、宏、stdio、进程生命周期)