You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'Content-Type must be 'application/json' - when setting charset #2333
I'm using the https://github.com/modelcontextprotocol/csharp-sdk for MCP integration and when sending the initial POST it adds the Content-Type as "application/json; charset=utf-8" and the server replies with 'Content-Type must be 'application/json' , while reduntant due to RFC 8259, it should just be stripped instead of enforced. This was working previously working.
Affected version
Remote version of Github MCP Server.
Steps to reproduce the behavior
Working:
Non-Working:
Expected vs actual behavior
Expected -> ability to initialize the McpClient
Actual -> throws exceptions
Here is the raw JSON of the github-mcp connection retrieved from the Azure Foundry Connections API. Note that Azure masks the credentials object in the response for security reasons.
Closing — this is resolved by upgrading the MCP Go SDK to v1.5.0 in #2336. The SDK (since v1.4.1) already uses mime.ParseMediaType in StreamableHTTPHandler to correctly handle Content-Type: application/json; charset=utf-8, so no additional middleware is needed.
Hi! Checking in as this is a blocker for us. Since it was recently reopened, do you recommend we wait for a fix or implement a temporary workaround on our side? Thanks!
I'm seeing the same behavior when integrating the GitHub MCP Server with a Co-Pilot Studio Agent. Both from a custom connector and the offical GitHub MCP Server tool.
{"reasonCode":"RequestFailure","errorMessage":"Connector request failed","HttpStatusCode":"unsupportedMediaType","errorResponse":"[{\"jsonrpc\":\"2.0\",\"error\":{\"code\":415,\"message\":\"The response is not in a JSON format.\"}}]
{"reasonCode":"RequestFailure","errorMessage":"Connector request failed","HttpStatusCode":"unsupportedMediaType","errorResponse":"Content-Type must be 'application/json'\n"
Activity
weltonrodrigo commentedon Apr 15, 2026
this problem is affecting usage of Github MCP on azure foundry agents.
An agent with a definition like this is being affected:
Here is the raw JSON of the
github-mcpconnection retrieved from the Azure Foundry Connections API. Note that Azure masks thecredentialsobject in the response for security reasons.{ "id": "/subscriptions/<MYSUB>/resourceGroups/agent-foundry-ab/providers/Microsoft.CognitiveServices/accounts/<MY-ACCOUNT>/projects/<MY-PROJECT>/connections/github-mcp", "location": null, "name": "github-mcp", "properties": { "authType": "CustomKeys", "category": "CustomKeys", "credentials": { "keys": { "Authorization": "Bearer <github_token>", "Content-Type": "application/json", "Accept": "application/json, text/event-stream" } }, "error": null, "expiryTime": null, "group": "AzureAI", "isDefault": true, "isSharedToAll": false, "metadata": {}, "peRequirement": "NotRequired", "peStatus": "NotApplicable", "sharedUserList": [], "target": "https://api.githubcopilot.com/mcp", "useWorkspaceManagedIdentity": false }, "systemData": { "createdAt": "2026-04-15T18:45:50.653997Z", "createdBy": "4fe1a9c6-492a-4973-8816-47141b188eb6", "createdByType": "Application", "lastModifiedAt": "2026-04-15T18:45:50.653997Z", "lastModifiedBy": "4fe1a9c6-492a-4973-8816-47141b188eb6", "lastModifiedByType": "Application" }, "tags": null, "type": "Microsoft.CognitiveServices/accounts/projects/connections" }deps: upgrade modelcontextprotocol/go-sdk to v1.5.0
SamMorrowDrums commentedon Apr 15, 2026
Closing — this is resolved by upgrading the MCP Go SDK to v1.5.0 in #2336. The SDK (since v1.4.1) already uses
mime.ParseMediaTypeinStreamableHTTPHandlerto correctly handleContent-Type: application/json; charset=utf-8, so no additional middleware is needed.deps: upgrade modelcontextprotocol/go-sdk to v1.5.0
SamMorrowDrums commentedon Apr 17, 2026
Reopening as the SDK upgrade didn't resolve the issue.
pachecocordovamoiseseduardo-byte commentedon Apr 19, 2026
maor-co-MA commentedon Apr 20, 2026
Hi! Checking in as this is a blocker for us. Since it was recently reopened, do you recommend we wait for a fix or implement a temporary workaround on our side? Thanks!
dharris-bt commentedon Apr 21, 2026
I'm seeing the same behavior when integrating the GitHub MCP Server with a Co-Pilot Studio Agent. Both from a custom connector and the offical GitHub MCP Server tool.
Fix Content-Type rejection for application/json; charset=utf-8