MCP4Go
A comprehensive Go SDK for the Model Context Protocol (MCP) - simplifying AI application development by abstracting away protocol complexities.
Overview
MCP4Go is a comprehensive Go SDK for the Model Context Protocol (MCP), designed to simplify AI application development by abstracting away protocol complexities.
To use MCP4Go, install it using Go modules with the command: go get github.com/mcp4go/mcp4go. Then, you can integrate it into your Go applications to leverage the MCP functionalities.
- Complete MCP protocol implementation in pure Go - High-level abstractions for common MCP resources - Pluggable architecture for custom extensions - Comprehensive documentation and examples - Production-ready with robust error handling
- Developing AI applications that require context management.
- Implementing JSON-RPC communication in Go applications.
- Creating custom tools and extensions for the Model Context Protocol.
Add to your AI client
Use these steps to connect MCP4Go in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mcp4go-mcp4go": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp4go-mcp4go"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mcp4go-mcp4go": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp4go-mcp4go"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mcp4go-mcp4go": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp4go-mcp4go"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mcp4go-mcp4go": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp4go-mcp4go"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp4go-mcp4go": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp4go-mcp4go"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mcp4go-mcp4go": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mcp4go-mcp4go"
]
}
}
}FAQ
What is the minimum Go version required?
MCP4Go requires Go 1.18 or later.
Is MCP4Go open source?
Yes! MCP4Go is licensed under the MIT License and contributions are welcome.
Where can I find the documentation?
Comprehensive documentation is available on the project's GitHub page.