★ 349 Rust MIT sse 更新 1小时前

R

Model Context Protocol (MCP) implementation in Rust

安装配置

暂未识别到可直接复制的 MCP 配置,请查看 GitHub README。后台管理员可以补充配置。

README 摘要

# MCPR - Model Context Protocol for Rust A Rust implementation of Anthropic's [Model Context Protocol (MCP)](https://docs.anthropic.com/claude/docs/model-context-protocol), an open standard for connecting AI assistants to data sources and tools. > **⚠️ IMPORTANT NOTICE**: Version 0.2.0 has been yanked due to critical issues with the SSE transport implementation. Please use version 0.2.3 instead, which includes important fixes for client-server communication, message handling, and template generation. If you're already using 0.2.0, we strongly recommend upgrading to 0.2.3 to avoid potential issues. ## Examples **[View Demo on Github Tools MCP Client/Server](https://asciinema.org/a/708211)** ![MCPR Demo](https://asciinema.org/a/708211.png) Check out our [GitHub Tools example](examples/github-tools/README.md) for a complete implementation of an MCP client-server application that interacts with GitHub repositories. This example demonstrates how to build a client that can query repository READMEs and search for repositories, with support for multiple servers and client-server disconnection scenarios. It's a great starting point for understanding how to build your own MCP applications. ## Features - **Schema Definitions**: Complete implementation of the MCP schema - **Transport Layer**: Multiple transport options including stdio and SSE - **High-Level Client/Server**: Easy-to-use client and server implementations - **CLI Tools**: Generate server and client stubs - **Project Generator**: Quickly scaffold new MCP projects - **Mock Implementations**: Built-in mock transports for testing and development ## Coming Soon - **WebSocket Transport**: WebSocket transport implementation is planned but not yet implemented ## Installation Add MCPR to your `Cargo.toml`: ```toml [dependencies] mcpr = "0.2.3" # Make sure to use 0.2.3 or later, as 0.2.0 has been yanked ``` For CLI tools, install globally: ```bash cargo install mcpr ``` ## Usage ### High-Level Client The high-level client provides a simple interface for communicating with MCP servers: ```rust use mcpr::{ client::Client, transport::stdio::StdioTransport, }; // Create a client with stdio transport let transport = StdioTransport::new(); let mut client = Client::new(transport); // Initialize the client client.initialize()?; // Call a tool let request = MyToolRequest { /* ... */ }; let response: MyToolResponse = client.call_tool("my_tool", &request)?; // Shutdown the client client.shutdown()?; ``` ### High-Level Server The high-level server makes it easy to create MCP-compatible servers: ```rust use mcpr::{ server::{Server, ServerConfig}, transport::stdio::StdioTransport, Tool, }; // Configure the server let server_config = ServerConfig::new() .with_name("My MCP Server") .with_version("1.0.0") .with_tool(Tool { name: "my_tool".to_string(), description: "My awesome tool".to_string(), parameters_schema: serde_json::json!({ "type": "object", "properties": { // Tool parameters schema }, "required": ["param1", "param2"] }), }); // Create the server let mut server = Server::new(server_config); // Register tool handlers server.register_tool_handler("my_tool", |params| { // Parse parameters and handle the tool call // ... Ok(serde_json::to_value(response)?) })?; // Start the server with stdio transport let transport = StdioTransport::n...

相关 MCP

Libre Chat

Enhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, M...

★ 37614 TypeScript sse 待补充
mcp sse TypeScript

Github

GitHub's official MCP Server

★ 30243 Go sse 待补充
mcp sse Go

Fast

🚀 The fast, Pythonic way to build MCP servers and clients.

★ 25364 Python sse 待补充
mcp Python sse