[codex] Add MCP integration#134
Merged
Merged
Conversation
04ec57f to
55650d7
Compare
55650d7 to
e7dbd91
Compare
e7dbd91 to
4831eb3
Compare
4831eb3 to
3f0f806
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
This PR adds full Model Context Protocol (MCP) integration to
iac-codeacross the interactive CLI, headless mode, ACP, A2A, and pipeline flows.The implementation introduces a new
iac_code.mcppackage that can load MCP server configuration, connect to local and remote MCP servers, expose MCP tools/resources/prompts/skills to the agent runtime, handle OAuth authentication, persist MCP auth state, and surface connection/configuration warnings without blocking otherwise usable servers.What Changed
MCP runtime and configuration
.mcp.jsonservers must be trusted before use.Transports, tools, resources, prompts, and skills
mcp__server__toolnames.list_mcp_resources,read_mcp_resource, and MCP auth helper tools.skill://...resources and$mcp__server__skillcommands.OAuth and security
headersHelperexecution and plaintextoauth.clientSecretusage.Runtime integrations
AgentFactoryso tools/resources/prompts/skills are available to normal chat and pipeline runs.main.CLI and docs
iac-code mcpcommands for adding/removing/listing servers, approving/rejecting project servers, authenticating, and resetting auth state.zh-Hans,ja,fr,de,es, andpt.Internationalization
_()without using f-strings inside translation calls.make translateand filled real translations for MCP strings in all supported locales.Why
iac-codepreviously had no MCP support, which prevented users from connecting external tool/resource/prompt providers in the same way they can in MCP-capable coding assistants. This PR adds that capability while preserving existing execution surfaces and safety requirements:Compatibility Notes
I rebased this branch onto the latest
origin/mainbefore opening the PR.During rebase there was one code conflict in
src/iac_code/a2a/events.py; the resolution keeps both sides:main's A2A metadata echo redaction import and behavior,A follow-up compatibility review compared
origin/main..HEADagainst the code added onmainwhile this feature was in development. The review found one issue: ACP MCP progress messages were not sanitized before being sent to ACP clients. That has been fixed by applyingsanitize_public_text()in_format_mcp_progress_text(), with a regression test covering API-key and local-path redaction.No remaining required MCP/main compatibility issues were found in the review.
Validation
Ran after rebasing onto
origin/main:make translate make lint uv run pytest tests/mcp tests/cli/test_mcp_command.py tests/cli/test_headless.py tests/acp/test_convert.py tests/acp/test_mcp.py tests/acp/test_protocol_lifecycle.py tests/acp/test_scenarios.py tests/acp/test_server_coverage.py tests/a2a/test_events.py tests/a2a/test_executor.py tests/a2a/test_pipeline_events.py tests/a2a/test_pipeline_executor.py tests/a2a/test_task_store.py tests/ui/test_stream_accumulator.py tests/ui/test_repl_integration.py -q npm run typecheck npm test npm run build git diff --checkResults:
make translate: passedmake lint: passed711 passed, 3 warningsstreamable_http_clientnpm run typecheck: passednpm test: passed (6 passed)npm run build: passed for all configured locales (en,zh-Hans,ja,fr,de,es,pt)git diff --check: passedReview Notes
This is intentionally opened as a draft because the diff is large and touches multiple runtime surfaces. The most important areas to review carefully are: