Go SDK
A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
What is Go SDK?
Go SDK is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to go implementation of the model context protocol (mcp), enabling seamless integration between llm applications and external data sources and tools.
A Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Go implementation of the Model Context Protocol (MCP), ena
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-goConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Go SDK
mcp-go is a Go library that implements the Model Context Protocol specification, providing idiomatic Go APIs for building MCP servers with tools, resources, and prompts. It supports all three MCP transport modes — stdio, SSE, and streamable HTTP — and follows the MCP 2025-11-25 specification with backward compatibility for earlier versions. Go developers use mcp-go to build custom MCP servers that expose internal data sources, company APIs, or system tools to AI assistants like Claude, without needing to handle protocol framing, session management, or serialization manually.
Prerequisites
- Go 1.21 or newer installed (https://go.dev/dl/)
- An MCP client to test against, such as Claude Desktop or the MCP Inspector
- Basic familiarity with Go module system and package management
- go get access to github.com/mark3labs/mcp-go
Initialize a new Go module
Create a new directory for your MCP server and initialize a Go module.
mkdir my-mcp-server && cd my-mcp-server
go mod init github.com/yourname/my-mcp-serverInstall mcp-go
Add the mcp-go library as a dependency to your Go module.
go get github.com/mark3labs/mcp-goCreate a basic server with a tool
Write a main.go that creates an MCP server, defines a tool with input parameters, registers a handler, and serves over stdio.
package main
import (
"context"
"log"
"github.com/mark3labs/mcp-go/mcp"
"github.com/mark3labs/mcp-go/server"
)
func main() {
s := server.NewMCPServer("My Server", "1.0.0")
tool := mcp.NewTool("greet",
mcp.WithDescription("Greet a user by name"),
mcp.WithString("name", mcp.Required(), mcp.Description("The name to greet")),
)
s.AddTool(tool, func(ctx context.Context, req mcp.CallToolRequest) (*mcp.CallToolResult, error) {
name, _ := req.RequireString("name")
return mcp.NewToolResultText("Hello, " + name + "!"), nil
})
if err := server.ServeStdio(s); err != nil {
log.Fatalf("Server error: %v", err)
}
}Build and test the server
Build the binary and verify it starts correctly. When run via stdio, the server waits for MCP protocol messages on stdin.
go build -o my-mcp-server .
./my-mcp-serverRegister the server with your MCP client
Add your compiled server binary to your MCP client configuration. Point the command to the absolute path of your built binary.
{
"mcpServers": {
"my-server": {
"command": "/absolute/path/to/my-mcp-server"
}
}
}Go SDK Examples
Client configuration
Example Claude Desktop configuration for a mcp-go server binary compiled to stdio transport.
{
"mcpServers": {
"my-go-server": {
"command": "/usr/local/bin/my-mcp-server",
"args": []
}
}
}Prompts to try
Once you've built an MCP server with mcp-go and registered it, these prompt patterns demonstrate interaction with your custom tools.
- "Use the greet tool to say hello to 'Alice'"
- "Call my-server's calculate tool with operation='add', x=10, y=25"
- "List all available tools from my-go-server and explain what each one does"
- "Use the query_database tool to fetch all records where status='active'"
- "Run the generate_report resource and summarize the output"Troubleshooting Go SDK
MCP client shows 'server exited' immediately after starting
Run the binary directly in your terminal to see the error output. Common causes are panics on startup (use server.WithRecovery() to catch panics) or missing permissions on the binary (run 'chmod +x ./my-mcp-server'). The server must listen on stdio and not print anything to stdout before receiving the first MCP message.
go get fails with module fetch errors
Ensure you have a working Go installation (go version >= 1.21) and internet access to proxy.golang.org. If behind a corporate proxy, set GOPROXY=direct or configure your proxy settings. Run 'go env GOPROXY' to check your current proxy configuration.
Tool handler receives incorrect parameter types
Use req.RequireString(), req.RequireFloat(), or req.RequireBool() to extract parameters — these return typed values with error handling. Avoid using req.Params directly as it returns interface{}. Define parameter types explicitly in mcp.NewTool() using mcp.WithString(), mcp.WithNumber(), etc.
Frequently Asked Questions about Go SDK
What is Go SDK?
Go SDK is a Model Context Protocol (MCP) server that go implementation of the model context protocol (mcp), enabling seamless integration between llm applications and external data sources and tools. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Go SDK?
Follow the installation instructions on the Go SDK GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Go SDK?
Go SDK works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Go SDK free to use?
Yes, Go SDK is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Go SDK Alternatives — Similar Developer Tools Servers
Looking for alternatives to Go SDK? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up Go SDK in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Go SDK?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.