go-sdk/internal/docs
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Anton Dziatkovskii 71dfbc0d3e
docs: quick start go get leaves the module unbuildable (#1148)
### What was broken

`docs/quick_start.md` → *Installation* says:

```
go get github.com/modelcontextprotocol/go-sdk
```

The module root holds no importable package (only `copyright_test.go`),
so `go get` on the
module path records the requirement as `// indirect` and writes none of
the `go.sum` entries
the `mcp` package needs. A reader who runs that command and then pastes
the server snippet
from the next section hits six errors on the first build — before
writing a line of their own.

### How I checked

Followed the page verbatim on Go 1.26.4, in an empty directory:

```
$ go mod init example.com/qs
$ go get github.com/modelcontextprotocol/go-sdk
go: added github.com/modelcontextprotocol/go-sdk v1.7.0
```

`go.mod` now reads `require github.com/modelcontextprotocol/go-sdk
v1.7.0 // indirect`.
Then the two snippets from *Getting started*, saved as `server/main.go`
and `client/main.go`:

```
$ go build ./...
missing go.sum entry for module providing package github.com/google/jsonschema-go/jsonschema (imported by github.com/modelcontextprotocol/go-sdk/mcp)
missing go.sum entry for module providing package golang.org/x/oauth2 (imported by github.com/modelcontextprotocol/go-sdk/mcp)
missing go.sum entry for module providing package github.com/segmentio/encoding/json (imported by github.com/modelcontextprotocol/go-sdk/internal/json)
missing go.sum entry for module providing package github.com/yosida95/uritemplate/v3 (imported by github.com/modelcontextprotocol/go-sdk/mcp)
missing go.sum entry for module providing package golang.org/x/sync/errgroup (imported by github.com/modelcontextprotocol/go-sdk/mcp)
missing go.sum entry for module providing package golang.org/x/time/rate (imported by github.com/modelcontextprotocol/go-sdk/mcp)
```

Same directory, same snippets, asking for the package instead:

```
$ go get github.com/modelcontextprotocol/go-sdk/mcp
$ go build -o myserver ./server && go build -o myclient ./client
$ ./myclient
{"greeting":"Hi you"}
```

`go mod tidy` after the fact fixes it too — that is the escape hatch the
note mentions,
but it is not what the page tells you to do.

### What it is now

```
go get github.com/modelcontextprotocol/go-sdk/mcp
```

plus four lines saying why the module path alone is not enough, so the
next person who
copies the module path from `go.mod` or from a search result knows what
they are looking at.

Change is in `internal/docs/quick_start.src.md`; `docs/quick_start.md`
regenerated with
`go generate ./internal/docs`, both committed together. Docs-only, no
code paths touched.

---
Assisted-by: Claude Opus 5 — this PR was drafted and verified by Anton's
AI cofounder running
on his account; every command and output above is from a real run on
this machine, not a
reconstruction.

---------

Co-authored-by: Palo-Alto-AI-Research-Lab <Palo-Alto-AI-Research-Lab@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 16:27:46 +02:00
..
client.src.md docs: update docs (#1089) 2026-07-16 11:11:22 +02:00
doc.go Add documentation backed by mkdocs (#883) 2026-04-09 14:25:43 +02:00
mcpgodebug.src.md mcp: return json-rpc error on stateful server serving protocolVersion20260728 requests (#1143) 2026-08-05 12:16:39 +02:00
protocol.src.md docs: fix the streamable client snippet to use (*Client).Connect (#1142) 2026-08-04 14:39:05 +02:00
quick_start.src.md docs: quick start go get leaves the module unbuildable (#1148) 2026-08-06 16:27:46 +02:00
README.src.md Add documentation backed by mkdocs (#883) 2026-04-09 14:25:43 +02:00
rough_edges.src.md fix: do not omitempty ReadOnlyHint in ToolAnnotations (#908) 2026-05-25 15:52:15 +02:00
server.src.md docs: update docs (#1089) 2026-07-16 11:11:22 +02:00
troubleshooting.src.md docs: add feature and troubleshooting documentation (#463) 2025-09-16 11:13:40 -04:00

Overview

The SDK consists of several importable packages:

These docs mirror the official MCP spec. Use the index below to learn how the SDK implements a particular aspect of the protocol.

Base Protocol

  1. Lifecycle (Clients, Servers, and Sessions).
  2. Transports
    1. Stdio transport
    2. Streamable transport
    3. Custom transports
  3. Authorization
  4. Security
  5. Utilities
    1. Cancellation
    2. Ping
    3. Progress

Client Features

  1. Roots
  2. Sampling
  3. Elicitation

Server Features

  1. Prompts
  2. Resources
  3. Tools
  4. Utilities
    1. Completion
    2. Logging
    3. Pagination

TroubleShooting

See troubleshooting.md for a troubleshooting guide.

Backwards compatibility

See mcpgodebug.md for a list of backwards incompatible behavior changes and description how they can be temporarily undone.

Rough edges

See rough_edges.md for a list of rough edges or API oversights that can't be addressed due to our compatibility promise. We'll revisit these if/when we move to a v2 of the SDK.