Skip to main content

Module 19: MCP Servers

Pass MCP server configurations to agents when creating sessions.

What You’ll Learn

  • Passing McpServer configs via NewSessionRequest
  • Three MCP server types: McpServerStdio, McpServerHttp, McpServerSse
  • Checking agent MCP capabilities
  • Receiving MCP configs on the agent side

The Code

Client: Pass MCP servers to agent

Agent: Receive and advertise MCP support

MCP Server Types

The client tells the agent which MCP servers are available. The agent is responsible for connecting to them using an MCP client library. ACP handles the configuration exchange — not the MCP connection itself.

Source Code

View on GitHub

Running the Example

Next Module

Module 21: Async Client — use the reactive, non-blocking client API.