Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ import {
createDefaultCoderDelegate,
} from '@tangle-network/agent-runtime/mcp'

const sandboxClient = new Sandbox({ apiKey: process.env.SANDBOX_API_KEY! })
const sandboxClient = new Sandbox({ apiKey: process.env.TANGLE_API_KEY! })
const server = createMcpServer({
coderDelegate: createDefaultCoderDelegate({ sandboxClient }),
// researcherDelegate: wire your own — see below.
Expand All @@ -210,14 +210,14 @@ await server.serve() // reads JSON-RPC from stdin, writes responses to stdout
Or run the ready-made bin:

```bash
SANDBOX_API_KEY=sk_sandbox_... agent-runtime-mcp
TANGLE_API_KEY=sk_sandbox_... agent-runtime-mcp
```

The bin auto-wires the coder delegate and, when
`@tangle-network/agent-knowledge` is installed as a peer, the researcher
delegate. Environment knobs:

- `SANDBOX_API_KEY` — required (unless both `MCP_DISABLE_*` are set)
- `TANGLE_API_KEY` — required (unless both `MCP_DISABLE_*` are set)
- `SANDBOX_BASE_URL` — sandbox-SDK base URL override
- `MCP_MAX_CONCURRENT_SANDBOXES` — kernel `maxConcurrency` cap (default 4)
- `MCP_CODER_FANOUT_HARNESSES` — comma-separated harness ids for `variants > 1`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tangle-network/agent-runtime",
"version": "0.20.1",
"version": "0.20.2",
"description": "Reusable runtime lifecycle for domain-specific agents.",
"homepage": "https://github.com/tangle-network/agent-runtime#readme",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/mcp/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* delegate against `multiHarnessResearcherFanout`.
*
* Environment variables:
* SANDBOX_API_KEY required — passed to `new Sandbox({ apiKey })`
* TANGLE_API_KEY required — passed to `new Sandbox({ apiKey })`
* SANDBOX_BASE_URL optional — sandbox-SDK base URL override
* MCP_MAX_CONCURRENT_SANDBOXES default 4 — kernel maxConcurrency cap
* MCP_CODER_FANOUT_HARNESSES comma-separated harness ids to use for variants > 1
Expand All @@ -38,10 +38,10 @@ async function main(): Promise<void> {
const needsSandbox = wantCoder || wantResearcher
let sandboxClient: LoopSandboxClient | undefined
if (needsSandbox) {
const apiKey = process.env.SANDBOX_API_KEY
const apiKey = process.env.TANGLE_API_KEY
if (!apiKey && !process.env.AGENT_RUNTIME_MCP_ALLOW_NO_KEY) {
process.stderr.write(
'agent-runtime-mcp: SANDBOX_API_KEY is required (set AGENT_RUNTIME_MCP_ALLOW_NO_KEY=1 to run without it for diagnostics, or set MCP_DISABLE_CODER=1 MCP_DISABLE_RESEARCHER=1 to run the queue-only subset)\n',
'agent-runtime-mcp: TANGLE_API_KEY is required (set AGENT_RUNTIME_MCP_ALLOW_NO_KEY=1 to run without it for diagnostics, or set MCP_DISABLE_CODER=1 MCP_DISABLE_RESEARCHER=1 to run the queue-only subset)\n',
)
process.exit(2)
}
Expand Down Expand Up @@ -85,7 +85,7 @@ async function loadSandboxClient(apiKey: string | undefined): Promise<LoopSandbo
return {
async create() {
throw new Error(
'agent-runtime-mcp: SANDBOX_API_KEY is unset; coder/researcher delegations are disabled in diagnostic mode. Set SANDBOX_API_KEY or use MCP_DISABLE_CODER=1 MCP_DISABLE_RESEARCHER=1 to remove the unsupported tools from the tool list.',
'agent-runtime-mcp: TANGLE_API_KEY is unset; coder/researcher delegations are disabled in diagnostic mode. Set TANGLE_API_KEY or use MCP_DISABLE_CODER=1 MCP_DISABLE_RESEARCHER=1 to remove the unsupported tools from the tool list.',
)
},
} satisfies LoopSandboxClient
Expand Down
Loading