mcp-go-sdk
by SetiabudiResearch·★ 7·Score 32
Go SDK for implementing MCP servers with tool execution, resource access, and prompt handling.
Overview
The mcp-go-sdk is a complete implementation of the Model Context Protocol in Go, providing transport layers with multiple communication options including stdio, SSE, and WebSocket. It offers server implementations with reflection-based handler invocation, session management, and support for both synchronous and asynchronous tools. The SDK supports resource pattern matching for flexible data access and prompt template rendering.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this SDK when you need to build MCP servers in Go, especially for Go-centric development teams or when integrating with existing Go infrastructure.
When NOT to choose this
Avoid this if you need a more mature SDK with broader community support or if you're not already invested in the Go ecosystem.
Tools this server exposes
7 tools extracted from the READMEgreetfunc(name string) stringGreet a person by name
myToolfunc(arg1 string, arg2 int) (string, error)Process a string with an integer parameter
longRunningToolfunc(params string) errorExecute an asynchronous long-running operation
filesfunc(path string) ([]byte, error)Access files using path parameter
apifunc(version, endpoint string) (interface{}, error)Access API with version and endpoint parameters
confirmfunc(action string) stringGenerate a confirmation prompt for a given action
chatfunc(context string) []protocol.PromptMessageGenerate a chat prompt for a given context
Comparable tools
Installation
go get github.com/SetiabudiResearch/mcp-go-sdkFor Claude Desktop integration:
{
"mcpServers": {
"mcp-go-example": {
"command": "go",
"args": ["run", "/path/to/your/server.go"]
}
}
}FAQ
- What transport protocols are supported?
- The SDK supports stdio, SSE (Server-Sent Events), and WebSocket transport protocols for different application scenarios.
- Can I create async tools with this SDK?
- Yes, the SDK supports both synchronous tools via AddTool() and asynchronous tools via AddAsyncTool().
Compare mcp-go-sdk with
Last updated · Auto-generated from public README + GitHub signals.