{"record":{"id":"b9adc22aab6c7c05","repo":"googleapis/mcp-toolbox","slug":"meta-error-header-mismatch-mcp-protocol-version","errorCode":null,"errorMessage":"_meta error: header mismatch: MCP-Protocol-Version header value '%s' does not match body value '%s'","messagePattern":"_meta error: header mismatch: MCP-Protocol-Version header value '(.+?)' does not match body value '(.+?)'","errorType":"error_code","errorClass":"NewHeaderMismatchedError","httpStatus":null,"severity":"error","filePath":"internal/server/mcp/v20260728/method.go","lineNumber":75,"sourceCode":"\t\treturn jsonrpc.NewError(id, jsonrpc.METHOD_NOT_FOUND, err.Error(), nil), err\n\t}\n}\n\n// validateMetadata checks the metadata of every requests\nfunc validateMetadata(id jsonrpc.RequestId, params RequestParams, stdio bool) (any, error) {\n\t// Check _meta field for protocol version\n\tif params.Meta != nil {\n\t\t// check for protocol version metadata\n\t\tv := params.Meta.ProtocolVersion\n\t\tif v == \"\" {\n\t\t\tmetaErr := fmt.Errorf(\"_meta error: missing io.modelcontextprotocol/protocolVersion\")\n\t\t\treturn jsonrpc.NewError(id, jsonrpc.INVALID_PARAMS, metaErr.Error(), nil), metaErr\n\t\t}\n\t\t// do not have to verify header for stdio; already verified during stdio\n\t\t// message processing\n\t\tif !stdio {\n\t\t\tif PROTOCOL_VERSION != v {\n\t\t\t\tmetaErr := fmt.Errorf(\"_meta error: header mismatch: MCP-Protocol-Version header value '%s' does not match body value '%s'\", PROTOCOL_VERSION, v)\n\t\t\t\treturn jsonrpc.NewHeaderMismatchedError(id, metaErr), metaErr\n\t\t\t}\n\t\t}\n\n\t\t// check for clientInfo\n\t\tclientInfo := params.Meta.ClientInfo\n\t\tif clientInfo.Version == \"\" || clientInfo.Name == \"\" {\n\t\t\tmetaErr := fmt.Errorf(\"_meta error: missing field from io.modelcontextprotocol/clientInfo\")\n\t\t\treturn jsonrpc.NewError(id, jsonrpc.INVALID_PARAMS, metaErr.Error(), nil), metaErr\n\t\t}\n\t\t// check for clientCapabilities\n\t\tclientCapabilities := params.Meta.MetaClientCapabilities\n\t\tif clientCapabilities == nil {\n\t\t\tmetaErr := fmt.Errorf(\"_meta error: missing field from io.modelcontextprotocol/clientCapabilities\")\n\t\t\treturn jsonrpc.NewError(id, jsonrpc.INVALID_PARAMS, metaErr.Error(), nil), metaErr\n\t\t}\n\t\t// skip checking clientCapabilities since Toolbox do not utilize any of those\n\t} else {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/server/mcp/v20260728/method.go#L57-L93","documentation":"Error \"_meta error: header mismatch: MCP-Protocol-Version header value '%s' does not match body value '%s'\" thrown in googleapis/mcp-toolbox.","triggerScenarios":"Thrown at internal/server/mcp/v20260728/method.go:75 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}