๐ฆ mcp-client-go
mcp-client-go is a Golang client library for the Model Context Protocol (MCP). It allows developers to register
and interact with various MCP-based services such as Amap (Gaode Maps) using a unified API.
โจ Features
- Easy integration with MCP-compatible services
- Modular support for service types (e.g., Amap, Github, GoogleMap)
- Unified registration and client management
- Simple and intuitive tool execution interface
- Support claude like config file to set mcp server demo
- Provide prompt to trigger mcp request doc
๐ Supported Services
๐ Getting Started
Install
install npx, uvx, docker, and put them to env!
go get github.com/yincongcyincong/mcp-client-go
๐งช Example
client demo app demo deepseek demo openai demo project
๐งฑ API Overview
Initialize Clients
conf := clients.InitStdioMCPClient("npx-amap-maps-mcp-server", "npx", []string{
"AMAP_MAPS_API_KEY=" + AmapApiKey,
}, []string{
"-y",
"@amap/amap-maps-mcp-server",
})
/
conf := clients.InitSSEMCPClient("npx-amap-maps-mcp-server", "http://127.0.0.1")
/
conf := clients.InitHttpMCPClient("npx-amap-maps-mcp-server", "http://127.0.0.1")
Register MCP Clients
clients.RegisterMCPClient(context.Background(), []*param.MCPClientConf{conf})
Get MCP Client
client, err := clients.GetMCPClient("npx-amap-maps-mcp-server")
/
client, err := clients.GetMCPClientByToolName("geo_location")
Execute Tools
client.ExecTools(ctx, "tool_name", map[string]interface{}{...})
๐ License
This project is licensed under the MIT License.