
linux-china/mcp-rs-template
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
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)は、LM アプリケーション間でシームレスな統合を可能にするオープンプロトコルです。 外部のデータソースとツール。 AI 搭載 IDE の構築、チャット インターフェイスの強化、 またはカスタムAIワークフローを作成したり、MCP は LLM を必要なコンテキストに接続するための標準化された方法を提供します。
mcp-rs-template は、Rust で MCP CLI サーバを実装する方法を示すシンプルなアプリケーションテンプレートです。
テンプレートの使い方
- リポジトリのクローン化
- [
Cargo.tomlおよび [src/mcp/mod.rs] でプロジェクト情報を変更します。 - サーバー ハンドラの変更:
- [
src/mcp/prompts.rs: プロンプト ハンドラ - [
src/mcp/resources.rs:リソースハンドラ - [
src/mcp/tools.rs:ツールハンドラ 4。 プロンプト、リソース、およびツールの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 MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"current-time": {
"command": "mcp-rs-template",
"args": [
"--mcp"
],
"env": {
"API_KEY": "xxxx"
}
}
}
}