diff --git a/README.md b/README.md index 6e935d09..2721f3fa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ -
-简体中文(待更新) -
- # RMCP [![Crates.io Version](https://img.shields.io/crates/v/rmcp)](https://crates.io/crates/rmcp) @@ -28,7 +24,6 @@ rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", branch = "mai Basic dependencies: - [tokio required](https://github.com/tokio-rs/tokio) - [serde required](https://github.com/serde-rs/serde) -Json Schema generation(Must follow the 2020-12 version): - [shemars required](https://github.com/GREsau/schemars) @@ -116,8 +111,11 @@ See [oauth_support](docs/OAUTH_SUPPORT.md) for details. ## Related Resources -- [MCP Specification](https://spec.modelcontextprotocol.io/specification/2024-11-05/) -- [Schema](https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.ts) +- [MCP Specification 2025-06-18](https://modelcontextprotocol.io/specification/2025-06-18) + + +- [Schema 2025-06-18](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/schema/2025-06-18/schema.ts) +(Note that the spec now declares 2020-12 as default, [reference](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/655/files#top)) ## Related Projects diff --git a/docs/readme/README.zh-cn.md b/docs/readme/README.zh-cn.md deleted file mode 100644 index 9af7d1b3..00000000 --- a/docs/readme/README.zh-cn.md +++ /dev/null @@ -1,123 +0,0 @@ -# RMCP -[![Crates.io Version](https://img.shields.io/crates/v/rmcp)](https://crates.io/crates/rmcp) -![Release status](https://github.commodelcontextprotocol/rust-sdk/actions/workflows/release.yml/badge.svg) -[![docs.rs](https://img.shields.io/docsrs/rmcp)](https://docs.rs/rmcp/latest/rmcp) - -一个基于 tokio 异步运行时的官方 Model Context Protocol SDK 实现。 - -本项目使用了以下开源库: - -- [rmcp](crates/rmcp): 实现 RMCP 协议的核心库 (详见:[rmcp](crates/rmcp/README.md)) -- [rmcp-macros](crates/rmcp-macros): 一个用于生成 RMCP 工具实现的过程宏库。 (详见:[rmcp-macros](crates/rmcp-macros/README.md)) - -## 使用 - -### 导入 -```toml -rmcp = { version = "0.2.0", features = ["server"] } -## 或使用最新开发版本 -rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", branch = "main" } -``` - -### 第三方依赖库 -基本依赖: -- [tokio required](https://github.com/tokio-rs/tokio) -- [serde required](https://github.com/serde-rs/serde) - -### 构建客户端 -
-构建客户端 - -```rust, ignore -use rmcp::{ServiceExt, transport::{TokioChildProcess, ConfigureCommandExt}}; -use tokio::process::Command; - -#[tokio::main] -async fn main() -> Result<(), Box> { - let client = ().serve(TokioChildProcess::new(Command::new("npx").configure(|cmd| { - cmd.arg("-y").arg("@modelcontextprotocol/server-everything"); - }))?).await?; - Ok(()) -} -``` -
- -### 构建服务端 - -
-构建传输层 - -```rust, ignore -use tokio::io::{stdin, stdout}; -let transport = (stdin(), stdout()); -``` - -
- -
-构建服务 - -You can easily build a service by using [`ServerHandler`](crates/rmcp/src/handler/server.rs) or [`ClientHandler`](crates/rmcp/src/handler/client.rs). - -```rust, ignore -let service = common::counter::Counter::new(); -``` -
- -
-启动服务端 - -```rust, ignore -// this call will finish the initialization process -let server = service.serve(transport).await?; -``` -
- -
-与服务端交互 - -Once the server is initialized, you can send requests or notifications: - -```rust, ignore -// request -let roots = server.list_roots().await?; - -// or send notification -server.notify_cancelled(...).await?; -``` -
- -
-等待服务停止 - -```rust, ignore -let quit_reason = server.waiting().await?; -// 或将其取消 -let quit_reason = server.cancel().await?; -``` -
- -### 示例 -查看 [examples](examples/README.md) - -## OAuth 支持 - -查看 [oauth_support](docs/OAUTH_SUPPORT.md) - -## 相关资源 - -- [MCP Specification](https://spec.modelcontextprotocol.io/specification/2024-11-05/) -- [Schema](https://github.com/modelcontextprotocol/specification/blob/main/schema/2024-11-05/schema.ts) - -## 相关项目 -- [containerd-mcp-server](https://github.com/jokemanfire/mcp-containerd) - 基于 containerd 实现的 MCP 服务 - -## 开发 - -### 贡献指南 - -查看 [docs/CONTRIBUTE.MD](docs/CONTRIBUTE.MD) - -### 使用 Dev Container - -如果你想使用 Dev Container,查看 [docs/DEVCONTAINER.md](docs/DEVCONTAINER.md) 获取开发指南。