Add a framework for feature documentation, and start populating it with our SDK documentation. This framework is as follows: - internal/docs/**.src.md is the markdown source for the docs/ directory. - The x/example/internal/cmd/weave tool is used to compile these docs to the top-level docs, supporting both linked code samples and generated tables of contents. - The readme-check workflow is updated to check these docs as well. - The structure of these docs follows the MCP spec. - Wherever possible, example code is linked from actual Go documentation examples, so that it is testable. Some minor modifications to the weave tool were made to support this framework. Additionally, partially fill out this documentation with content on base protocol and client features, as well as troubleshooting help. Along the way, a bug was encountered that our LoggingTransport was not concurrency safe. This is fixed with a mutex. Fixes https://github.com/modelcontextprotocol/go-sdk/issues/466 Fixes https://github.com/modelcontextprotocol/go-sdk/issues/409 Updates https://github.com/modelcontextprotocol/go-sdk/issues/442
15 lines
712 B
Go
15 lines
712 B
Go
// Copyright 2025 The Go MCP SDK Authors. All rights reserved.
|
|
// Use of this source code is governed by an MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:generate -command weave go run golang.org/x/example/internal/cmd/weave@latest
|
|
//go:generate weave -o ../../docs/README.md ./README.src.md
|
|
//go:generate weave -o ../../docs/protocol.md ./protocol.src.md
|
|
//go:generate weave -o ../../docs/client.md ./client.src.md
|
|
//go:generate weave -o ../../docs/server.md ./server.src.md
|
|
//go:generate weave -o ../../docs/troubleshooting.md ./troubleshooting.src.md
|
|
|
|
// The doc package generates the documentation at /doc, via go:generate.
|
|
//
|
|
// Tests in this package are used for examples.
|
|
package docs
|