
linux-china/mcp-rs-template 是从 https://github.com/linux-china/mcp-rs-template. 导入的 MCP 服务器候选。
概览
linux-china/mcp-rs-template 是从 https://github.com/linux-china/mcp-rs-template. 导入的 MCP 服务器候选。
概述(AI 翻译)
MCP Rust CLI 服务器模板
模型上下文协议(MCP)是一种开放协议,能够实现LLM应用之间的无缝集成 以及外部数据源和工具。无论你是在构建一个由人工智能驱动的集成开发环境(IDE),还是在增强聊天界面, 或创建自定义AI工作流,MCP为LLM与所需上下文连接提供了标准化方式。
mcp-rs-template 是一个简单的应用模板,演示如何在 Rust 中实现 MCP CLI 服务器。
如何使用模板?
- 克隆仓库
- 修改
Cargo.toml和[[T1]中的项目信息] - 修改服务器处理器:
src/mcp/prompts.rs:提示处理器src/mcp/resources.rs:资源处理程序src/mcp/tools.rs:工具搬运工
- 如果你喜欢使用json文件作为提示、资源和工具,请修改
src/mcp/templates/*.json
mcp-rs-template 基于 rust-rpc-router,一种 JSON-RPC 路由 Rust 的图书馆。
CLI选项
--mcp:启用MCP服务器--resources:显示资源--prompts:显示提示--tools:显示工具
如何在 Claude Desktop 中使用 MCP CLI 服务器?
- 编辑’claude_desktop_config。
本页由 AI 翻译,技术细节请以原文为准。
README
MCP Rust CLI server template
Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you’re building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
mcp-rs-template is a simple application template that demonstrates how to implement MCP CLI server in Rust.
How to use template?
- Clone the repository
- Modify project information in
Cargo.tomlandsrc/mcp/mod.rs - Modify server handlers:
src/mcp/prompts.rs: prompts handlerssrc/mcp/resources.rs: resources handlerssrc/mcp/tools.rs: tools handlers
- Modify
src/mcp/templates/*.jsonif you prefer to use json files for prompts, resources, and tools
mcp-rs-template is based on rust-rpc-router, a JSON-RPC routing library for Rust.
CLI options
--mcp: Enable MCP server--resources: display resources--prompts: display prompts--tools: display tools
How to use MCP CLI server in Claude Desktop?
- Edit
claude_desktop_config.json: Claude Desktop ->Settings->Developer->Edit Config - Add the following configuration to the
serverssection:
{
"mcpServers": {
"current-time": {
"command": "mcp-rs-template",
"args": [
"--mcp"
],
"env": {
"API_KEY": "xxxx"
}
}
}
}
If you want to check MCP log, please use tail -n 20 -f ~/Library/Logs/Claude/mcp*.log.
References
- MCP Specification: https://spec.modelcontextprotocol.io/
- Model Context Protocol (MCP): https://modelcontextprotocol.io/introduction
- rpc-router: json-rpc routing library - https://github.com/jeremychone/rust-rpc-router/
- Zed context_server: https://github.com/zed-industries/zed/tree/main/crates/context_server
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"current-time": {
"command": "mcp-rs-template",
"args": [
"--mcp"
],
"env": {
"API_KEY": "xxxx"
}
}
}
}