Skip to content

ClientSession.Ping omits the SEP-2575 per-request _meta envelope #1249

Closed

Description

@jegork

Version: go-sdk v1.7.0

Every ClientSession request method wraps its params with injectRequestMeta (protocol version, client info, client capabilities) when the session negotiated protocol 2026-07-28, except ClientSession.Ping, which sends the params as given:

func (cs *ClientSession) Ping(ctx context.Context, params *PingParams) error {
	_, err := handleSend[*emptyResult](ctx, methodPing, newClientRequest(cs, orZero[Params](params)))
	return err
}

Servers that enforce the envelope on the new protocol reject the ping. Observed against Notion's hosted MCP server (https://mcp.notion.com/mcp):

Invalid params: the MCP-Protocol-Version header names protocol revision 2026-07-28, but the request is missing the required per-request envelope key(s): _meta: Bad Request

The go-sdk server itself also rejects such a ping once _meta carries a protocol version without clientCapabilities (missing or invalid _meta field "io.modelcontextprotocol/clientCapabilities"), so a caller cannot fully work around it without reconstructing the private clientCapabilitiesV2 shape.

Expected: Ping injects the same envelope as the other client methods when usesNewProtocol() is true.

Workaround used: pass PingParams with _meta set to protocol version, client info, and an explicitly empty ClientCapabilities configured on the client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions