Skip to content

Conversation

@4t145
Copy link
Collaborator

@4t145 4t145 commented Apr 2, 2025

  1. Suppot revision 2025-03-26 data types
  2. Support meta, progress tokne, and extensions in request/notification,
  3. Remove Message, use JsonRpcMessage directly

Motivation and Context

Support revision 2025-03-26

How Has This Been Tested?

Breaking Changes

  1. Add new types and fields to satisfy the revision 2025-03-26
  2. Now PaginationParam is the previous PaginationParamInner

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@4t145 4t145 marked this pull request as ready for review April 2, 2025 19:38
@4t145 4t145 requested review from Copilot and jokemanfire April 2, 2025 19:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces support for the 2025-03-26 revision by updating message types, API signatures, and protocol version handling while removing the legacy Message type in favor of JsonRpcMessage. Key changes include:

  • Changing pagination parameters to be optional (Option) across various endpoints.
  • Adding support for meta fields, progress tokens, and extensions in request/notification structures.
  • Updating protocol version constants and ordering, adding new types (e.g. RawAudioContent) and tool annotations.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
examples/servers/src/common/counter.rs Updated pagination parameter type for resource lists.
crates/rmcp/src/transport/sse_server.rs Changed client message handling to use serde_json::Value with error handling.
crates/rmcp/src/service/server.rs Revised initialization logic with protocol version negotiation and message type updates.
crates/rmcp/src/service/client.rs Modified API calls to support optional pagination parameters and added default extensions.
crates/rmcp/src/service.rs Introduced a progress token provider and updated peer request handling.
crates/rmcp/src/model/tool.rs Added an optional annotations field to the Tool structure.
crates/rmcp/src/model/serde_impl.rs Updated serialization/deserialization to integrate meta and extension support.
crates/rmcp/src/model/meta.rs & extension.rs New modules for meta information and protocol extensions support.
crates/rmcp/src/model/content.rs Added RawAudioContent for new audio support.
crates/rmcp/src/model/capabilities.rs Extended ServerCapabilities to include completions and updated builder types.
crates/rmcp/src/model.rs Updated protocol version constants, revised pagination types, and replaced Message with JsonRpcMessage.
crates/rmcp/src/handler/server/tool.rs & server.rs Adjusted pagination parameter types in server handler functions.
crates/rmcp-macros/src/tool.rs Made minor improvements to variable naming in tool macro code.

@4t145
Copy link
Collaborator Author

4t145 commented Apr 2, 2025

I would like to fix the ci lint message when merge.

Copy link
Collaborator

@jokemanfire jokemanfire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The amount of modification is quite large. Please give me more time to take a look

@4t145
Copy link
Collaborator Author

4t145 commented Apr 3, 2025

In China we are going to take a vacation for Qingming Festival these days, so the reply may not be so timely.

1. Suppot revision 2025-03-26 data types
2. Support meta, progress tokne, and extensions in request/notification,
3. Remove `Message`, use `JsonRpcMessage` directly
@4t145 4t145 force-pushed the revision-2025-03-26-without-streamable-http branch from 0950ba1 to fb60fc4 Compare April 3, 2025 17:52
@4t145 4t145 requested review from jokemanfire and kalvinnchau April 3, 2025 17:54
@4t145
Copy link
Collaborator Author

4t145 commented Apr 5, 2025

@jokemanfire @kalvinnchau I think this pr is ready for merge, could you please review this again?

@jokemanfire jokemanfire added this to the Pre release milestones milestone Apr 6, 2025
@4t145 4t145 merged commit 6837546 into modelcontextprotocol:main Apr 7, 2025
7 checks passed
@4t145 4t145 mentioned this pull request Apr 7, 2025
Jeadie added a commit to spiceai/modelcontextprotocol-rust-sdk that referenced this pull request May 15, 2025
* Server wasm compatibility (modelcontextprotocol#15)

* add axum sse example

* fix: make the sse axum folder name correct

* feat: add common modules for Axum SSE example

This commit adds supporting modules for the Axum Server-Sent Events (SSE) example:
- Added `counter.rs` with a simple counter router implementation
- Added `jsonrpc_frame_codec.rs` for decoding JSON-RPC frames
- Created a `mod.rs` to expose these modules
- Removed the previous SSE example configuration from Cargo.toml

* refactor: remove main.rs and update Cargo.toml for WASM compatibility

This commit makes two key changes:
1. Removes the main.rs file and make it a example
2. Add a wasi_std_io example

* refactor: simplify WASI I/O handling in example and fmt

Merged AsyncInputStream and AsyncOutputStream into a single WasiFd struct with std_in() and std_out() methods, reducing code duplication and improving clarity of the WASI standard I/O example.

* move examples to root

* add missing license (modelcontextprotocol#35)

* pin transport once, use project in write_message (modelcontextprotocol#28)

* docs: add installation instructions for uv (modelcontextprotocol#37)

* fix: update transport command to use the correct example server (modelcontextprotocol#36)

* fix: update transport command to use the correct example server

* style: cargo fmt

* add an actix-web server sse example (modelcontextprotocol#33)

* add an actix-web server sse example

remove unused import

* fix to apply cargo fmt and cargo clippy to pass the the repo checks

* chore: decrease log level (modelcontextprotocol#41)

Co-authored-by: ziyang zhang <[email protected]>

* Move whole rmcp crate to offcial rust sdk (modelcontextprotocol#44)

* get rid of async-trait

* move rmcp to official-rust-sdk

* replace master with main

* update readme, change license

* fix typo

* Update README.md

Co-authored-by: Jefry Dewangga <[email protected]>

* fix typos

---------

Co-authored-by: = <=>
Co-authored-by: Jefry Dewangga <[email protected]>

* doc: fix a typo in Cargo.toml (modelcontextprotocol#45)

* docs: fix the branch name for git dependency (modelcontextprotocol#46)

* docs: update the chinese doc (modelcontextprotocol#48)

the chinese doc also should be update

Signed-off-by: jokemanfire <[email protected]>

* docs: fix broken link (modelcontextprotocol#53)

* ci: add commit-lint in CI (modelcontextprotocol#50)

no need too many workflows's yaml file, for ci we just need one.

Signed-off-by: jokemanfire <[email protected]>

* refactor(sse_server): separate router and server startup (modelcontextprotocol#52)

* feat: expose axum router

* feat: add axum_router example with SSE server implementation

* refactor: simplify SseServer configuration handling in server setup

* docs: add warning to SseServer::new about potential post_path issues with embedded routers

* style: fmt the project (modelcontextprotocol#54)

add rustfmt.toml

Signed-off-by: jokemanfire <[email protected]>

* [Example] Small fix on incorrect counter logic and improve prompt handling (modelcontextprotocol#63)

The counter decrement in `get_value` was removed to prevent unintended changes to the counter state. Additionally, `get_prompt` was updated to parse and validate the `message` argument properly, ensuring better error handling and formatting.

Co-authored-by: sandrohanea <[email protected]>

* fix(server): add error enum while deal server info (modelcontextprotocol#51)

1. wrap the error type for more standardized
2. add more information in error for debug trace
3. wrap helper func for more user-friendly code

Signed-off-by: jokemanfire <[email protected]>

* ci: use `rust-cache` (modelcontextprotocol#60)

Replace actions/cache with rust-cache.

* chore: format code correctly (modelcontextprotocol#66)

* test: add test with js server (modelcontextprotocol#65)

* fix(test): fix tool deserialization error (modelcontextprotocol#68)

* ci: add documentation generation job (modelcontextprotocol#59)

* ci: add documentation generation job

1. add doc ci in workflow
2. remove the readme in rmcp crate

Signed-off-by: jokemanfire <[email protected]>

* docs: fix doc test in README.md

1) fix doc test in readme
2) fix some fmt

Signed-off-by: jokemanfire <[email protected]>

---------

Signed-off-by: jokemanfire <[email protected]>

* fix(notification): fix wrongly error report in notification (modelcontextprotocol#70)

* docs: format and fix typo (modelcontextprotocol#72)

* feat(transport): Sse client transport trait (modelcontextprotocol#67)

* feat: created transport trait and impl

* feat(transport): abstract sse transport from the client definition

* test: add test with js server (modelcontextprotocol#65)

* fix: use prefix to check mime type

* fix(test): fix tool deserialization error (modelcontextprotocol#68)

* ci: add documentation generation job (modelcontextprotocol#59)

* ci: add documentation generation job

1. add doc ci in workflow
2. remove the readme in rmcp crate

Signed-off-by: jokemanfire <[email protected]>

* docs: fix doc test in README.md

1) fix doc test in readme
2) fix some fmt

Signed-off-by: jokemanfire <[email protected]>

---------

Signed-off-by: jokemanfire <[email protected]>

* fix(notification): fix wrongly error report in notification (modelcontextprotocol#70)

* chore: fix lint errors by creating a type alias

* chore: resolve conflict

* chore: fix fmt

* chore: revert

---------

Signed-off-by: jokemanfire <[email protected]>
Co-authored-by: Jefry Dewangga <[email protected]>
Co-authored-by: 4t145 <[email protected]>
Co-authored-by: jokemanfire <[email protected]>

* feat: Sse server auto ping (modelcontextprotocol#74)

1. auto ping in sse stream every second to make cursor happy
2. configurable sse keep alive

---------

Co-authored-by: = <=>

* feat(tool): allow tool call return a serializable value in json format (modelcontextprotocol#75) (modelcontextprotocol#78)

* fix(client): add error enum while deal client info (modelcontextprotocol#76)

1. wrap the error type for more standardized
2. add more information in error for debug trace
3. wrap helper func for more user-friendly code

Signed-off-by: jokemanfire <[email protected]>

* chore: fix typos (modelcontextprotocol#79)

* Adopt Devcontainer for Development Environment (modelcontextprotocol#81)

* chore: add devcontainer setting
* docs: add Dev Container setup instructions to README and create DEVCONTAINER.md

* ci: add spell check (modelcontextprotocol#82)

for code greater use spell check

Signed-off-by: jokemanfire <[email protected]>

* fix(typo): s/marcos/macros/ (modelcontextprotocol#85)

* fix: fix rig chat agent output format (modelcontextprotocol#86)

* fix(typo): nit language corrections (modelcontextprotocol#90)

* Add Claude desktop quick start and update Cargo.toml of examples/servers, examples/clients (modelcontextprotocol#94)

* feat(readme): add Claude Desktop quick start guide

* fix(readme): correct typo in Claude Desktop instructions

* test(logging): Add tests for logging  (modelcontextprotocol#96)

* test(logging): implement basic logging functionality

* test(logging): add comprehensive server transport tests

* chore: fix broken wasi example link (modelcontextprotocol#100)

fix doc's link in example

* feat: revision-2025-03-26 without streamable http (modelcontextprotocol#84)

1. Suppot revision 2025-03-26 data types
2. Support meta, progress tokne, and extensions in request/notification,
3. Remove `Message`, use `JsonRpcMessage` directly

* fix(macro): add generics marco types support (modelcontextprotocol#98)

add generic marco support

Signed-off-by: jokemanfire <[email protected]>

* test(context): test context request handling and refactor for reusable client-server tests (modelcontextprotocol#97)

* fix(rig-integration): implement ToolEmbeddingDyn trait for McpToolAdaptor (modelcontextprotocol#99)

- Added ToolEmbeddingDyn trait for McpToolAdaptor to enable dynamic loading of McpTool
- Enhanced logging to record details

Co-authored-by: byeblack <[email protected]>

* fix(test): fix test introduced by modelcontextprotocol#97 (modelcontextprotocol#101)

* fix(server): schemars compilation errors (modelcontextprotocol#104)

* feat: extensions to context (modelcontextprotocol#102)

* docs: give macOS link and clarify missing UI (modelcontextprotocol#110)

fix doc in examples/README.md.

* ci: add code coverage job to CI workflow (modelcontextprotocol#111)

add code coverage job

* fix(macros): add error deal (modelcontextprotocol#109)

1.Check whether the parameters include aggregated parameters and individual parameters
2.Check if the toolbox attribute is default

Signed-off-by: jokemanfire <[email protected]>

* Fix typo for Claude desktop config file path correction and add more example for Windows, Linux, and MacOS (modelcontextprotocol#107)

* fix(typo): claude desktop config file path correction

* fix: fix 2 cargo warnings (modelcontextprotocol#112)

* fix: fix 3 cargo warnings

* revert `version = "1.0"` removal

* ci: harden release action (modelcontextprotocol#113)

* docs: add an overview to `rmcp/src/lib.rs` (modelcontextprotocol#116)

* fix(handler): do call handler methods when initialize server (modelcontextprotocol#118)

* docs: add a simple chat client for example (modelcontextprotocol#119)

1. optimize the readme in root
2. add example

Signed-off-by: jokemanfire <[email protected]>

* docs: fix the url (modelcontextprotocol#120)

Signed-off-by: jokemanfire <[email protected]>

* docs: update calculator example description (modelcontextprotocol#115)

The example in the README uses "sum" for both `sum` and `sub`. I changed it to "difference". For consistency, I also updated the example code to use the same term.

* docs: fix typo and clarify instructions (modelcontextprotocol#124)

* chore: remove un-used tower.rs (modelcontextprotocol#125)

Signed-off-by: nora-coder-dot <[email protected]>
Co-authored-by: nora-coder-dot <[email protected]>

* docs: fix doc in simple-chat (modelcontextprotocol#129)

* ci: security (modelcontextprotocol#133)

* ci: add security audit job to workflow

* feat(rmcp-macro): generate description from docs (modelcontextprotocol#141)

* feat: generate description from docs

* fix logic to extract doc

* fmt

* chore: undo unnecessary changes in `Cargo.toml`

* chore: undo unnecessary changes in `Cargo.toml`

* chore: remove unnecessary code in tests

* create `extract_doc_line`

* fmt

* make sure the string is not empty

* avoid multilayer nesting

* fmt

* chore: make proxy in simple-chat configure (modelcontextprotocol#134)

and remove some prints and some useless codes

Signed-off-by: jokemanfire <[email protected]>

* fix(rmcp-macros): fix extract_doc_line code (modelcontextprotocol#142)

Signed-off-by: jokemanfire <[email protected]>

* chore: disable unix_socket example on windows (modelcontextprotocol#146)

* chore: make cli command in simple-chat (modelcontextprotocol#145)

add config,chat,help command

* fix: fix resource leak (modelcontextprotocol#136)

When a running service is dropped, its connections should be closed and its resources should be
cleaned up.

This changes the default from leaving services running to closing them. Library users who want
their services to remain running should call `waiting` on their running service, in a new task
where necessary.

Co-authored-by: Paul Ellenbogen <[email protected]>

* chore: add oauth2 support (modelcontextprotocol#130)

1.add oauth2 server and client example
2.add oauth2 impl in sse
3.add auth doc 
Signed-off-by: jokemanfire <[email protected]>

* fix(test): skip serialize tool's annotation if empty (modelcontextprotocol#160)

* fix(test): skip serialize tool's annotation if empty

1. skip serialize tool's annotation if empty
2. close js server and client when close

* fix(test): fix test with js, don't close too early

* feat: allow use of reqwest without ring provider (modelcontextprotocol#155)

Signed-off-by: Mauro Sardara <[email protected]>

* feat(oauth): fixes + cache client credentials (modelcontextprotocol#157)

credentials optimize

* feat: add clippy config (modelcontextprotocol#162)

Signed-off-by: jokemanfire <[email protected]>

* feat(transport): support streamable http server (modelcontextprotocol#152)

* feat(transport): support streamable http server

* refactor(transport): add common module for shared transport utilities

* perf(tracing): add more log for streamable http session

* fix(test): fix port conflict in test with js

* fix(transport): fix id generating and session management

1. cancel when deleting
2. use `wrapping` and `saturating` correctly

* chore(naming): rename sse server to streamable http server

* fix: build errors for WASI target (modelcontextprotocol#151)

---------

Signed-off-by: jokemanfire <[email protected]>
Signed-off-by: nora-coder-dot <[email protected]>
Signed-off-by: Mauro Sardara <[email protected]>
Co-authored-by: 4t145 <[email protected]>
Co-authored-by: niebayes <[email protected]>
Co-authored-by: Marc-Andre Giroux <[email protected]>
Co-authored-by: situ2001 <[email protected]>
Co-authored-by: xring <[email protected]>
Co-authored-by: Ma1oneZhang <[email protected]>
Co-authored-by: ziyang zhang <[email protected]>
Co-authored-by: Jefry Dewangga <[email protected]>
Co-authored-by: Ramnivas Laddad <[email protected]>
Co-authored-by: jokemanfire <[email protected]>
Co-authored-by: Takayuki Maeda <[email protected]>
Co-authored-by: Wang Ruobiao <[email protected]>
Co-authored-by: Sandro Hanea <[email protected]>
Co-authored-by: sandrohanea <[email protected]>
Co-authored-by: Todsaporn Banjerdkit <[email protected]>
Co-authored-by: Eitan Yarmush <[email protected]>
Co-authored-by: Bob Liu <[email protected]>
Co-authored-by: z9rtm <[email protected]>
Co-authored-by: Alex Kesling <[email protected]>
Co-authored-by: Jonathan Hendler <[email protected]>
Co-authored-by: Ruangyot Nanchiang <[email protected]>
Co-authored-by: A₿del ∞/21M <[email protected]>
Co-authored-by: byeblack <[email protected]>
Co-authored-by: byeblack <[email protected]>
Co-authored-by: Sandipsinh Dilipsinh Rathod <[email protected]>
Co-authored-by: Rik Huijzer <[email protected]>
Co-authored-by: Rik Huijzer <[email protected]>
Co-authored-by: Luke Francl <[email protected]>
Co-authored-by: Ofer Affias <[email protected]>
Co-authored-by: Nora <[email protected]>
Co-authored-by: nora-coder-dot <[email protected]>
Co-authored-by: Eucalypt <[email protected]>
Co-authored-by: Paul Ellenbogen <[email protected]>
Co-authored-by: Paul Ellenbogen <[email protected]>
Co-authored-by: Mauro Sardara <[email protected]>
Co-authored-by: Andrew Culberson <[email protected]>
Co-authored-by: Dennis Kawurek <[email protected]>
@github-actions github-actions bot mentioned this pull request Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants