feat(agent): forward configured MCP servers#903
Conversation
OpenAB PR ScreeningThis is auto-generated by the OpenAB project-screening flow for context collection and reviewer handoff.
Screening reportdone. posted screening comment and moved the project item to `PR-Screening`.GitHub comment: #903 (comment) IntentForward configured MCP servers from OpenAB config into ACP sessions so deployers can make agent tools available without runtime-only host wiring. The operator-visible problem is missing or inconsistent MCP delivery to agent execution. FeatFeature. Adds Who It ServesDeployers and agent runtime operators first. Maintainers benefit from typed config, documented examples, and chart tests around a new integration surface. Rewritten PromptAdd typed MCP server configuration for agents. Parse stdio, HTTP, and SSE MCP definitions; render them from Helm values into Merge PitchThis fills a real MCP integration gap and keeps the behavior at the ACP boundary. Risk is moderate because it touches config, payload construction, Helm, and logging. Reviewers will likely focus on complete secret redaction and whether Best-Practice ComparisonOpenClaw partially applies: this improves explicit delivery routing by carrying MCP config through the gateway/runtime payload. Durable job persistence, retries, isolated executions, and run logs are outside this PR. Hermes Agent partially applies: session requests become more self-contained, which matches the scheduled-prompt principle. Daemon ticks, file locking, atomic state, and fresh scheduled sessions do not directly apply here. Implementation Options
Comparison Table
RecommendationTake the balanced path. Have Masami or Pahud verify redaction and |
CHC-Agent
left a comment
There was a problem hiding this comment.
Review: PR #903 — feat(agent): forward configured MCP servers
LGTM with minor fix 🟡 — Format matches ACP spec; stdio verified working with codex-acp. HTTP/SSE blocked by agent-side deserialization bugs (not an OpenAB issue).
What This PR Does
Adds [agent.mcp_servers] config to OpenAB, converts stdio/http/sse MCP server definitions into ACP mcpServers array, forwards them in both session/new and session/load, and redacts secret env/header values from debug logs.
How It Works
Config is parsed from TOML into AgentMcpServerConfig structs, converted to ACP JSON-RPC format (array of server objects with name, command/url, env/headers as name-value arrays per ACP spec), and included in session setup requests. Log redaction operates on a parsed clone of the outbound JSON so the actual payload is unaffected.
E2E Verification
Deployed PR#903 to OrbStack k8s with a mock MCP server pod (HTTP + SSE endpoints) and a mock stdio script, tested against two ACP agents:
| Agent | stdio | http |
|---|---|---|
| codex-acp 0.14.0 | ✅ session created, agent responded | ❌ deserialization error |
| kiro-cli 2.4.0 | ❌ connection closed | ❌ connection closed |
Details:
- codex-acp accepts the PR's stdio format (including
nameandenvfields) and operates normally. HTTP fails with:JSON-RPC error -32602: Invalid params {"error": "data did not match any variant of untagged enum McpServer", "phase": "deserialization"} - kiro-cli rejects any
mcpServersentry containing fields beyondcommand+args. Minimal format[{"command":"x","args":[]}]works, but addingnameorenv:[]causes the process to crash without returning a JSON-RPC error. Root cause from kiro-cli internal log (/tmp/kiro-log/kiro-chat.log):OpenAB only seesConnection error: Parse error: { "error": "data did not match any variant of untagged enum McpServer", "phase": "deserialization" }connection closed. - Both agents advertise
mcpCapabilities.http: truebut fail to deserialize HTTP server entries.
The PR's output format matches the ACP spec exactly. The failures are agent-side implementation gaps.
Findings
| # | Severity | Finding | Status |
|---|---|---|---|
| 1 | 🟡 | Helm inline-table keys for env/headers are unquoted — special chars produce invalid TOML |
Fixed: {{ $k }} → {{ $k | toJson }} ✅ |
Suggested Follow-ups (not blocking)
- File kiro-cli issue: ACP
mcpServersdeserialization rejects spec-compliant fields (name,env), crashes without JSON-RPC error response - File codex-acp issue: HTTP transport in
mcpServersfails deserialization despite advertisingmcpCapabilities.http: true - Consider documenting which agents have been verified to work with MCP forwarding
Question for Author
The PR's validation section lists static checks (cargo test, helm unittest, etc.) but no end-to-end verification with an actual ACP agent. Which agent(s) did you test MCP forwarding against? We found that codex-acp 0.14.0 works with stdio, but kiro-cli 2.4.0 crashes on the same payload. Knowing your target agent would help confirm the expected compatibility scope.
Verification
cargo test: 403 passedcargo clippy -- -D warnings: passhelm lint: passhelm unittest: 10 suites / 100 tests passed- E2E (codex-acp + stdio): ✅ full round-trip verified
|
Thanks for the review and the E2E matrix. I pushed
For the compatibility question: my author-side target was Your findings match the intended scope: OpenAB should forward spec-shaped MCP server definitions and avoid leaking MCP env/header values in logs; agent-side transport/deserialization gaps for HTTP/SSE or stricter clients should be tracked separately. I agree it would be useful to document the currently verified agent matrix; for this PR I would phrase it as stdio verified with |
This comment has been minimized.
This comment has been minimized.
|
Addressed the requested changes in
Validation:
|
|
Closing this PR — the approach conflicts with OpenAB's design philosophy. ReasonOpenAB intentionally does not manage or inject agent-level configuration. The project's direction is for each agent to self-discover and self-configure its own MCP servers (via its native config files, mounted volumes, or built-in discovery mechanisms). OAB's role is limited to spawning agents and routing messages — it should not dictate which MCP servers an agent uses. Injecting What would be welcome insteadA contribution that helps agents discover their own MCP configuration autonomously — for example, documentation on how to mount agent-native config files in K8s, or an init-container pattern that bootstraps each agent's home directory with its own MCP settings. Thank you for the thorough implementation and for addressing all prior review findings. The code quality was solid — this is purely a design-direction decision. — 超渡法師 (coordinator), on behalf of the maintainer |
Discord Discussion URL: https://discord.com/channels/1504115981566345299/1507357234156540026/1507357234156540026
Summary
[agent.mcp_servers]config and convert stdio/http/sse MCP servers into ACPmcpServers.session/newandsession/load.Notes
Cargo.lockpackage version is synced from0.8.3to0.8.4because upstreamCargo.tomlalready reports0.8.4andcargo checkupdates the lockfile.Validation
cargo checkcargo test(403 passed)cargo clippy -- -D warningsgit diff --checkhelm lint charts/openabhelm template test charts/openabhelm template test charts/openab --set agents.kiro.enabled=falsehelm unittest charts/openab(10 suites / 100 tests passed)