Opening season - #1178
Open
jrin0340-420 wants to merge 333 commits into
Open
Conversation
Updated the build command to specify the package for the MCP server examples.
…modelcontextprotocol#727) The `#[task_handler]` macro generates code using deprecated type aliases (`PaginatedRequestParam`, `CallToolRequestParam`, `GetTaskInfoParam`, `GetTaskResultParam`, `CancelTaskParam`) that were renamed to `*Params` in rmcp 0.13.0. This causes 5 deprecation warnings for every crate using the macro. Update all references to use the canonical `*Params` names: - `PaginatedRequestParam` → `PaginatedRequestParams` - `CallToolRequestParam` → `CallToolRequestParams` - `GetTaskInfoParam` → `GetTaskInfoParams` - `GetTaskResultParam` → `GetTaskResultParams` - `CancelTaskParam` → `CancelTaskParams` Also fix the corresponding doc examples in `lib.rs`. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…modelcontextprotocol#730) * fix: accept logging/setLevel and ping before initialized notification * test: add server initialization tests for pre-init requests
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…delcontextprotocol#735) * fix(rmcp-macros): use re-exported serde_json path in task_handler Replace bare `::serde_json::` with `::rmcp::serde_json::` in task_handler.rs to prevent compilation errors in crates that don't directly depend on serde_json. Fixes modelcontextprotocol#487 * Update crates/rmcp-macros/src/task_handler.rs --------- Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
…textprotocol#731) * fix: include granted scopes in OAuth refresh token request * docs: document scope forwarding in token refresh flow
…xtprotocol#737) Updates the requirements on [jsonwebtoken](https://github.com/Keats/jsonwebtoken) to permit the latest version. - [Changelog](https://github.com/Keats/jsonwebtoken/blob/master/CHANGELOG.md) - [Commits](Keats/jsonwebtoken@v9.0.0...v10.3.0) --- updated-dependencies: - dependency-name: jsonwebtoken dependency-version: 10.3.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…contextprotocol#738) Updates the requirements on [rig-core](https://github.com/0xPlaygrounds/rig) to permit the latest version. - [Release notes](https://github.com/0xPlaygrounds/rig/releases) - [Changelog](https://github.com/0xPlaygrounds/rig/blob/main/release-plz.toml) - [Commits](0xPlaygrounds/rig@rig-core-v0.31.0...rig-core-v0.32.0) --- updated-dependencies: - dependency-name: rig-core dependency-version: 0.32.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ontextprotocol#739) * feat: add constructors for Root and ListRootsResult * feat: add constructors for UnsubscribeRequestParams and PromptReference
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…rotocol#740) * feat: add local feature for !Send tool handler support * fix: gate streamable HTTP transport on not(local) feature
…toredAuthorizationState (modelcontextprotocol#744) * fix(auth): redact secrets in Debug output for StoredCredentials and StoredAuthorizationState Removes `Debug` from the derive macros on `StoredCredentials` and `StoredAuthorizationState` and replaces them with manual `Debug` impls that print `[REDACTED]` for sensitive fields (access/refresh tokens, PKCE verifiers, and CSRF tokens), preventing accidental credential leakage via `{:?}` formatters, log calls, and error chains. Fixes modelcontextprotocol#741 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(auth): assert Debug output redacts secrets for credential types Adds regression tests for the fix in the previous commit, verifying that `{:?}` formatting of `StoredAuthorizationState` and `StoredCredentials` does not emit plaintext secrets. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(auth): address review feedback on debug redaction tests - Remove redundant VendorExtraTokenFields from use super:: in test_stored_credentials_debug_redacts_token_response (already imported at module scope) - Add assert!(debug_output.contains("created_at")) to test_stored_authorization_state_debug_redacts_secrets to verify non-secret fields remain visible in Debug output - Run cargo fmt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Update crates/rmcp/src/transport/auth.rs Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> * fix: remaining formatting issue * fix: formatting * fix: formatting * fix: please --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
…contextprotocol#748) * fix(rmcp): surface JSON-RPC error bodies on HTTP 4xx responses When a server returns a 4xx status with Content-Type: application/json, attempt to deserialize the body as a ServerJsonRpcMessage before falling back to UnexpectedServerResponse. This allows JSON-RPC error payloads carried on HTTP error responses to be surfaced as McpError instead of being lost in a transport-level error string. Fixes modelcontextprotocol#724 * fix(rmcp): surface JSON-RPC error bodies on HTTP 4xx responses When a server returns a 4xx status with Content-Type: application/json, attempt to deserialize the body as a ServerJsonRpcMessage before falling back to UnexpectedServerResponse. This allows JSON-RPC error payloads carried on HTTP error responses to be surfaced as McpError instead of being lost in a transport-level error string. Fixes modelcontextprotocol#724 * fix(rmcp): only accept JsonRpcMessage::Error on non-success responses
…protocol#760) * feat: add configuration for transparent session re-init * fix: in ci revert running tests without local until all tests pass * fix: pr comments * fix: documentation
The rig official has the mcp example, we need not to keep it just give the link. Signed-off-by: jokemanfire <hu.dingyang@zte.com.cn>
…ustomResult in untagged enums (modelcontextprotocol#771) The `#[serde(default)]` on `CallToolResult.content` (added in modelcontextprotocol#752) made all fields optional, causing `CallToolResult` to greedily match any JSON object during `#[serde(untagged)]` deserialization of `ServerResult`. Similarly, `GetTaskPayloadResult(Value)` matched everything before `CustomResult(Value)` could be reached. Fix by replacing derived `Deserialize` impls with custom ones: - `CallToolResult`: require at least one known field to be present - `GetTaskPayloadResult`: always fail (indistinguishable from `CustomResult` in JSON; construct programmatically via `::new()`)
….0 (modelcontextprotocol#773) Updates the requirements on [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) to permit the latest version. - [Changelog](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md) - [Commits](snapview/tokio-tungstenite@v0.28.0...v0.29.0) --- updated-dependencies: - dependency-name: tokio-tungstenite dependency-version: 0.29.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…odelcontextprotocol#676) * feat: implement sep-2207 refresh token guidance * fix: update client-metadata.json to allow refresh tokens
…odelcontextprotocol#749) * feat(transport): add Unix domain socket client for streamable HTTP MCP hosts in Kubernetes environments with Envoy sidecars need to route HTTP through Unix domain sockets because DNS-based URIs only resolve via the proxy. Adds UnixSocketHttpClient implementing StreamableHttpClient using hyper over tokio::net::UnixStream, gated behind the transport-streamable-http-client-unix-socket feature. Also extracts RESERVED_HEADERS, extract_scope_from_header, and validate_custom_header into common/http_header.rs to share header validation logic between the reqwest and unix socket implementations. * fix(transport): address review feedback for unix socket transport - Document one-connection-per-request behavior on UnixSocketHttpClient - Reject empty socket paths and bare '@' in constructor with assert - Add explicit dep:http to unix-socket feature for self-documenting deps - Document MCP-Protocol-Version exception on RESERVED_HEADERS constant - Fix test catch-all to echo request id instead of hardcoding 1 - Remove leftover sleep(100ms) in test_unix_socket_custom_headers - Add blank line before macro comment in Cargo.toml * fix(transport): fix CI failures for unix socket transport - Use std::io::Error::other() instead of Error::new(ErrorKind::Other) to satisfy clippy::io_other_error on newer nightly - Use #[tokio::test(flavor = "current_thread")] for unix socket tests since axum's serve(UnixListener) requires spawn_local - Gate validate_custom_header behind client-side-sse feature since it references http::HeaderName which isn't available with default features * fix(transport): fix CI failures for unix socket transport axum::serve(UnixListener) uses spawn_local on Linux, which panics outside a LocalSet. Replace with manual hyper HTTP/1.1 server that accepts connections directly from the UnixListener, avoiding the spawn_local requirement entirely. * fix(transport): skip unix socket tests when local feature is enabled The local feature causes ().serve(transport) to use spawn_local, which requires a LocalSet. Gate the integration tests with not(feature = "local") to match every other integration test in the repo.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…contextprotocol#1139) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.85.6 to 2.85.7. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](taiki-e/install-action@v2.85.6...v2.85.7) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.85.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ntextprotocol#1146) `SseAutoReconnectStream::poll_next` recursed into itself for every event it skips — control frames, data-less frames, and frames whose data fails to deserialize — plus once more on every state transition. The inner stream returns `Poll::Ready` for each event it can parse out of already-buffered bytes, so a burst of skipped events has no yield point between them. Each one adds a stack frame, and `poll_next` is a large frame. A client connected to a server that emits a run of non-JSON `message` frames overflows the stack and aborts the process. Wrap the body in a `loop` and replace the four `self.poll_next(cx)` tail calls with `continue`. `this` is re-derived from `self.as_mut().project()` at the top of each iteration, so the borrows end cleanly per iteration; no other logic changes. The diff is mostly the resulting re-indent — review with `?w=1`. Adds `skipped_events_do_not_grow_the_stack`, which feeds 50,000 undeserializable frames through the stream. Before this change it aborts with `fatal runtime error: stack overflow` (SIGABRT); after, it passes.
…ntextprotocol#1154) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.37.4 to 4.37.6. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v4.37.4...v4.37.6) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: 4.37.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…contextprotocol#1153) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.85.7 to 2.85.8. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](taiki-e/install-action@v2.85.7...v2.85.8) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.85.8 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…protocol#1152) `post_message_with_max_sse_event_size` turns a 401 or 403 carrying a `WWW-Authenticate` header into `StreamableHttpError::AuthRequired` / `InsufficientScope`. `get_stream_with_max_sse_event_size`, in the same file, handles only 405 and then falls through to `error_for_status()?`, so the same challenge becomes an opaque `StreamableHttpError::Client`. That matters because `AuthClient::get_stream` routes through `call_reacting_to_challenges`, whose whole purpose is to catch `AuthRequired`, run `try_refresh_or_reauth()`, and retry once. It never sees that variant from this path, so an expired token on the standalone SSE stream is never refreshed — the stream just fails, while the identical expiry on `post_message` recovers silently. Copies the two blocks verbatim from `post_message` in the same file. `unix_socket.rs` already does the same thing in its own `get_stream`. Adds four tests against an axum mock server: a 401 with a challenge maps to `AuthRequired`, a 403 maps to `InsufficientScope` with the scope extracted, a 401 *without* a challenge is still not `AuthRequired`, and 405 keeps reporting `ServerDoesNotSupportSse`. The first two fail before this change with `Err(Client(reqwest::Error { kind: Status(401, None) }))`; the last two pass either way and exist to catch an over-broad fix.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…pe (modelcontextprotocol#1133) `ClientLifecycleMode::Auto` only fell back from `server/discover` on `-32601`, so legacy servers that reject the probe with other codes (`-32600`, `-32602`, implementation-defined errors) failed to connect even though `initialize` would have succeeded. The previous attempt (indicates_legacy_server) classified the failure after the fact by reverse-engineering the error type. This rewrite moves the classification into `discover_startup` itself, where the full context (request id, response correlation, transport state) is still available. `discover_startup` now returns `DiscoverOutcome`: `Modern` on success, `Legacy(error)` when the probe received a complete, correlated JSON-RPC error whose code is not a modern-era rejection. Every other failure becomes `Err`, so `Auto` simply matches the outcome — no methods on `ClientInitializeError`, no downcast, no transport-specific types leaking into the generic lifecycle layer. Additional fixes that fall out naturally: - Response correlation is now checked in `expect_response` for both success and error branches. Previously error responses skipped id correlation entirely. A new `UncorrelatedErrorResponse` variant surfaces responses that cannot be tied to the request. - When both discover and the legacy fallback fail, a `LegacyFallbackFailed` compound error preserves both phases instead of discarding the discover error. Fixes modelcontextprotocol#1040.
…lcontextprotocol#1163) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.85.8 to 2.85.10. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](taiki-e/install-action@v2.85.8...v2.85.10) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.85.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…tprotocol#1150) Co-authored-by: nightcityblade <nightcityblade@gmail.com>
…elcontextprotocol#1169) Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.85.10 to 2.85.11. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](taiki-e/install-action@v2.85.10...v2.85.11) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-version: 2.85.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context