Skip to content
GitHub Get Started
Agent

MCP

MCP (Model Context Protocol) servers extend agents with tools and external context.

The HTTP config endpoints let you store/retrieve MCP server configs by directory + name.

// Create MCP config
await sdk.setMcpConfig(
{
directory: "/workspace",
mcpName: "github",
},
{
type: "remote",
url: "https://example.com/mcp",
},
);
// Create a session using the configured MCP servers
const session = await sdk.createSession({
agent: "claude",
cwd: "/workspace",
});
await session.prompt([
{ type: "text", text: "Use available MCP servers to help with this task." },
]);
// List MCP configs
const config = await sdk.getMcpConfig({
directory: "/workspace",
mcpName: "github",
});
console.log(config.type);
// Delete MCP config
await sdk.deleteMcpConfig({
directory: "/workspace",
mcpName: "github",
});
FieldDescription
typelocal
commandexecutable path
argsarray of CLI args
envenvironment variable map
cwdworking directory
enabledenable/disable server
timeoutMstimeout override
FieldDescription
typeremote
urlMCP server URL
transporthttp or sse
headersstatic headers map
bearerTokenEnvVarenv var name to inject in auth header
envHeadersheader name to env var map
oauthoptional OAuth config object
enabledenable/disable server
timeoutMstimeout override

To bundle and upload your own MCP server into the sandbox, see Custom Tools.