mcp-client-manager-go
Package mcpmgr provides a high-level manager for connecting to, monitoring, and coordinating multiple Model Context Protocol (MCP) servers from Go applications. The companion mcpgateway package builds on top of mcpmgr to expose every managed server through a single Streamable HTTP endpoint.
claude mcp add --transport stdio vikashloomba-mcp-client-manager-go npx @modelcontextprotocol/server-everything
How to use
The MCP Client Manager (Go) provides a lightweight orchestration layer around MCP transports (stdio and HTTP). It lets you register multiple servers, maintain persistent connections, fan out events, and readily call tools, prompts, and resources from Go applications. The companion mcpgateway component adds a single Streamable HTTP endpoint that re-exports every managed tool, prompt, and resource, enabling downstream clients to connect once and access everything through the gateway. Typical usage involves creating a manager with a set of pre-registered servers, optionally connecting to new servers later, and then enumerating tools or prompts and invoking them as needed. This is especially useful for composing higher-level workflows or integrating MCP-based capabilities into Go applications with ergonomic helper methods for common operations.
You can inspect available tools with ListTools, execute a tool with ExecuteTool, read prompts with ListPrompts, and access resources via ListResources and ReadResource. For streaming or gateway scenarios, you can initialize the mcpgateway to expose all managed assets through a single HTTP endpoint, simplifying consumer integration and enabling features like namespace strategies and notification hooks when using the gateway.
How to install
Prerequisites:
- Go toolchain (go) installed and configured.
- Internet access to fetch dependencies.
Installation steps:
-
Install the MCP client manager and gateway packages: go get github.com/vikashloomba/mcp-client-manager-go/pkg/mcpmgr go get github.com/vikashloomba/mcp-client-manager-go/pkg/mcp-gateway
-
Build or run your Go application that uses the mcpmgr and, optionally, mcpgateway as dependencies. For example, you can create a small app that wires up a manager with stdio or HTTP transports and then initializes the gateway if you need a single Streamable HTTP endpoint.
-
If you intend to run the gateway sample from the repository, navigate to the cmd or example directory and build the runnable sample: go build -o gateway-example ./cmd/gateway-example ./gateway-example
Notes:
- The stdio transport typically uses a command like npx with a server package, while HTTP transports connect to a remote MCP endpoint.
- Ensure the commands and endpoints you provide are accessible from the environment where your Go application runs.
Additional notes
Tips and considerations:
- When exposing server configurations via APIs or DTOs, avoid marshaling function fields or runtime-only data in BaseServerConfig; construct JSON-safe representations instead.
- Use the gateway to aggregate multiple MCP sources behind a single endpoint for simpler client onboarding.
- If you dynamically add servers after initialization, make sure to handle cancellation and proper cleanup with manager.DisconnectAllServers(ctx) before exiting.
- Review TransportOf(s.Config) and helper accessors (AsStdio, AsHTTP) to safely extract settings like Command, Args, Endpoint, and Timeout for runtime decisions.
- Environment variables for transports (e.g., PATH or specific tool configurations) should be defined in the Env field of the respective server config when applicable.
Related MCP Servers
mcp-proxy
An MCP proxy server that aggregates and serves multiple MCP resource servers through a single HTTP server.
mcp-probe
A Model Context Protocol (MCP) client library and debugging toolkit in Rust. This foundation provides both a production-ready SDK for building MCP integrations and the core architecture for an interactive debugger.
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
awesome s
A curated list of excellent Model Context Protocol (MCP) servers.
mcp -python-template
This template provides a streamlined foundation for building Model Context Protocol (MCP) servers in Python. It's designed to make AI-assisted development of MCP tools easier and more efficient.