mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-18 16:02:32 +00:00
feat: add private mcp tunnel tool
This commit is contained in:
parent
cc5a9e0d73
commit
e3aee90cf4
13 changed files with 1923 additions and 614 deletions
18
docs/cli.mdx
18
docs/cli.mdx
|
|
@ -162,6 +162,7 @@ sandbox-agent api sessions create <SESSION_ID> [OPTIONS]
|
|||
| `-m, --model <MODEL>` | Model override |
|
||||
| `-v, --variant <VARIANT>` | Model variant |
|
||||
| `-A, --agent-version <VERSION>` | Agent version |
|
||||
| `--mcp-tunnel-tools <JSON>` | JSON array of MCP tool definitions |
|
||||
|
||||
```bash
|
||||
sandbox-agent api sessions create my-session \
|
||||
|
|
@ -289,6 +290,22 @@ sandbox-agent api sessions reply-permission <SESSION_ID> <PERMISSION_ID> [OPTION
|
|||
sandbox-agent api sessions reply-permission my-session perm1 --reply once
|
||||
```
|
||||
|
||||
#### Reply to MCP Tunnel Tool Call
|
||||
|
||||
```bash
|
||||
sandbox-agent api sessions reply-mcp-tunnel <SESSION_ID> <CALL_ID> [OPTIONS]
|
||||
```
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `-o, --output <TEXT>` | Tool output (required) |
|
||||
| `--is-error` | Mark tool result as error |
|
||||
| `--content <JSON>` | Optional MCP content payload |
|
||||
|
||||
```bash
|
||||
sandbox-agent api sessions reply-mcp-tunnel my-session call-1 --output "ok"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## CLI to HTTP Mapping
|
||||
|
|
@ -308,3 +325,4 @@ sandbox-agent api sessions reply-permission my-session perm1 --reply once
|
|||
| `api sessions reply-question` | `POST /v1/sessions/{sessionId}/questions/{questionId}/reply` |
|
||||
| `api sessions reject-question` | `POST /v1/sessions/{sessionId}/questions/{questionId}/reject` |
|
||||
| `api sessions reply-permission` | `POST /v1/sessions/{sessionId}/permissions/{permissionId}/reply` |
|
||||
| `api sessions reply-mcp-tunnel` | `POST /v1/sessions/{sessionId}/mcp-tunnel/calls/{callId}/response` |
|
||||
|
|
|
|||
|
|
@ -365,6 +365,69 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/v1/sessions/{session_id}/mcp-tunnel/calls/{call_id}/response": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"sessions"
|
||||
],
|
||||
"operationId": "reply_mcp_tunnel_call",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "session_id",
|
||||
"in": "path",
|
||||
"description": "Session id",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "call_id",
|
||||
"in": "path",
|
||||
"description": "MCP call id",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/McpTunnelToolResponseRequest"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"204": {
|
||||
"description": "MCP tool call responded"
|
||||
},
|
||||
"400": {
|
||||
"description": "",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ProblemDetails"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/v1/sessions/{session_id}/messages": {
|
||||
"post": {
|
||||
"tags": [
|
||||
|
|
@ -1063,6 +1126,14 @@
|
|||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"mcpTunnel": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/McpTunnelConfig"
|
||||
}
|
||||
],
|
||||
"nullable": true
|
||||
},
|
||||
"model": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
|
|
@ -1258,6 +1329,56 @@
|
|||
"failed"
|
||||
]
|
||||
},
|
||||
"McpTunnelConfig": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"tools"
|
||||
],
|
||||
"properties": {
|
||||
"tools": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/McpTunnelTool"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"McpTunnelTool": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name"
|
||||
],
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
},
|
||||
"inputSchema": {
|
||||
"nullable": true
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"McpTunnelToolResponseRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"output"
|
||||
],
|
||||
"properties": {
|
||||
"content": {
|
||||
"nullable": true
|
||||
},
|
||||
"isError": {
|
||||
"type": "boolean",
|
||||
"nullable": true
|
||||
},
|
||||
"output": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MessageRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue