
linux-china/mcp-rs-template
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
linux-china/mcp-rs-template - кандидат на сервер MCP, импортированный из https://github.com/linux-china/mcp-rs-template.
Обзор
linux-china/mcp-rs-template - кандидат на сервер MCP, импортированный из https://github.com/linux-china/mcp-rs-template.
Обзор (машинный перевод)
MCP Rust CLI сервер шаблон
Model Context Protocol (MCP) - это открытый протокол, который обеспечивает бесшовную интеграцию между приложениями LLM. Внешние источники данных и инструменты. Независимо от того, создаете ли вы IDE на основе ИИ, улучшая интерфейс чата, Создавая собственные рабочие процессы ИИ, MCP предоставляет стандартизированный способ подключения LLM к необходимому контексту.
mcp-rs-template - это простой шаблон приложения, который демонстрирует, как реализовать сервер MCP CLI в Rust.
Как использовать шаблон?
- Клонировать хранилище
2.Изменить информацию о проекте в
Cargo.tomlиsrc/mcp/mod.rs3.Изменить обработчики серверов: [[Т2]]: обработчики подсказок [[Т3]]: обработчики ресурсов
src/mcp/tools.rs: обработчики инструментов 4.Изменитьsrc/mcp/templates/*.json, если вы предпочитаете использовать файлы json для подсказок, ресурсов и инструментов
mcp-rs-template основан на ржавчине-rpc-router, маршрутизации JSON-RPC. Библиотека для ржавчины.
#варианты CLI
--mcp: Включить MCP-сервер
--resources: отображение ресурсов
--prompts: отображение подсказок
--tools: инструменты отображения
Как использовать сервер MCP CLI в Claude Desktop?
- Редактировать 'claude desktop config.
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
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 Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"current-time": {
"command": "mcp-rs-template",
"args": [
"--mcp"
],
"env": {
"API_KEY": "xxxx"
}
}
}
}