Go MCP SDK

v1.0.0Developer Toolsstable

Go-MCP is a powerful Go(Golang) version of the MCP SDK that implements the Model Context Protocol (MCP) to facilitate seamless communication between external systems and AI applications.

golangmcpmcp-servermodel-context-protocolai
Share:
670
Stars
0
Downloads
0
Weekly
0/5

What is Go MCP SDK?

Go MCP SDK is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to go-mcp is a powerful go(golang) version of the mcp sdk that implements the model context protocol (mcp) to facilitate seamless communication between external systems and ai applications.

Go-MCP is a powerful Go(Golang) version of the MCP SDK that implements the Model Context Protocol (MCP) to facilitate seamless communication between external systems and AI applications.

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

Features

  • Go-MCP is a powerful Go(Golang) version of the MCP SDK that

Use Cases

Go language implementation of MCP
AI application integration
Go library and CLI tools
ThinkInAIXYZ

Maintainer

LicenseMIT
Languagego
Versionv1.0.0
UpdatedMay 15, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx 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 Go MCP SDK

go-mcp is a Go (Golang) SDK that implements the full Model Context Protocol specification, enabling Go developers to build both MCP servers and clients that integrate seamlessly with AI applications. It supports HTTP SSE/POST, Streamable HTTP, and stdio transports with a clean three-layer architecture spanning transport, protocol, and user layers. Go developers use it to embed MCP tool endpoints directly in existing Go web services (Gin, Echo, etc.) or ship standalone MCP servers as single binary executables.

Prerequisites

  • Go 1.18 or higher installed
  • A Go module initialized in your project (go mod init)
  • An MCP client such as Claude Desktop to test the server
  • Optional: a Go web framework (Gin, Echo, etc.) if embedding in an existing HTTP server
1

Install the go-mcp package

Add go-mcp to your Go module using go get. This downloads the library and adds it to your go.mod.

go get github.com/ThinkInAIXYZ/go-mcp
2

Create a simple MCP server with a tool

Import the library, create an SSE transport server, register your custom tool with RegisterTool, and call Run to start serving.

package main

import (
    "github.com/ThinkInAIXYZ/go-mcp/server"
    "github.com/ThinkInAIXYZ/go-mcp/transport"
)

func main() {
    t, _ := transport.NewSSEServerTransport(":8080")
    s, _ := server.NewServer(t)

    s.RegisterTool("current_time", "Returns the current time in a given timezone",
        func(req map[string]any) (any, error) {
            timezone, _ := req["timezone"].(string)
            // return formatted time for timezone
            return map[string]string{"time": "2025-01-01T12:00:00Z", "timezone": timezone}, nil
        },
        map[string]any{
            "type": "object",
            "properties": map[string]any{
                "timezone": map[string]string{"type": "string", "description": "IANA timezone name"},
            },
            "required": []string{"timezone"},
        },
    )

    s.Run()
}
3

Build and run the server binary

Compile your Go MCP server to a single binary and run it. The binary listens on the configured port or stdio.

go build -o mcp-server .
./mcp-server
4

Configure Claude Desktop to connect via stdio

For a stdio-based Go MCP server, set the command to your compiled binary path in claude_desktop_config.json.

{
  "mcpServers": {
    "go-mcp-server": {
      "command": "/path/to/your/mcp-server"
    }
  }
}
5

Create an MCP client to list and call tools

Use the client package to connect to any running MCP server, list its tools, and invoke them programmatically from Go.

package main

import (
    "fmt"
    "github.com/ThinkInAIXYZ/go-mcp/client"
    "github.com/ThinkInAIXYZ/go-mcp/transport"
)

func main() {
    t, _ := transport.NewSSEClientTransport("http://localhost:8080")
    c, _ := client.NewClient(t)
    tools, _ := c.ListTools()
    fmt.Println(tools)
}

Go MCP SDK Examples

Client configuration

Claude Desktop configuration for a compiled Go MCP server binary using stdio transport.

{
  "mcpServers": {
    "go-mcp": {
      "command": "/usr/local/bin/my-go-mcp-server"
    }
  }
}

Prompts to try

Example prompts after connecting a Go MCP server with registered tools.

- "What is the current time in Tokyo?"
- "List all tools available on this server"
- "Call the current_time tool with timezone America/New_York"
- "What time is it simultaneously in London, New York, and Sydney?"

Troubleshooting Go MCP SDK

Claude Desktop cannot connect to the Go MCP server

Ensure the binary path in the command field is absolute and the binary has execute permissions (chmod +x). For stdio transport, the binary must read from stdin and write to stdout without any other output interfering.

go get fails with version compatibility errors

Confirm your Go installation is 1.18 or higher with go version. If your go.mod specifies an older version, update it: go mod edit -go=1.21.

SSE server returns connection refused when the client tries to connect

Check that the port is not already in use (lsof -i :8080) and that your firewall allows the connection. For Claude Desktop, prefer stdio transport over SSE to avoid network configuration issues.

Frequently Asked Questions about Go MCP SDK

What is Go MCP SDK?

Go MCP SDK is a Model Context Protocol (MCP) server that go-mcp is a powerful go(golang) version of the mcp sdk that implements the model context protocol (mcp) to facilitate seamless communication between external systems and ai applications. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Go MCP SDK?

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

Which AI clients work with Go MCP SDK?

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

Is Go MCP SDK free to use?

Yes, Go MCP SDK 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": { "go": { "command": "npx", "args": ["-y", "go"] } } }

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

Read the full setup guide →

Ready to use Go MCP SDK?

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