The official Go SDK for Model Context Protocol servers and clients. Maintained in collaboration with Google.
by modelcontextprotocolGo
Last 12 weeks · 73 commits
5 of 6 standards met
It would be useful to have a client example for connecting to a streamable http MCP server. A few items that would be great to include: TLS Auth / Custom Headers Middelware While my basic usage may be wrong, I couldn't find a way to perform even a basic operation using without adding a RoundTripper to add . This seems like something the client should handle, so perhaps I'm using the package wrong (thus the thought that examples may help). Here is my current (presumably incorrect) usage, which required the roundtripper to make any calls:
Repository: modelcontextprotocol/go-sdk. Description: The official Go SDK for Model Context Protocol servers and clients. Maintained in collaboration with Google. Stars: 4024, Forks: 368. Primary language: Go. Languages: Go (99.5%), Shell (0.5%). Latest release: v1.4.0 (6d ago). Open PRs: 13, open issues: 32. Last activity: 8h ago. Community health: 87%. Top contributors: findleyr, jba, samthanawalla, maciej-kisiel, dependabot[bot], cryo-zd, IAmSurajBobade, rwjblue-glean, CocaineCong, h9jiang and others.
Describe the bug When you call a tool with an argument field that's not in the input schema, it returns a jsonrpc "error" message instead of a result with so the client LLM can see it. To Reproduce Steps to reproduce the behavior: 1. Call any tool with an invalid argument. 2. Check the result error. It looks something like this: Expected behavior** I expected to see an error something like this:
, : implement Enterprise Managed Authorization (SEP-990) This PR implements Enterprise Managed Authorization (SEP-990) for the Go MCP SDK, enabling MCP Clients and Servers to leverage enterprise Identity Providers for seamless authorization without requiring users to authenticate separately to each MCP Server. Overview Enterprise Managed Authorization follows the Identity Assertion Authorization Grant specification (draft-ietf-oauth-identity-assertion-authz-grant), implementing a three-step flow: 1. Single Sign-On (SSO): User authenticates to the MCP Client via enterprise IdP (Okta, Auth0, Azure AD, etc.) 2. Token Exchange (RFC 8693): Client exchanges ID Token for Identity Assertion JWT Authorization Grant (ID-JAG) at the IdP 3. JWT Bearer Grant (RFC 7523): Client exchanges ID-JAG for Access Token at the MCP Server This enables: For end users: Single sign-on across MCP Clients and Servers—no manual connection/authorization per server For enterprise admins: Centralized visibility and control over which MCP Servers can be used within the organization For MCP clients**: Automatic token acquisition without user interaction for each server Closes: #628
Issue Title MCP Server Multi-Instance Deployment: Session sharing issue across load balancer backend servers Description When deploying MCP server with multiple backend instances behind a load balancer, sessions are not properly shared across different server instances, causing "session not found" errors. Problem Details After scaling the MCP server from a single instance to multiple instances (3 RS - Real Servers), clients experience intermittent "session not found" errors when trying to reuse session IDs obtained from previous requests. Root Cause Analysis Single Instance (Previous): All requests went to the same backend server, so session IDs were valid across the entire session lifecycle Multiple Instances (Current): Load balancer, not use session strick