workers-rs-mcp
An example MCP (Model Context Protocol) server written in Rust, running on Cloudflare Workers.
The server compiles to WebAssembly and runs on Cloudflare's edge infrastructure, handling MCP JSON-RPC requests over HTTP.
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者
An example MCP (Model Context Protocol) server written in Rust, running on Cloudflare Workers.
The server compiles to WebAssembly and runs on Cloudflare's edge infrastructure, handling MCP JSON-RPC requests over HTTP.
Rust MCP server template for Cloudflare workers
HTTP routing is handled by Axum via the workers-rs SDK. MCP protocol logic is handled by the mcpserver crate.
initialize requests generate a new mcp-session-id (UUID v4) returned in the response headermcp-session-id headerIncludes one example tool:
message back to the callerwasm32-unknown-unknown target:
rustup target add wasm32-unknown-unknown
npm install -g wrangler
wrangler dev
wrangler deploy
Pushing to main also deploys automatically via GitHub Actions (requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID secrets).
ToolHandler trait in src/lib.rs:struct MyToolHandler;
#[async_trait]
impl ToolHandler for MyToolHandler {
async fn call(&self, args: Value, _context: Value) -> Result<ToolResult, McpError> {
// your logic here
Ok(text_result("result".to_string()))
}
}
mcp_router.handle_tool("my-tool", Arc::new(MyToolHandler));
mcp/tools.json.Rust MCP server template for Cloudflare workers
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
Workers Rs 透過 stdio 在本機執行。
上次檢查時間:2026-10-28。 Rust MCP server template for Cloudflare workers