Skip to content

Commit a3edcfc

Browse files
authored
Merge pull request #76 from OpenAF/codex/create-mcp-proxy.yaml-for-llm-connections
Add MCP proxy descriptor
2 parents f124f45 + ee5ff89 commit a3edcfc

File tree

3 files changed

+716
-0
lines changed

3 files changed

+716
-0
lines changed

EXTERNAL-MCPS.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,28 @@ mini-a goal="use the private MCP" \
4343
```
4444

4545
Prefer environment variables for sensitive data and confirm the external MCP's rate limits before automating high-frequency calls.
46+
47+
## Aggregating multiple MCPs with mcp-proxy
48+
49+
When working with multiple external MCPs (or a mix of external and built-in MCPs), you can use `mcp-proxy` to aggregate them into a single unified endpoint. This simplifies configuration and provides a centralized interface for discovering and calling tools across all connected MCP servers.
50+
51+
### Example: Aggregate external and built-in MCPs
52+
53+
```bash
54+
# Start mcp-proxy aggregating Wikipedia, DuckDuckGo, and built-in mcp-time
55+
ojob mcps/mcp-proxy.yaml onport=9000 \
56+
mcp="[(cmd: 'docker run --rm -i mcp/wikipedia-mcp'), (cmd: 'docker run --rm -i mcp/duckduckgo'), (cmd: 'ojob mcps/mcp-time.yaml')]"
57+
58+
# Now use the proxy with Mini-A
59+
mini-a goal="search for information about Lisbon and tell me the current time there" \
60+
mcp="(type: remote, url: 'http://localhost:9000/mcp')" rpm=20
61+
```
62+
63+
### Benefits of using mcp-proxy
64+
65+
- **Unified discovery**: List and search tools across all downstream MCPs with a single `proxy-dispatch` call.
66+
- **Simplified configuration**: Connect once to the proxy instead of managing multiple MCP connections.
67+
- **Mixed sources**: Combine STDIO MCPs (including Docker-based), HTTP remote MCPs, and built-in MCPs seamlessly.
68+
- **Connection management**: The proxy handles initialization, tool caching, and connection health for all downstream servers.
69+
70+
See [mcps/README.md](mcps/README.md#mcp-proxy) for detailed `mcp-proxy` documentation and additional examples.

mcps/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
| mcp-ssh | SSH execution MCP (secure exec) | STDIO/HTTP | (included) | [mcp-ssh.yaml](mcp-ssh.yaml) |
1818
| mcp-shell | Local shell execution MCP | STDIO/HTTP | (included) | [mcp-shell.yaml](mcp-shell.yaml) |
1919
| mcp-mini-a | Mini-A agent runner MCP | STDIO/HTTP | (included) | [mcp-mini-a.yaml](mcp-mini-a.yaml) |
20+
| mcp-proxy | MCP proxy aggregating multiple downstream MCP connections | STDIO/HTTP | (included) | [mcp-proxy.yaml](mcp-proxy.yaml) |
2021
| mcp-oaf | OpenAF / oJob / oAFp documentation MCP | STDIO/HTTP | (included) | [mcp-oaf.yaml](mcp-oaf.yaml) |
2122
| mcp-oafp | OpenAF processor (oafp) runner & docs MCP | STDIO/HTTP | (included) | [mcp-oafp.yaml](mcp-oafp.yaml) |
2223
| mcp-rss | RSS discovery and retrieval MCP | STDIO/HTTP | (included) | [mcp-rss.yaml](mcp-rss.yaml) |
@@ -37,6 +38,68 @@ See [CREATING.md](CREATING.md) for instructions on creating new MCPs and contrib
3738
oafp in=mcp data="(cmd: 'ojob mcps/mcp-mini-a.yaml', tool: run-goal, params: (goal: 'summarize README.md', format: 'md', useplanning: true))"
3839
```
3940

41+
#### mcp-proxy
42+
43+
`mcp-proxy` aggregates multiple downstream MCP connections (STDIO or HTTP remote) into a single unified MCP server. This enables you to expose a consolidated set of tools from various MCP sources through one endpoint, simplifying integration with LLMs and other MCP clients.
44+
45+
Key arguments:
46+
47+
- `mcp` (required): JSSLON string describing one MCP connection or an array of MCP connection descriptors. Each descriptor follows the same format used with Mini-A's `mcp=` parameter.
48+
- `onport` (optional): Start an HTTP MCP server on the specified port.
49+
- `libs` (optional): Comma-separated libraries or `@oPack/library.js` references to preload before connecting (useful for custom helpers or drivers).
50+
51+
The proxy exposes a single powerful tool:
52+
53+
- `proxy-dispatch`: Interact with downstream MCP connections. Supports three actions:
54+
- `list`: List all registered connections and their tools (optionally filter by connection).
55+
- `search`: Search for tools across connections using a text query that matches against tool names, descriptions, and annotations.
56+
- `call`: Invoke a specific tool on a target connection (automatically resolves which connection hosts the tool if unambiguous).
57+
58+
Available parameters for `proxy-dispatch`:
59+
60+
- `action` (required): One of `list`, `search`, or `call`.
61+
- `connection` (optional): Connection identifier or alias to scope the action.
62+
- `query` (optional): Search text for `search` action.
63+
- `tool` (optional): Tool name for `call` action.
64+
- `arguments` (optional): Input arguments to forward to the downstream tool when calling.
65+
- `meta` (optional): Metadata object forwarded to the downstream MCP call.
66+
- `limit` (optional): Maximum number of results for `search` actions.
67+
- `includeTools`, `includeInputSchema`, `includeAnnotations` (optional): Control verbosity of returned metadata.
68+
- `refresh` (optional): Refresh tool metadata from downstream MCPs before executing the action.
69+
70+
Example — aggregate multiple STDIO MCPs and call remotely:
71+
72+
```bash
73+
# Start the proxy as an HTTP server aggregating mcp-time and mcp-net
74+
ojob mcps/mcp-proxy.yaml onport=9090 \
75+
mcp="[(cmd: 'ojob mcps/mcp-time.yaml'), (cmd: 'ojob mcps/mcp-net.yaml')]"
76+
77+
# List all available connections and their tools
78+
oafp in=mcp data="(type: remote, url: 'http://localhost:9090/mcp', tool: proxy-dispatch, params: (action: list))"
79+
80+
# Search for tools related to 'time'
81+
oafp in=mcp data="(type: remote, url: 'http://localhost:9090/mcp', tool: proxy-dispatch, params: (action: search, query: 'time'))"
82+
83+
# Call a specific tool through the proxy
84+
oafp in=mcp data="(type: remote, url: 'http://localhost:9090/mcp', tool: proxy-dispatch, params: (action: call, tool: 'current-time'))"
85+
```
86+
87+
Example — mix STDIO and remote MCPs:
88+
89+
```bash
90+
# Aggregate a local MCP and a remote one
91+
ojob mcps/mcp-proxy.yaml onport=8080 \
92+
mcp="[(cmd: 'ojob mcps/mcp-time.yaml'), (type: remote, url: 'http://external.mcp.local:1234/mcp')]"
93+
```
94+
95+
Example — use with Mini-A to access aggregated tools:
96+
97+
```bash
98+
# The proxy can simplify mcp= configuration by consolidating multiple sources
99+
mini-a goal="what time is it in Tokyo and what is my public IP?" \
100+
mcp="(type: remote, url: 'http://localhost:9090/mcp')" rpm=20
101+
```
102+
40103
#### mcp-db
41104

42105
`mcp-db` provides JDBC-backed database access over STDIO or HTTP. Configure it with the following arguments:

0 commit comments

Comments
 (0)