feat(core): enforce project MCP trust boundaries - #1263
Open
sethkarten wants to merge 7 commits into
Open
Conversation
This was referenced Aug 12, 2026
sethkarten
marked this pull request as ready for review
August 12, 2026 06:00
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f756913. Configure here.
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.

Core-05: project MCP declarations and trust boundaries
Draft publication for stack visibility. Validation is in progress and will be appended to this PR.
Scope
Hard exclusions
Parent: Core-04 #1262 at
4e9c1f2cbfe072d5226f0e49d37e799b6cdce345Head:
6e8e33c484a26498d41022accd5f118ebe7822fcPost-publication objective gates are in progress; valid findings will be fixed append-only.
Note
Enforce project MCP trust boundaries with admission-gated declaration snapshots
mcp-project-trust.ts,project-trust-authority.ts) that gates project MCP declaration access behind validated, releasable directory-identity bindings; access is fail-closed without explicit admission.mcp-declarations.ts) with strict parsing, name/URL normalization, redaction utilities, and credential-freeMcpDeclarationDocumenttype stored in settings.McpRuntimeDeclarationSnapshotcombining user and (non-colliding) project declarations, used byMcpManagerinstead of raw settings.mcpCLI subcommands (list/inspect/preview/test/add/enable/disable/remove) with project-scope access enforced via global policy admission inpublic-command.ts.ProjectSettingsOpenatwhich reads/writes project declaration documents through a sandboxed Python helper operating on a retained directory fd, preventing path-based attacks.McpManagernow sources global MCP servers only (getGlobalMcpServers); project declarations are silently omitted if admission is absent, which is a behavioral change for existing sessions that previously merged project settings.Macroscope summarized eb1a438.
Final validation
1f23778f9a94673de05eff5eecdab15045363c01tsgo --noEmit: passgit diff --check: pass; worktree cleanmcp testis preview-only and cannot calltransport.open, eliminating late-open session leakage at this layer.Note
High Risk
Touches security-critical path/trust admission and changes which MCP servers the host loads: project
mcpServersno longer redirect integrations unless an explicit admission is granted. Includes retained-FD and helper-process I/O that must stay fail-closed.Overview
Introduces credential-free MCP declarations and a fail-closed project trust boundary. Project MCP settings are readable/writable only after an opaque
ProjectMcpDeclarationAdmissiongrant from globalmcpProjectTrustPolicy; forged, stale, or swapped roots stay inert.Adds declaration parsing/redaction, an immutable runtime snapshot (user first; colliding project contributions discarded), and descriptor-relative project storage via
ProjectSettingsOpenat. Session/SDK composition captures that snapshot before ordinary project settings load, and leaves caller-suppliedMcpManagerinstances untouched.Adds the public
mcpCLI (list|inspect|preview|test|add|enable|disable|remove, optional--project) for declaration-only management. Host integrations now use global-onlygetGlobalMcpServers(); declarations never become OAuth/transport config.mcp testremains offline preview-only.Reviewed by Cursor Bugbot for commit eb1a438. Bugbot is set up for automated code reviews on this repo. Configure here.