Skip to main content
Same MCP env as MCP Config, but builds clients with pkg/mcp/client and passes them via WithMCPClients. Source: examples/agent_with_mcp_client/

What it demonstrates

  • mcpclient.NewClient with WithTimeout, WithRetryAttempts, WithToolFilter
  • Mixing config-based and client-based registration patterns
  • Pre-built clients for custom transport wiring

Run

From examples/:
Configure MCP_TRANSPORT, stdio or HTTP URLs, and auth in .env — see MCP Config for transport details and Configuration for the full variable reference.

Key code

Expected output

Learn more

MCP

MCP feature documentation

MCP Config

WithMCPConfig variant