Merged
Conversation
Move pieceMcpServers normalization/denormalization to projectConfigTransforms.ts and consolidate policy save blocks into a data-driven loop to keep projectConfig.ts under 300 lines.
38db5a3 to
cc18dd3
Compare
- Explicit deny: project false overrides global true - Global config: load and save/reload round-trip - Env override: TAKT_PIECE_MCP_SERVERS JSON for global config - Env override: TAKT_PIECE_MCP_SERVERS_STDIO for global config - Env override: TAKT_PIECE_MCP_SERVERS_HTTP for project config
edc83d8 to
f705c81
Compare
Open
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
stdio,http, andsseWhy this draft exists
This is the stricter and more consistent version of the piece-level MCP policy.
A piece can attach MCP servers directly into the AI execution context. For
stdio, that means spawning a local process. Forhttpandsse, that means connecting to a local or remote endpoint that can still inject arbitrary tool definitions into the agent session.That makes all three transports part of the same untrusted-piece problem.
Why all transports default to false
httpandsseare not safe by default just because they do not spawn a local process.A malicious piece can point at an attacker-controlled remote endpoint and inject tools into the agent context, or it can target localhost services that the operator already has running. From the AI's perspective, the blast radius is still tool injection.
So this draft uses a consistent default:
stdio: falsehttp: falsesse: falseWhat this draft changes
Piece YAML MCP servers are rejected by default for every transport.
Operators can explicitly allow transports in trusted project/global config, for example:
or:
What can go wrong without this fix
Without this change, an untrusted piece can inject MCP-backed tools into the AI runtime, either by spawning local stdio servers or by connecting to local/remote endpoints. That can expand the model's effective tool surface and lead to unintended command execution, data access, or integration abuse.
Alternatives
http/sseenabled by default and only blockstdioTesting
npm run buildnpm test -- --run src/__tests__/models.test.ts src/__tests__/projectConfig.test.ts src/__tests__/it-piece-loader.test.tsTag