Skip to content

Commit 0c3fbf9

Browse files
authored
docs(mcp): describe the built-in proxy, not npx mcp-remote (#448)
* 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.
1 parent 2babcc2 commit 0c3fbf9

5 files changed

Lines changed: 47 additions & 46 deletions

File tree

docs/src/content/docs/docs/getting-started/installation.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Run AllAgents without installing:
1919
npx allagents
2020
```
2121

22+
:::note
23+
If you plan to use the [MCP Proxy](/docs/guides/mcp-proxy/) feature, install AllAgents globally (npm or bun) instead. The proxy command is invoked directly by your MCP clients later, not by you through npx, so `allagents` needs to already be resolvable on `PATH` at that point.
24+
:::
25+
2226
## Using bun
2327

2428
```bash

docs/src/content/docs/docs/guides/mcp-proxy.mdx

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
---
22
title: MCP Proxy
3-
description: Transparently proxy HTTP MCP servers through mcp-remote for clients that need stdio transport.
3+
description: Transparently proxy HTTP MCP servers through a built-in stdio bridge, with OAuth handled for you.
44
---
55

6-
Some MCP servers use HTTP transport with OAuth authentication, but not every AI client supports HTTP natively. The MCP proxy feature rewrites HTTP server configs to use [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) as a local stdio bridge, so all clients connect through an already-authenticated proxy.
7-
8-
When AllAgents generates a proxied client config, it does so through the public `allagents mcp proxy <serverUrl>` helper command.
6+
Some MCP servers use HTTP transport with OAuth authentication, but not every AI client supports HTTP natively. The MCP proxy feature rewrites HTTP server configs to run through AllAgents' own built-in stdio bridge (`allagents mcp proxy <serverUrl>`), so all clients connect through an already-authenticated proxy — no separate package to install.
97

108
## Quick Start
119

@@ -39,7 +37,8 @@ clients:
3937

4038
mcpProxy:
4139
# Claude Code supports HTTP MCP natively, so it gets the original URL.
42-
# Codex only speaks stdio, so rewrite its config to use `npx mcp-remote`.
40+
# Codex only speaks stdio, so rewrite its config to run through the
41+
# built-in `allagents mcp proxy` bridge.
4342
clients:
4443
- codex
4544
```
@@ -49,19 +48,20 @@ what each client received:
4948

5049
```bash
5150
cat .mcp.json # Claude — original HTTP config
52-
cat .codex/config.toml # Codex — rewritten to `npx mcp-remote` stdio
51+
cat .codex/config.toml # Codex — rewritten to `allagents mcp proxy` stdio
5352
```
5453

5554
DeepWiki is a public, no-auth MCP server, so this example works end-to-end
56-
with nothing more than Node.js installed (for `npx`). Point any of your
55+
with nothing more than `allagents` itself installed. Point any of your
5756
configured clients at the workspace and you can immediately call tools like
5857
`read_wiki_structure` or `ask_question` against any indexed GitHub repo.
5958

6059
## Why Use MCP Proxy
6160

62-
- **OAuth handled once**`mcp-remote` manages OAuth flows and caches tokens in `~/.mcp-auth/`
61+
- **OAuth handled once**the built-in proxy runs the full PKCE authorization flow the first time it connects, then caches the client registration and tokens under `~/.allagents/oauth-proxy/`; subsequent connections reuse them (with automatic token refresh) instead of reopening a browser
6362
- **Stdio everywhere** — clients that only support stdio can connect to HTTP servers
6463
- **Transparent** — configure which clients need proxying and AllAgents rewrites configs automatically during sync
64+
- **Nothing extra to install** — the proxy is built into the `allagents` binary; there's no separate package to fetch or cache on first use
6565

6666
## Configuration
6767

@@ -92,7 +92,7 @@ mcpProxy:
9292
2. For each server + client pair, it checks if proxying is needed:
9393
- Is the client listed in `mcpProxy.clients`?
9494
- Is there a per-server override in `mcpProxy.servers.<name>.proxy` that includes this client?
95-
3. If yes **and** the server uses HTTP transport (has a `url` field), the config is rewritten to use `mcp-remote` via stdio
95+
3. If yes **and** the server uses HTTP transport (has a `url` field), the config is rewritten to invoke `allagents mcp proxy` via stdio
9696
4. Stdio servers are never transformed — they pass through unchanged
9797

9898
### Transform Example
@@ -112,14 +112,8 @@ With `mcpProxy.clients: [claude]`, the synced config for Claude becomes:
112112
```json
113113
{
114114
"knowledge-base": {
115-
"command": "npx",
116-
"args": [
117-
"mcp-remote",
118-
"https://knowledge.mcp.example.com",
119-
"--http",
120-
"--static-oauth-client-metadata",
121-
"@~/.allagents/mcp-remote/mcp-metadata-settings.json"
122-
]
115+
"command": "allagents",
116+
"args": ["mcp", "proxy", "https://knowledge.mcp.example.com"]
123117
}
124118
}
125119
```
@@ -147,24 +141,28 @@ In this example:
147141

148142
Per-server `proxy` lists are additive — they extend the default `clients`, not replace them.
149143

150-
## Metadata File
144+
## OAuth & Token Cache
151145

152-
AllAgents automatically creates a metadata file at `~/.allagents/mcp-remote/mcp-metadata-settings.json` on first sync. This file is passed to `mcp-remote` via the `--static-oauth-client-metadata` flag and contains:
146+
The first time `allagents mcp proxy <url>` connects to a server that requires OAuth, it runs the standard authorization-code + PKCE flow: it registers a client with the server's authorization server (or reuses a cached registration), opens your browser to complete the login, and exchanges the resulting code for tokens.
153147

154-
```json
155-
{
156-
"client_uri": "http://localhost"
157-
}
148+
Client registration, tokens, and discovery metadata are cached per server under:
149+
150+
```
151+
~/.allagents/oauth-proxy/<hash-of-server-url>/
152+
client-info.json
153+
tokens.json
154+
code-verifier.txt
155+
discovery.json
158156
```
159157

160-
The file is created once and never overwritten, so you can customize it if needed.
158+
Later connections reuse this cache — no browser prompt — and an expired access token is refreshed automatically using the cached refresh token, still without reopening a browser. If you ever need to force a fresh login for a specific server (e.g. a revoked token), delete that server's subdirectory and reconnect.
161159

162160
## Prerequisites
163161

164-
The proxy uses `npx mcp-remote` to launch the bridge process. Because it runs through `npx`, there is nothing to install — `npx` downloads `mcp-remote` automatically on first use and caches it for subsequent runs. The only requirement is Node.js (which provides `npx`).
162+
None beyond `allagents` itself — the proxy has no separate runtime dependency to fetch or cache.
165163

166-
:::note
167-
The first time a proxied server starts, `npx` fetches `mcp-remote` from npm, which may add a few seconds of delay. Subsequent launches use the cached package and start immediately.
164+
:::caution
165+
`allagents` must be installed and on `PATH` (`npm install -g allagents` or `bun install -g allagents`) — running it via `npx allagents` is **not** enough for this feature. The proxy command is invoked directly by each MCP client (Claude Code, Codex, etc.), not by you, and the generated config embeds a bare `command: "allagents"`. `npx` resolves and runs the package for *your own* shell invocation, but doesn't add anything to `PATH` for another process to find afterward — so a client spawning that config later will fail with "command not found" unless `allagents` is genuinely installed.
168166
:::
169167

170168
## Scope

docs/src/content/docs/docs/reference/configuration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Servers AllAgents adds are tracked in `.allagents/sync-state.json`; pre-existing
207207

208208
## MCP Proxy
209209

210-
The optional `mcpProxy` section rewrites HTTP MCP servers to stdio via [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) for clients that need it. See the [MCP Proxy guide](/docs/guides/mcp-proxy/) for details.
210+
The optional `mcpProxy` section rewrites HTTP MCP servers to stdio via AllAgents' built-in `allagents mcp proxy` bridge for clients that need it. See the [MCP Proxy guide](/docs/guides/mcp-proxy/) for details.
211211

212212
```yaml
213213
mcpProxy:

examples/workspaces/mcp-proxy/.allagents/workspace.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Example: MCP Proxy — bridge HTTP MCP servers to stdio via mcp-remote
1+
# Example: MCP Proxy — bridge HTTP MCP servers to stdio via the built-in
2+
# `allagents mcp proxy` helper
23
#
34
# This workspace installs the `deepwiki` plugin from the official AllAgents
45
# marketplace. The plugin provides a single HTTP MCP server (DeepWiki), which
@@ -7,9 +8,9 @@
78
# https://mcp.deepwiki.com/mcp
89
#
910
# Some clients (e.g. Codex) only support stdio transport, so we use `mcpProxy`
10-
# to rewrite the HTTP config to use `npx mcp-remote` for those clients.
11-
# Clients that support HTTP natively (e.g. Claude Code) receive the original
12-
# HTTP config unchanged.
11+
# to rewrite the HTTP config to run through the built-in `allagents mcp proxy`
12+
# bridge for those clients. Clients that support HTTP natively (e.g. Claude
13+
# Code) receive the original HTTP config unchanged.
1314
#
1415
# Usage (scaffold a fresh copy anywhere):
1516
# allagents workspace init ./mcp-proxy-demo \
@@ -22,10 +23,10 @@
2223
#
2324
# After sync, inspect the result:
2425
# cat .mcp.json # Claude — original HTTP config
25-
# cat .codex/config.toml # Codex — rewritten to `npx mcp-remote` stdio
26+
# cat .codex/config.toml # Codex — rewritten to `allagents mcp proxy` stdio
2627
#
2728
# Requirements:
28-
# - Node.js (for `npx mcp-remote`)
29+
# - None beyond `allagents` itself
2930

3031
repositories: []
3132

@@ -41,7 +42,7 @@ clients:
4142

4243
mcpProxy:
4344
# Every HTTP MCP server (currently just `deepwiki`) will be rewritten to
44-
# use `npx mcp-remote` for these clients. Claude is omitted because it
45-
# supports HTTP MCP natively.
45+
# run through `allagents mcp proxy` for these clients. Claude is omitted
46+
# because it supports HTTP MCP natively.
4647
clients:
4748
- codex

examples/workspaces/mcp-proxy/README.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ A minimal, **copy-and-run** workspace that demonstrates the
44
[MCP Proxy](https://allagents.dev/docs/guides/mcp-proxy/) feature.
55

66
It installs a single plugin (`deepwiki`) that exposes a real public HTTP MCP
7-
server (`https://mcp.deepwiki.com/mcp`), and proxies it through
8-
[`mcp-remote`](https://www.npmjs.com/package/mcp-remote) for Codex — which
9-
only supports stdio transport.
7+
server (`https://mcp.deepwiki.com/mcp`), and proxies it through AllAgents'
8+
own built-in stdio bridge for Codex — which only supports stdio transport.
109

1110
## What gets synced
1211

1312
| Client | Transport | Config file |
1413
|--------|-----------|-------------|
1514
| `claude` | HTTP (untouched) | `.mcp.json` |
16-
| `codex` | stdio via `npx mcp-remote` | `.codex/config.toml` |
15+
| `codex` | stdio via `allagents mcp proxy` | `.codex/config.toml` |
1716

1817
## Running it
1918

@@ -43,8 +42,9 @@ cat .codex/config.toml # Rewritten stdio config for Codex
4342
You should see Codex invoking:
4443

4544
```
46-
npx mcp-remote https://mcp.deepwiki.com/mcp --http \
47-
--static-oauth-client-metadata @~/.allagents/mcp-remote/mcp-metadata-settings.json
45+
[mcp_servers.deepwiki]
46+
command = "allagents"
47+
args = ["mcp", "proxy", "https://mcp.deepwiki.com/mcp"]
4848
```
4949

5050
DeepWiki is a public, no-auth server, so you can connect immediately and
@@ -53,11 +53,9 @@ proxied client.
5353

5454
## Requirements
5555

56-
- [Node.js](https://nodejs.org/) (provides `npx`, needed to run `mcp-remote`
57-
on demand). Nothing to install globally — `npx` fetches and caches
58-
`mcp-remote` automatically the first time a proxied server starts.
56+
None beyond `allagents` itself — the proxy is built into the binary, with
57+
no separate package to fetch or cache on first use.
5958

6059
## See also
6160

6261
- [MCP Proxy guide](https://allagents.dev/docs/guides/mcp-proxy/)
63-
- [`mcp-remote` on npm](https://www.npmjs.com/package/mcp-remote)

0 commit comments

Comments
 (0)