go-sdk  by modelcontextprotocol

Go SDK for Model Context Protocol (MCP)

Created 4 months ago
2,088 stars

Top 21.4% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This Go SDK provides an implementation for the Model Context Protocol (MCP), enabling Go developers to build clients and servers that communicate using this protocol. It targets developers creating distributed AI systems or integrating with existing MCP-based services, offering a structured way to define and interact with AI tools.

How It Works

The SDK is built around two core packages: mcp for client/server interactions and jsonschema for defining tool schemas. It facilitates communication over various transports, including standard input/output (stdin/stdout) via CommandTransport for sidecar processes, and potentially others. The design emphasizes clear API definitions for constructing clients and servers, registering tools with defined inputs and outputs, and managing the communication lifecycle.

Quick Start & Requirements

  • Install: go get github.com/modelcontextprotocol/go-sdk
  • Prerequisites: Go toolchain.
  • Examples: Located in the examples/ directory.
  • Documentation: Package documentation is available via Go's standard tooling.

Highlighted Details

  • Implements the official Model Context Protocol for Go.
  • Supports defining MCP clients and servers with tools.
  • Includes a JSON Schema implementation for tool input/output validation.
  • Provides example code for client-server communication over stdin/stdout.

Maintenance & Community

The project acknowledges inspiration from existing Go MCP SDKs like mcp-go, mcp-golang, and go-mcp. Further design discussions are encouraged in issues and discussions.

Licensing & Compatibility

Licensed under the MIT License, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

The SDK is explicitly marked as unreleased, unstable, and subject to breaking changes. A stable release is targeted for August 2025. Users are advised not to use it in production environments and to report bugs or API proposals via the issue tracker.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
116
Issues (30d)
76
Star History
424 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.