Go-MCP is a powerful Go(Golang) version of the MCP SDK that implements the Model Context Protocol (MCP) to facilitate seamless communication between external sy
Go-MCP is a powerful Go(Golang) version of the MCP SDK that implements the Model Context Protocol (MCP) to facilitate seamless communication between external sy
Go-MCP
简体中文 | 繁體中文 | Tiếng Việt
Overview
Go-MCP is a powerful Go version of the MCP SDK that implements the Model Context Protocol (MCP) to facilitate seamless communication between external systems and AI applications. Based on the strong typing and performance advantages of the Go language, it provides a concise and idiomatic API to facilitate your integration of external systems into AI applications.
✨ Key Features
Complete Protocol Implementation: Full implementation of the MCP specification, ensuring seamless integration with all compatible services
️ Elegant Architecture Design: Adopts a clear three-layer architecture, supports bidirectional communication, ensuring code modularity and extensibility
Seamless Integration with Web Frameworks: Provides MCP protocol-compliant http.Handler, allowing developers to integrate MCP into their service frameworks
️ Type Safety: Leverages Go's strong type system for clear, highly maintainable code
Go-MCP adopts an elegant three-layer architecture:
Transport Layer: Handles underlying communication implementation, supporting multiple transport protocols
Protocol Layer: Handles MCP protocol encoding/decoding and data structure definitions
User Layer: Provides friendly client and server APIs
Currently supported transport methods:
HTTP SSE/POST: HTTP-based server push and client requests, suitable for web scenarios
Streamable HTTP: Supports HTTP POST/GET requests with both stateless and stateful modes, where stateful mode utilizes SSE for multi-message streaming to enable server-to-client notifications and requests
Stdio: Standard input/output stream-based, suitable for local inter-process communication
The transport layer uses a unified interface abstraction, making it simple to add new transport methods (like Streamable HTTP, WebSocket, gRPC) without affecting upper-layer code.
Contributing
We welcome all forms of contributions! Please see CONTRIBUTING.md for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.