Setting the file. One moment.
Subchapter 1.9
references/mcp.mdMarkdown1 KBView on GitHub
For new servers, prefer createMcpHandler over the deprecated McpAgent. For existing servers, check the installed SDK version and state/session requirements before choosing a migration path.
Read the relevant current documentation for implementation details and supported dependency versions:
| Task | Documentation |
|---|---|
| Build a server | Handler API (opens in a new tab) — server factories, Worker entrypoint, dependencies, and examples |
| Migrate an existing server | MCP SDK v2 migration (opens in a new tab) — stateless migration and temporary legacy paths |
| Connect to servers and use their tools | Client API (opens in a new tab) — connections, OAuth, tools, resources, and retries |
| Choose a transport | Transports (opens in a new tab) — remote HTTP and existing RPC integrations |
| Secure a server | Securing MCP servers (opens in a new tab) — OAuth and proxy security |