Skip to content

docs: quick start go get leaves the module unbuildable - #1148

Merged
guglielmo-san merged 2 commits into
modelcontextprotocol:mainfrom
tonydzi:docs-quickstart-go-get
Aug 6, 2026
Merged

docs: quick start go get leaves the module unbuildable#1148
guglielmo-san merged 2 commits into
modelcontextprotocol:mainfrom
tonydzi:docs-quickstart-go-get

Conversation

@tonydzi

@tonydzi tonydzi commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What was broken

docs/quick_start.mdInstallation 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.

The Installation step asks for the module path, which has no importable
package at its root. `go get` then records the requirement as indirect
and writes none of the go.sum entries the `mcp` package needs, so the
first `go build` after pasting the server snippet fails.

Ask for the package path instead, and say why.

Assisted-by: Claude Opus 5
Comment thread internal/docs/quick_start.src.md Outdated
Comment on lines +11 to +15
The module root holds no importable package, so `go get` on the module path
alone records the requirement without the `go.sum` entries the `mcp` package
needs, and the first `go build` fails. Ask for the package instead, as above
(or run `go mod tidy` after writing the code below).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove this comment

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tonydzi

tonydzi commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Done — dropped the paragraph, the PR is now just the one-line go get fix in both the source and the generated doc. Thanks for the quick look.

@guglielmo-san
guglielmo-san merged commit 71dfbc0 into modelcontextprotocol:main Aug 6, 2026
10 checks passed
@guglielmo-san

Copy link
Copy Markdown
Contributor

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants