MCPClient declares a connection to an external MCP server. Direct clients live under root mcp/; each public filename supplies the connection identity and exports a zero-argument client() factory returning MCPClient.
MCPClient.sse(...) only for a legacy SSE server. Connections and remote tool discovery are lazy, so offline compilation and unit tests do not need the server.
Framework adapters
Harnest keeps connection identity and approval policy consistent. Same-named tools on different servers remain distinct.
Authentication and gateways
Read URLs and static credentials from the deployment environment. For user-scoped access, resolve a token through Authentication and Credentials. Customize the HTTP client only for a gateway, mTLS, or transport policy. Put shared clients in lifecycle resources because adapters may call the factory more than once.Direct connections and plugins
Use rootmcp/ for a connection that is part of one agent. Use a plugins/<name>/ bundle when the connection and its progressive usage skills should travel together as one reusable capability.