feat: unified MCP layer (third primitive)#9
Merged
Merged
Conversation
… + secret-literal guard Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ml) adapters Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ision guard), skill-link resolution, catalog block Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… AGENTS.md/CLAUDE.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Needs human review Unable to check for correctness in edc89d1. This PR introduces a substantial new feature (unified MCP layer) with new CLI commands, shell command execution, secrets validation, and new file generation. The scope and nature of changes—particularly the new user-facing commands and security-sensitive secrets handling—warrant human review. You can customize Macroscope's approvability policy. Learn more. |
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.
What
Adds MCP as ai-context-kit's third generated primitive, alongside
contextandskills. Declare MCP servers once in.ai/mcp.json;ai-context buildfans them out to each agent client's native config — with optional skill + context backing.Brain design record: project
61c0f576(full design + linked architecture decision).Why
Today MCP config is per-client, per-machine, hand-edited (e.g.
~/.claude.json) — not repo-owned or agent-portable. This makes a server's config and the knowledge to use it a single declarative unit.How
.ai/mcp.jsonregistry (core/src/mcp.ts), validated with a secret-literal guard.core/src/mcp-adapters/) — v1 shipsclaude(.mcp.json) andcodex(.codex/config.toml, with a collision guard so it never clobbers a hand-written budget config).writeOutputspath, soverify/diff/staleness come for free..ai/skills/<name>;context: trueinjects an "Available MCP servers" catalog block into AGENTS.md/CLAUDE.md.projectservers are committed;userservers install per-machine viaai-context mcp install <name> --user.${VAR}references only;verifyfails on a credential literal in a generated file (AICTX_MCP_SECRET_LEAK).ai-context mcp list | install --user | setup.references/authoring-mcp.md+ README.Tests
8 commits, strict TDD. Full suite green: core 164, cli 23, templates 22 + typecheck + lint. Includes a dogfood integration test fanning posthog/grafana/rn-debugger across claude+codex.
Follow-ups (not in this PR)
cursor/vscode/geminiadapters (additive — registry is pluggable)..mcp.json(posthog/grafana/rn-debugger) into.ai/mcp.jsonafter a kit release.🤖 Generated with Claude Code
Note
Add unified MCP layer as a third primitive with CLI commands, adapters, and build integration
.ai/mcp.jsonfor declaring MCP servers with scope, transport, targets, and env; parsed and validated bymcp.tswith strict error codes for invalid configs or suspected secret literals.claude.ts,codex.ts) that render managed config files (.mcp.json,.codex/config.toml) from project-scope registry entries during build.[AICTX_MCP_SECRET_LEAK].AGENTS.mdandCLAUDE.mdwhen MCP is configured.mcp list,mcp install <name> --user [--dry-run], andmcp setup <name>CLI subcommands for inspecting and installing user-scope servers into the Claude client..codex/config.tomlfiles without the managed marker are preserved but MCP output redirects to.codex/mcp.toml, which may cause confusion if both files exist.Macroscope summarized edc89d1.