Back to Home
voocel icon

mcp-sdk-go

Verified Safe

by voocel

Overview

A Go SDK for building applications that communicate with large language models and external tools via the Model Context Protocol (MCP), supporting both client and server implementations.

Installation

Run Command
go run examples/basic/main.go

Security Notes

The SDK generally demonstrates good security practices, especially with its robust middleware system for logging, recovery, timeouts, rate limiting, and authentication. Input validation for tool arguments is enforced via JSON Schema inference, significantly reducing injection risks. The Streamable HTTP transport (the latest recommended HTTP transport) correctly implements maximum body size limits and provides an opt-in mechanism for origin validation to prevent DNS rebinding attacks. However, there are some notable areas for improvement: 1) The SSE transport (marked as backward compatible/older) reads entire request bodies without size limits, which could expose servers to Denial-of-Service attacks via large payloads. 2) The unofficial WebSocket transport explicitly disables origin checks (`CheckOrigin: func(r *http.Request) bool { return true }`), introducing a significant CSRF risk if used without custom origin validation. 3) Origin validation for the Streamable HTTP transport is opt-in and not enabled by default, requiring explicit configuration by the developer for full protection.

Similar Servers

Stats

Interest Score37
Security Score8
Cost ClassMedium
Avg Tokens1000
Stars11
Forks1
Last Update2026-01-18

Tags

GoSDKLLMProtocolClient-Server