Skip to content

Add built-in HTTP MCP proxy for proxied servers - #367

Merged
christso merged 6 commits into
mainfrom
codex/mcp-add-proxy
Apr 23, 2026
Merged

Add built-in HTTP MCP proxy for proxied servers#367
christso merged 6 commits into
mainfrom
codex/mcp-add-proxy

Conversation

@christso

Copy link
Copy Markdown
Contributor

Summary

  • replace the hardcoded mcp-remote rewrite behind allagents mcp add --proxy with a first-party allagents mcp proxy-stdio helper
  • add a built-in HTTP-to-stdio MCP bridge using the MCP TypeScript SDK, including loopback OAuth handling, client registration persistence, and header forwarding
  • update proxy tests and e2e coverage to validate the new generated client config shape

Validation

  • bun run typecheck
  • bun test tests/unit/core/mcp-proxy.test.ts tests/unit/core/mcp-proxy-cli.test.ts tests/e2e/mcp-add-proxy.test.ts
  • manual Claude connection check via mcp proxy-stdio against DeepWiki
  • manual Claude connection check via mcp proxy-stdio against an OAuth-protected remote MCP after browser auth

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 23, 2026

Copy link
Copy Markdown

Deploying allagents with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9e72c72
Status: ✅  Deploy successful!
Preview URL: https://15c25661.allagents.pages.dev
Branch Preview URL: https://codex-mcp-add-proxy.allagents.pages.dev

View logs

@christso
christso merged commit b6166e6 into main Apr 23, 2026
1 check passed
@christso
christso deleted the codex/mcp-add-proxy branch April 23, 2026 11:16
christso added a commit that referenced this pull request Aug 4, 2026
* docs(mcp): describe the built-in proxy, not npx mcp-remote

The MCP proxy guide, its example workspace, and a configuration
reference all still described the pre-#367 design that shelled out to
the third-party `npx mcp-remote` package, with OAuth state cached
under ~/.mcp-auth/ and a ~/.allagents/mcp-remote/mcp-metadata-settings.json
metadata file. None of that matches the current implementation:
`allagents mcp proxy <url>` is a from-scratch, built-in bridge (no npx,
no Node.js requirement beyond allagents itself), and its OAuth client
registration/tokens are cached per-server under
~/.allagents/oauth-proxy/<hash>/ (see src/core/mcp-http-stdio-proxy.ts).

Verified the example workspace's documented transform output against
the actual generated `.codex/config.toml` by running `allagents update`
against it.

* docs(mcp): warn that MCP proxy needs a real install, not just npx

The proxy feature writes a bare `command: "allagents"` into generated
client configs (.mcp.json, .codex/config.toml, etc.), which the MCP
client spawns directly later -- not through npx. Someone who only ever
runs `npx allagents` for ad hoc commands would hit a "command not
found" failure the first time a proxied server actually starts,
without any indication why. Cross-referenced from the general
installation guide's npx section too.

Verified: a bare `allagents` on PATH only resolves when actually
installed (npm/bun global install symlinks it), confirmed on this
machine's real global install at /usr/lib/node_modules/allagents.
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