MCP Client Go

v1.0.0Developer Toolsstable

mcp client for Go (Golang). Integrate multiple Model Context Protocol (MCP) servers

aideepseekgo-librarygolangmcp
Share:
150
Stars
0
Downloads
0
Weekly
0/5

What is MCP Client Go?

MCP Client Go is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp client for go (golang). integrate multiple model context protocol (mcp) servers

mcp client for Go (Golang). Integrate multiple Model Context Protocol (MCP) servers

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • mcp client for Go (Golang). Integrate multiple Model Context

Use Cases

Integrate multiple MCP servers in Go
Build Golang applications with MCP support
Enable AI-driven development workflows
yincongcyincong

Maintainer

LicenseMIT
Languagego
Versionv1.0.0
UpdatedFeb 7, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-client-go

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP Client Go

mcp-client-go is a Go library that lets Golang applications connect to and orchestrate multiple MCP servers simultaneously, supporting stdio, SSE, and HTTP transports. It ships with pre-built configuration helpers for 50+ popular services including databases (Redis, PostgreSQL, MySQL), cloud platforms (AWS, Aliyun, Cloudflare), developer tools (GitHub, GitLab, Jira), and mapping or finance APIs. Developers use it to embed rich AI tool-use capabilities directly into Go services without managing raw MCP protocol details.

Prerequisites

  • Go 1.21 or later installed
  • npx, uvx, and/or docker installed and available on PATH (required for launching subprocess MCP servers)
  • Service-specific API keys for the MCP servers you integrate (e.g. AMAP_MAPS_API_KEY for Amap maps)
  • An MCP-compatible AI client or agent host (Claude Desktop, a custom Go agent, etc.)
1

Add the library to your Go module

Run go get to pull mcp-client-go into your project's module dependencies.

go get github.com/yincongcyincong/mcp-client-go
2

Choose a transport and build a client config

Use one of the three initialiser helpers — InitStdioMCPClient for subprocess-based servers launched with npx/uvx, InitSSEMCPClient for SSE servers, or InitHttpMCPClient for plain HTTP MCP endpoints.

import "github.com/yincongcyincong/mcp-client-go/clients"
import "github.com/yincongcyincong/mcp-client-go/param"

// Stdio example — launches an npx MCP server as a subprocess
conf := clients.InitStdioMCPClient(
    "amap-maps",
    "npx",
    []string{"AMAP_MAPS_API_KEY=YOUR_KEY_HERE"},
    []string{"-y", "@amap/amap-maps-mcp-server"},
)

// SSE example
confSSE := clients.InitSSEMCPClient("my-sse-server", "http://127.0.0.1:8080")

// HTTP example
confHTTP := clients.InitHttpMCPClient("my-http-server", "http://127.0.0.1:8080")
3

Register one or more MCP clients

Pass a slice of configs to RegisterMCPClient. The library starts all subprocesses and negotiates capabilities in the background.

ctx := context.Background()
clients.RegisterMCPClient(ctx, []*param.MCPClientConf{conf, confSSE})
4

Retrieve a client and execute a tool

Fetch the registered client by name and call ExecTools with the tool name and a map of parameters.

client, err := clients.GetMCPClient("amap-maps")
if err != nil {
    log.Fatal(err)
}
result, err := client.ExecTools(ctx, "maps_direction_driving", map[string]interface{}{
    "origin":      "116.481028,39.989643",
    "destination": "116.434446,39.90816",
})
5

Configure MCP clients via a Claude-style config file

Optionally load server definitions from a claude_desktop_config.json-compatible file so your app shares config with the Claude Desktop client.

// Load config from file
clients.LoadConfigFromFile("claude_desktop_config.json")

MCP Client Go Examples

Go integration example

A minimal Go snippet that registers the GitHub MCP server and lists repositories for a user.

package main

import (
    "context"
    "fmt"
    "github.com/yincongcyincong/mcp-client-go/clients"
    "github.com/yincongcyincong/mcp-client-go/param"
)

func main() {
    ctx := context.Background()
    conf := clients.InitStdioMCPClient(
        "github",
        "npx",
        []string{"GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxxx"},
        []string{"-y", "@modelcontextprotocol/server-github"},
    )
    clients.RegisterMCPClient(ctx, []*param.MCPClientConf{conf})
    c, _ := clients.GetMCPClient("github")
    res, _ := c.ExecTools(ctx, "list_repositories", map[string]interface{}{"username": "octocat"})
    fmt.Println(res)
}

Prompts to try

Once embedded in a Go-backed AI agent, these are typical natural-language requests the integrated tools can fulfil.

- "List all open pull requests in the myorg/myrepo GitHub repository"
- "Get driving directions from Tiananmen Square to the Beijing Capital Airport"
- "Fetch the latest price of BTC/USDT from Binance"
- "Query all users from the PostgreSQL database where role = 'admin'"

Troubleshooting MCP Client Go

RegisterMCPClient returns an error that npx is not found

Ensure Node.js (which bundles npx) is installed and that the npx binary is on the PATH available to your Go process. On macOS you may need to set the full PATH in the env slice passed to InitStdioMCPClient.

ExecTools times out with no response

Stdio MCP servers can be slow to start on first invocation while npx downloads the package. Increase the client timeout or pre-warm the server by calling ExecTools with a lightweight tool (e.g. a list_tools equivalent) at startup.

API key errors from a service-specific MCP server

Pass the environment variable in the env slice of InitStdioMCPClient, e.g. []string{"AMAP_MAPS_API_KEY=yourkey"}. Environment variables set in the parent process are not automatically inherited by subprocess MCP servers in all cases.

Frequently Asked Questions about MCP Client Go

What is MCP Client Go?

MCP Client Go is a Model Context Protocol (MCP) server that mcp client for go (golang). integrate multiple model context protocol (mcp) servers It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP Client Go?

Follow the installation instructions on the MCP Client Go GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP Client Go?

MCP Client Go works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP Client Go free to use?

Yes, MCP Client Go is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-client-go": { "command": "npx", "args": ["-y", "mcp-client-go"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP Client Go?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides