feat(mcp): upgrade rmcp 1.2→1.3, add per-server trust level and tool allowlist#2213
Merged
feat(mcp): upgrade rmcp 1.2→1.3, add per-server trust level and tool allowlist#2213
Conversation
…allowlist Closes #2188. Partially closes #2178. - Bump rmcp dependency to 1.3.0; fix oauth.rs tests broken by AuthorizationMetadata becoming #[non_exhaustive] in rmcp 1.3 - Add McpTrustLevel enum (Trusted/Untrusted/Sandboxed) to McpServerConfig; remove trusted: bool from ServerEntry (pre-v1.0 breaking change) - Add tool_allowlist: Vec<String> to McpServerConfig; empty allowlist on Untrusted server logs a warning visible in TUI/CLI/Telegram via status_tx - Centralize tool ingestion in ingest_tools() enforcing sanitize-before-filter invariant across all three ingestion sites - Add migrate_mcp_trust_levels() migration step (--migrate-config step 3) preserving existing server entries without data loss - Update --init wizard with trust level prompt for remote MCP servers - Add 9 unit tests for ingest_tools() and 5 tests for migration function
f4d0532 to
d372bea
Compare
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.
Summary
AuthorizationMetadatabecoming#[non_exhaustive]in rmcp 1.3McpTrustLevelenum (Trusted/Untrusted/Sandboxed) andtool_allowlist: Vec<String>toMcpServerConfig, replacing the internaltrusted: boolfield onServerEntryingest_tools()enforcing sanitize-before-filter invariant at all ingestion sitesstatus_tx--migrate-configstep 3 (migrate_mcp_trust_levels) for existing configs--initwizard with trust level promptingest_tools, 5 for migration)Breaking changes
ServerEntry.trusted: boolremoved; replaced bytrust_level: McpTrustLevel. Configs withouttrust_levelare handled by the migration step.Test plan
cargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins— 6610 passedcargo clippy --workspace --features full -- -D warnings— 0 new warnings (pre-existing warnings in sanitize.rs/client.rs unrelated to this PR)cargo +nightly fmt --check— cleanCloses #2188
Partially closes #2178