Repository navigation
feat: factory MCP wiring — --mcp-server on mecatequi/mecak8s + compact summary - #347
Merged
Merged
Conversation
…t summary (#341) Register the repeatable --mcp-server name=URL flag and the MCP_<NAME>_TOKEN bearer convention on mecatequi and mecak8s via a shared cliconfig.MCPServerList helper (extracted from mecated, which now uses it too), so a scheduler (titlani) can inject a short-lived per-run identity the run presents to vmcp / tequitl MCP endpoints. An EXPLICIT --out-summary=- on mecatequi now selects a stdout-compact mode: the Summary is emitted as a single compact JSON line as the FINAL stdout line (the unset default keeps indented JSON). --run-id/--task-ref are deliberately NOT accepted — schedulers correlate via their own launch identity plus Summary.session_id. Security-review hardenings (deliberately tightening mecated too): - CWE-178: server names must match [A-Za-z0-9_]+ and be case-insensitively unique (vmcp/VMCP/vMcp all derive MCP_VMCP_TOKEN; my-svc would derive an unsettable env var and silently connect unauthenticated). - CWE-319: a token-bearing URL must be https, or http to loopback (reuses mcp.ValidateClientURL), so an injected bearer never travels cleartext off-host. Tokenless URLs are not gated. Docs note that on mecak8s the token is read once at startup and shared process-wide (per-run identity is mecatequi-only; per-session credentials are mecatl#342), and that the compact-summary last-line guarantee is stdout-only — a merged pod log consumer must take the last line that PARSES as the Summary. Recorded as ADR 0082 (pairs with titlani's run-contract ADR 0010); factory invocation profile documented in docs/usage/mecatequi-ci.md. cmd/internal layer only — the engine module and its API surface are untouched. Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Aug 4, 2026
JAORMX
added a commit
that referenced
this pull request
Aug 4, 2026
…independent (#360) * feat(cliconfig): per-server --mcp-server-insecure-http opt-in, order-independent (#358) MCPServerList.Set no longer runs the token-bearing scheme gate inline: entries are collected during parse and the CWE-319 gate runs in a new post-parse Finalize step the three mains (mecated, mecatequi, mecak8s) call right after flag.Parse — so the new repeatable --mcp-server-insecure-http <name> relaxation composes with --mcp-server regardless of argv order (the titlani#40 contract addition). The relaxation applies ONLY to the named server (same ^[A-Za-z0-9_]+$ name grammar as #347), ONLY to the http scheme; an unknown name, or a name whose URL is https/loopback/non-http, is a loud error (a stale acknowledgment is never silently inert). Default posture unchanged: a token-bearing http non-loopback URL without the relaxation still fails. Servers() panics fail-closed before a successful Finalize. Co-Authored-By: Claude Fable 5 <[email protected]> * docs: ADR 0090 + operator docs for --mcp-server-insecure-http (#358) New ADR 0090 records the per-server plain-http opt-in decision, the rejected proxy-sidecar alternative (satisfies the gate without changing wire security), the rejected global escape hatch, and the order-independence requirement from titlani#40. Factory invocation profile (docs/usage/mecatequi-ci.md), the mecated/mecak8s flag tables, and the user-docs MCP pages state the acknowledgment plainly: cleartext on the network path; network-layer controls + short-lived tokens are the operator's mitigations. llms.txt regenerated. Co-Authored-By: Claude Fable 5 <[email protected]> --------- Co-authored-by: Claude Fable 5 <[email protected]>
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.
Closes #341.
What:
--mcp-server name=URLparsing +MCP_<NAME>_TOKENbearer resolution intointernal/cliconfig/mcpserver.goand registers it on mecatequi and mecak8s (threaded ontoapp.Config.MCPServers); mecated switches to the shared helper with byte-identical help.--out-summary=-: emits the Summary as a single compact JSON line as the final stdout line, so a scheduler tailing logs can parse it (the indented default cannot be last-line-parsed). Default unchanged.--run-id/--task-refare deliberately not accepted (schedulers correlate via their launch identity +Summary.session_id); factory invocation profile documented indocs/usage/mecatequi-ci.md(--posture auto,--untrusted-prompt,--timeout, token env, compact summary).Security review (secure-code-reviewer pass, findings applied):
^[A-Za-z0-9_]+$+ case-insensitive env-name collision rejection (CWE-178) — deliberately tightens mecated too.mcp.ValidateClientURL(CWE-319).Verified clean by the review: no token leak via String()/help/errors/Summary/event-log; envscrub already denies
*_TOKENto agent shells; SSRF/redirect posture unchanged; json escaping makes final_text unable to break single-line framing.Gates: task build / test / lint / api:check / docs all green; engine module untouched (no api:update). All new tests watched red first.
🤖 Generated with Claude Code