await api.mcp.forAgent(); // every connected server
await api.mcp.forAgent(["example"]); // these
await api.mcp.forAgent([]); // none — and no request is madeapi.mcp.for_agent() # every connected server
api.mcp.for_agent(["example"]) # these
api.mcp.for_agent([]) # none — and no request is madenull and [] are different, and both are useful
| Passed | Means |
|---|---|
null or nothing | Every connected server |
["a", "b"] | Those two |
[] | None. It returns immediately without asking. |
Only allowed tools come out, so taking every server is not the open door it sounds like. A server with nothing allowed contributes nothing.
It carries tokens
The engine needs them to contact each server, so this is the one listing that includes them. They are decrypted for the authenticated owner and for nobody else — do not log what this returns.
The agent reads it for you
api.agents.create({ runtime: "local", machine: pc, model, mcp: ["example"] });
// mcp absent → every connected server
// mcp: [] → noneapi.agents.create(runtime="local", machine=pc, model=model, mcp=["example"])
# mcp absent → every connected server
# mcp=[] → noneIt is re-read at the start of every run, so a server connected from another window is available without restarting whatever holds the package.
When to call it directly
When you are building the engine's tool shape yourself — createMcpTools() takes exactly what this returns. For declarations alone, tools() is the one to use.