Skip to main content

Configure an MCP server

Declare required MCP servers in the @agent decorator:

List Available Tools

Returns a list of ToolDefinition objects:

Call a Tool

Error Handling

Tool failures raise ToolCallError:

Real Example: Time Operations

Multiple MCP Servers

Environment Variables in MCP

Pass environment variables directly to MCP server processes:
To declare environment variables your agent code accesses via ctx.env, use the environment decorator field:

Stdio vs SSE Transport

Currently only stdio transport is supported. sse (Server-Sent Events) is planned.

Tool Chaining

API Reference: ctx.tools

Full tools capability API reference

MCP Specification

Official MCP protocol documentation

MCP Servers Registry

Browse available MCP servers