whatisgithub

What is go-sdk?

modelcontextprotocol/go-sdk — explained in plain English

Analysis updated 2026-06-26

4,524GoAudience · developerComplexity · 3/5Setup · moderate

In one sentence

The official Go SDK for the Model Context Protocol, letting you build servers that AI assistants can call into as tools, and clients that connect to those servers, all using the Go programming language.

Mindmap

mindmap
  root((go-sdk))
    What it does
      MCP server building
      MCP client building
      AI tool integration
    Tech Stack
      Go
      JSON-RPC
      OAuth
    Use Cases
      AI tool servers
      AI client apps
      Database connectors
    Packages
      mcp package
      jsonrpc package
      auth package
      examples directory
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a Go server that exposes database search as a tool for AI assistants like Claude to call

USE CASE 2

Create a Go client that connects to an MCP server, lists available tools, and calls them with typed arguments

USE CASE 3

Add file system access or external API calls as MCP tools that any compatible AI assistant can invoke

What is it built with?

GoJSON-RPCOAuth

How does it compare?

modelcontextprotocol/go-sdkmosn/mosngoravel/goravel
Stars4,5244,5244,521
LanguageGoGoGo
Setup difficultymoderatehardmoderate
Complexity3/55/53/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Go installed and familiarity with the Model Context Protocol specification concepts.

No licence information was provided in the explanation.

So what is it?

The Model Context Protocol (MCP) is a standard that lets AI assistants connect to external tools, data sources, and services in a structured way. This repository is the official Go SDK for building that kind of integration using the Go programming language. It is maintained in collaboration with Google. If you are building a server that an AI assistant can call into, such as a tool that searches a database, reads files, or calls an API, this SDK gives you the building blocks to do that in Go. You define your tools as Go functions, register them with an MCP server, and the SDK handles the communication layer that lets AI clients discover and call those tools. The same SDK covers the client side too. If you are building something that needs to call out to an MCP server, you can use the client package to connect to one, list what tools are available, and invoke them by name with typed arguments. The SDK supports all versions of the MCP specification going back to late 2024, with the most recent SDK versions also covering a newer 2025 revision of the spec. OAuth support for authenticated connections is present, with some parts still marked as experimental. Structurally the code is split into several packages. The main mcp package covers servers and clients. A jsonrpc package handles lower-level transport concerns. Auth and oauthex packages support authenticated connections. The repository also includes an examples directory with working client and server code. The project acknowledges several earlier community-built Go MCP libraries that were published before this official SDK existed, including mcp-go, mcp-golang, and go-mcp, and notes they remain viable alternatives.

Copy-paste prompts

Prompt 1
Help me build an MCP server in Go using the go-sdk that exposes a function to search a PostgreSQL database
Prompt 2
Show me how to create a Go MCP client that connects to a server, lists its tools, and calls one with arguments
Prompt 3
How do I register multiple tools in a single MCP server using the Go SDK and handle their inputs and outputs?
Prompt 4
Help me add OAuth authentication to my MCP server built with the modelcontextprotocol go-sdk

Frequently asked questions

What is go-sdk?

The official Go SDK for the Model Context Protocol, letting you build servers that AI assistants can call into as tools, and clients that connect to those servers, all using the Go programming language.

What language is go-sdk written in?

Mainly Go. The stack also includes Go, JSON-RPC, OAuth.

What license does go-sdk use?

No licence information was provided in the explanation.

How hard is go-sdk to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is go-sdk for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.