TheDocumentation Index
Fetch the complete documentation index at: https://mcpjam-mintlify-docs-update-pr-1946-1777273189104.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
MCPClientManager is your gateway to MCP servers. It handles connections, manages multiple servers, and provides a unified interface for calling tools, reading resources, and accessing prompts.
When to Use MCPClientManager
UseMCPClientManager when you need to:
- Connect to one or more MCP servers
- Execute tools programmatically (without an LLM)
- Build applications that aggregate tools from multiple servers
- Set up test environments for your MCP server
Two Types of Servers
MCP servers come in two transport types:STDIO Servers (Local)
STDIO servers run as subprocesses on your machine. You provide a command and arguments, and the SDK spawns the process.- Local development
- Servers you’re building
- CLI-based MCP servers
- Servers requiring local resources
HTTP Servers (Remote)
HTTP servers connect via SSE (Server-Sent Events) or Streamable HTTP over the network.- Production MCP servers
- Third-party integrations (Asana, Slack, etc.)
- Shared team servers
- Serverless deployments
HTTP Authentication Options
For HTTP servers,MCPClientManager supports three auth patterns:
accessTokenfor a static bearer tokenrefreshToken+clientIdfor non-interactive OAuth token exchange with automatic refreshauthProviderwhen you need to provide a custom MCP SDK OAuth provider
- exchanges the refresh token for an access token during connection
- automatically retries with a fresh access token when the server returns an auth challenge
- stores rotated refresh tokens returned by the authorization server
refreshToken is only supported for HTTP servers. When you use it, do not also set accessToken, authProvider, or an Authorization header in requestInit.headers.Connecting and Disconnecting
After configuring servers, you must explicitly connect:Always disconnect servers when you’re done, especially in tests. This cleans up subprocess handles and network connections.
Working with Multiple Servers
A key strength ofMCPClientManager is managing multiple servers simultaneously:
Executing Tools Directly
You can call tools without involving an LLM—useful for unit tests:Integration with TestAgent
The most common pattern is connecting servers, then creating aTestAgent with their tools:
Error Handling
Connection failures throw errors. Wrap in try/catch for production code:Health Checks
Verify a server is responsive:Next Steps
Testing with LLMs
Connect LLMs to your MCP tools
MCPClientManager Reference
Full API documentation

