feat: provide more context information#236
Merged
Merged
Conversation
1. provide context for notification 2. allow extract more info from tool call 3. inject http request part for streamable http server
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces additional context information in notification handling and tool call processing, while also updating the streamable HTTP server transport to inject HTTP request parts. Key changes include:
- Adding a NotificationContext parameter to various notification handling functions in both client and server code paths.
- Updating tool call context extraction logic with new FromToolCallContextPart implementations.
- Injecting the HTTP request part into the JSON RPC messages in the streamable HTTP server.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/rmcp/tests/test_notification.rs | Updated test notification handler to accept a new context param. |
| crates/rmcp/tests/common/handlers.rs | Updated logging message handler signature with new context. |
| crates/rmcp/src/transport/streamable_http_server/tower.rs | Injects HTTP request parts into JSON RPC messages. |
| crates/rmcp/src/service/tower.rs | Added NotificationContext parameter to the tower service handler. |
| crates/rmcp/src/service/server.rs | Builds and passes NotificationContext for handling notifications. |
| crates/rmcp/src/service.rs | Updated Service and DynService traits to include NotificationContext. |
| crates/rmcp/src/model/extension.rs | Changed new() to a const fn. |
| crates/rmcp/src/handler/server/tool.rs | Provided new FromToolCallContextPart implementations. |
| crates/rmcp/src/handler/server.rs | Updated ServerHandler trait functions to accept NotificationContext. |
| crates/rmcp/src/handler/client.rs | Updated ClientHandler trait functions to accept NotificationContext. |
Comments suppressed due to low confidence (1)
crates/rmcp/src/service/server.rs:213
- [nitpick] Consider adding documentation or inline comments explaining the purpose and expected usage of NotificationContext, to improve maintainability for future developers.
let context = NotificationContext { meta: notification.get_meta().clone(), extensions: notification.extensions().clone(), peer: peer.clone(), };
Member
|
I think it is a new feature ,can you provide some docs? |
dd9c3d3 to
cefeb83
Compare
Contributor
Author
|
@jokemanfire added some docs in |
jokemanfire
approved these changes
May 29, 2025
Merged
takumi-earth
pushed a commit
to earthlings-dev/rmcp
that referenced
this pull request
Jan 27, 2026
* feat: provide more context information 1. provide context for notification 2. allow extract more info from tool call 3. inject http request part for streamable http server * docs: add document for getting peer from context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
#235 ,#195 (comment)
How Has This Been Tested?
Breaking Changes
Add a notification context parameter for notification handlers.
Types of changes
Checklist
Additional context