Skip to content

feat(mcp): add termherd mcp-proxy and export TERMHERD_MCP_CONFIG for Antigravity sessions - #618

Merged
bastien-gallay merged 4 commits into
mainfrom
feat/mcp-proxy
Nov 23, 2026
Merged

bastien-gallay merged 4 commits into
mainfrom
feat/mcp-proxy

Conversation

@bastien-gallay

Copy link
Copy Markdown
Collaborator

Summary

  • Export TERMHERD_MCP_CONFIG (pointing at the per-session 0600 mcpServers config file, never the bearer token itself) into agent PTY environments in crates/pty, with a dedicated TERMHERD_SESSION_VARS strip list beside INHERITED_SESSION_VARS so plain shells and nested TermHerd instances never inherit an outer session's bridge pointer.
  • Enable Provider::Antigravity.capabilities().mcp_bridge_injection so Antigravity launches receive a per-session revocable live-bridge token.
  • Add the termherd mcp-proxy subcommand (crates/app/src/mcp_proxy.rs + cli::Command::McpProxy), a zero-extra-dependency stdio-to-HTTP/1.1 loopback proxy:
    • When TERMHERD_MCP_CONFIG is set, forwards newline-delimited JSON-RPC to the session's live bridge and surfaces any config, transport, or 401/403 error explicitly (never silently falling back).
    • When TERMHERD_MCP_CONFIG is absent (launched outside TermHerd, or a host CLI that did not propagate it), logs why on stderr and serves the settings.json tools with explicit initialize instructions explaining why the live workspace tools are unavailable.
  • Document termherd mcp-proxy and agy mcp add termherd /path/to/termherd mcp-proxy in docs/src/mcp/live-bridge.md and CHANGELOG.md.

Verification

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p termherd-core locations (7 passed), provider (6 passed)
  • cargo test -p termherd-pty launch (31 passed)
  • cargo test -p termherd-app -- mcp_proxy cli::tests an_antigravity_spawn_gets_an_mcp_config_and_a_revocable_token (13 passed, including end-to-end loopback tests against crate::mcp::serve)
  • markdownlint-cli2, just check-deps, just check-arch

@bastien-gallay
bastien-gallay merged commit e6ea641 into main Nov 23, 2026
12 checks passed
@bastien-gallay
bastien-gallay deleted the feat/mcp-proxy branch November 23, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant