Skip to content

Commit f3f7520

Browse files
committed
docs: add documentation for routing modes, quarantine, TypeScript, and modern JS
- Routing modes (direct, retrieve_tools, code_execution) in config docs - Tool quarantine auto-approve behavior and UX in security-quarantine.md - TypeScript code execution support in code-execution.md and overview.md - Quarantine stats in REST API docs (servers endpoint) - Doctor quarantine stats in CLI command reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3407971 commit f3f7520

8 files changed

Lines changed: 314 additions & 23 deletions

File tree

docs/api/mcp-protocol.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,30 @@ keywords: [mcp, protocol, tools, proxy]
1111

1212
MCPProxy implements the Model Context Protocol (MCP) specification, providing AI clients with unified access to multiple upstream MCP servers.
1313

14-
## Endpoint
14+
## Endpoints
15+
16+
### Default Endpoint
1517

1618
```
1719
http://127.0.0.1:8080/mcp
1820
```
1921

20-
**Note:** The MCP endpoint does not require API key authentication for client compatibility.
22+
Serves the routing mode configured in `routing_mode` (default: `retrieve_tools`).
23+
24+
### Routing Mode Endpoints
25+
26+
Each routing mode has a dedicated endpoint that is always available regardless of the configured default:
27+
28+
| Endpoint | Mode | Description |
29+
|----------|------|-------------|
30+
| `/mcp` | *(configured)* | Default routing mode from config |
31+
| `/mcp/call` | `retrieve_tools` | BM25 search via `retrieve_tools` + `call_tool` variants |
32+
| `/mcp/all` | `direct` | All upstream tools as `serverName__toolName` |
33+
| `/mcp/code` | `code_execution` | JavaScript orchestration via `code_execution` tool |
34+
35+
See [Routing Modes](../features/routing-modes.md) for details on each mode.
36+
37+
**Note:** MCP endpoints do not require API key authentication for client compatibility.
2138

2239
## Built-in Tools
2340

docs/api/rest-api.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,93 @@ OAuth errors return structured error responses for better debugging:
263263

264264
Clear OAuth tokens and disconnect a server.
265265

266+
### Tool Quarantine
267+
268+
#### POST /api/v1/servers/{name}/tools/approve
269+
270+
Approve pending or changed tools for a server. See [Tool Quarantine](../features/tool-quarantine.md) for details.
271+
272+
**Request Body:**
273+
```json
274+
{
275+
"tools": ["create_issue", "delete_repo"]
276+
}
277+
```
278+
279+
Or approve all pending/changed tools:
280+
```json
281+
{
282+
"approve_all": true
283+
}
284+
```
285+
286+
**Response:**
287+
```json
288+
{
289+
"success": true,
290+
"data": {
291+
"approved": 2,
292+
"tools": ["create_issue", "delete_repo"],
293+
"message": "Approved 2 tools for server github-server"
294+
}
295+
}
296+
```
297+
298+
#### GET /api/v1/servers/{name}/tools/{tool}/diff
299+
300+
Get the description/schema diff for a changed tool.
301+
302+
**Response:**
303+
```json
304+
{
305+
"success": true,
306+
"data": {
307+
"server_name": "github-server",
308+
"tool_name": "delete_repo",
309+
"status": "changed",
310+
"approved_hash": "abc123...",
311+
"current_hash": "def456...",
312+
"previous_description": "Delete a repository",
313+
"current_description": "Delete a repository (modified description)",
314+
"previous_schema": "...",
315+
"current_schema": "..."
316+
}
317+
}
318+
```
319+
320+
#### GET /api/v1/servers/{name}/tools/export
321+
322+
Export all tool descriptions and schemas for a server. Useful for audit and compliance.
323+
324+
**Query Parameters:**
325+
- `format` - Export format: `json` (default) or `text`
326+
327+
### Routing
328+
329+
#### GET /api/v1/routing
330+
331+
Get the current routing mode and available MCP endpoints.
332+
333+
**Response:**
334+
```json
335+
{
336+
"success": true,
337+
"data": {
338+
"routing_mode": "retrieve_tools",
339+
"description": "BM25 search via retrieve_tools + call_tool variants (default)",
340+
"endpoints": {
341+
"default": "/mcp",
342+
"direct": "/mcp/all",
343+
"code_execution": "/mcp/code",
344+
"retrieve_tools": "/mcp/call"
345+
},
346+
"available_modes": ["retrieve_tools", "direct", "code_execution"]
347+
}
348+
}
349+
```
350+
351+
See [Routing Modes](../features/routing-modes.md) for details on each mode.
352+
266353
### Tools
267354

268355
#### GET /api/v1/tools

docs/cli/command-reference.md

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,23 @@ mcpproxy serve [flags]
139139
Run health diagnostics:
140140

141141
```bash
142-
mcpproxy doctor
142+
mcpproxy doctor [flags]
143143
```
144144

145+
| Flag | Description | Default |
146+
|------|-------------|---------|
147+
| `--output, -o` | Output format: `pretty`, `json` | `pretty` |
148+
| `--log-level, -l` | Log level | `warn` |
149+
| `--config, -c` | Path to config file | auto-detect |
150+
145151
Checks for:
146152
- Upstream server connection errors
147153
- OAuth authentication requirements
148154
- Missing secrets
149155
- Runtime warnings
150156
- Docker isolation status
157+
- Tools pending quarantine approval (pending/changed counts per server)
158+
- Security features status (routing mode, sensitive data detection)
151159

152160
## Upstream Management
153161

@@ -185,6 +193,54 @@ mcpproxy upstream restart <server-name>
185193
mcpproxy upstream restart --all
186194
```
187195

196+
### upstream inspect
197+
198+
Inspect tool approval status for a server (tool-level quarantine):
199+
200+
```bash
201+
mcpproxy upstream inspect <server-name> [flags]
202+
```
203+
204+
| Flag | Description | Default |
205+
|------|-------------|---------|
206+
| `--tool` | Inspect a specific tool by name | all tools |
207+
| `--output, -o` | Output format: table, json | `table` |
208+
209+
**Examples:**
210+
211+
```bash
212+
# Show all tool approvals for a server
213+
mcpproxy upstream inspect github-server
214+
215+
# Inspect a specific tool (shows diff if changed)
216+
mcpproxy upstream inspect github-server --tool create_issue
217+
218+
# JSON output for scripting
219+
mcpproxy upstream inspect github-server --output=json
220+
```
221+
222+
See [Tool Quarantine](/features/tool-quarantine) for details.
223+
224+
### upstream approve
225+
226+
Approve quarantined tools for a server:
227+
228+
```bash
229+
mcpproxy upstream approve <server-name> [tool-names...]
230+
```
231+
232+
Without specific tool names, approves all pending/changed tools.
233+
234+
**Examples:**
235+
236+
```bash
237+
# Approve all pending/changed tools
238+
mcpproxy upstream approve github-server
239+
240+
# Approve specific tools
241+
mcpproxy upstream approve github-server create_issue list_repos
242+
```
243+
188244
### upstream enable/disable
189245

190246
Enable or disable a server:
@@ -344,24 +400,32 @@ mcpproxy call tool-destructive --tool-name=github:delete_repo --json_args='{"rep
344400

345401
### code exec
346402

347-
Execute JavaScript code:
403+
Execute JavaScript or TypeScript code:
348404

349405
```bash
350406
mcpproxy code exec [flags]
351407
```
352408

353409
| Flag | Description | Default |
354410
|------|-------------|---------|
355-
| `--code` | JavaScript code to execute | - |
356-
| `--file` | Path to JavaScript file (alternative to --code) | - |
411+
| `--code` | JavaScript or TypeScript code to execute | - |
412+
| `--file` | Path to JS/TS file (alternative to --code) | - |
413+
| `--language` | Source code language: `javascript`, `typescript` | `javascript` |
357414
| `--input` | JSON input data | `{}` |
358415
| `--input-file` | Path to JSON file containing input data | - |
359416
| `--max-tool-calls` | Maximum tool calls (0 = unlimited) | `0` |
360417
| `--allowed-servers` | Comma-separated list of allowed servers | - |
361418

362-
**Example:**
419+
**Examples:**
363420
```bash
421+
# JavaScript (default)
364422
mcpproxy code exec --code="({ result: input.value * 2 })" --input='{"value": 21}'
423+
424+
# TypeScript with type annotations
425+
mcpproxy code exec --language typescript --code="const x: number = 42; ({ result: x })"
426+
427+
# TypeScript from file
428+
mcpproxy code exec --language typescript --file=script.ts --input-file=params.json
365429
```
366430

367431
See [Code Execution](/features/code-execution) for detailed documentation.

docs/cli/status-command.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ MCPProxy Status
5050
Uptime: 2h 15m
5151
API Key: a1b2****gh78
5252
Web UI: http://127.0.0.1:8080/ui/?apikey=a1b2...gh78
53+
Routing: retrieve_tools
5354
Servers: 12 connected, 2 quarantined
5455
Socket: /Users/you/.mcpproxy/mcpproxy.sock
5556
Config: /Users/you/.mcpproxy/mcp_config.json
@@ -125,6 +126,7 @@ mcpproxy status -o json
125126
"uptime_seconds": 8100,
126127
"api_key": "a1b2****gh78",
127128
"web_ui_url": "http://127.0.0.1:8080/ui/?apikey=...",
129+
"routing_mode": "retrieve_tools",
128130
"servers": {
129131
"connected": 12,
130132
"quarantined": 2,

docs/code_execution/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ mcpproxy code exec --language typescript \
428428
429429
- TypeScript support uses type-stripping only (no type checking or semantic validation)
430430
- Valid JavaScript is also valid TypeScript, so you can always use `language: "typescript"` even for plain JS
431-
- The transpiled output runs in the same ES5.1+ goja sandbox with all existing capabilities
431+
- The transpiled output runs in the same ES2020+ goja sandbox with all existing capabilities
432432
- Transpilation errors return the `TRANSPILE_ERROR` error code with line/column information
433433
434434
## Best Practices

0 commit comments

Comments
 (0)