go-sdk/internal/readme
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Rob Findley 9453d6bf6c internal/mcp: rename NewXXX->NewServerXXX
The NewTool and NewPrompt constructors were unidiomatic, because they
returned a ServerTool and ServerPrompt, respectively, rather than a Tool
and Prompt. Rename to be consistent with the constructed object name.

Change-Id: Ife3f16f783368401f792660c4272e1bb5ae61638
Reviewed-on: https://go-review.googlesource.com/c/tools/+/682375
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2025-06-17 17:54:58 -07:00
..
client internal/mcp: reorganize the tool API, keeping generics 2025-06-10 04:57:48 -07:00
server internal/mcp: rename NewXXX->NewServerXXX 2025-06-17 17:54:58 -07:00
build.sh internal/mcp: construct README with weave 2025-05-21 16:21:26 -07:00
Makefile internal/mcp: construct README with weave 2025-05-21 16:21:26 -07:00
README.src.md internal/mcp: construct README with weave 2025-05-21 16:21:26 -07:00

MCP SDK prototype

PkgGoDev

Contents

%toc

The mcp package provides a software development kit (SDK) for writing clients and servers of the model context protocol. It is unstable, and will change in breaking ways in the future. As of writing, it is a prototype to explore the design space of client/server transport and binding.

Installation

The mcp package is currently internal and cannot be imported using go get.

Quickstart

Here's an example that creates a client that talks to an MCP server running as a sidecar process:

%include client/client.go -

Here is an example of the corresponding server, connected over stdin/stdout:

%include server/server.go -

Design

See design.md for the SDK design. That document is canonical: given any divergence between the design doc and this prototype, the doc reflects the latest design.

Testing

To test your client or server using stdio transport, you can use an in-memory transport. See example.

To test your client or server using sse transport, you can use the httptest package. See example.

Code of Conduct

This project follows the Go Community Code of Conduct. If you encounter a conduct-related issue, please mail conduct@golang.org.

License

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Upon a potential move to the modelcontextprotocol organization, the license will be updated to the MIT License, and the license header will reflect the Go MCP SDK Authors.