Repository navigation
'Content-Type must be 'application/json' - when setting charset #2333
Description
Activity
this problem is affecting usage of Github MCP on azure foundry agents.
An agent with a definition like this is being affected:
object: agent.version id: <my id> name: <my agent name> version: "62" description: "" created_at: 1776277369 definition: kind: prompt model: gpt-5.2 instructions: "<here the agent prompt>" tools: - type: mcp server_label: github server_url: https://api.githubcopilot.com/mcp require_approval: never project_connection_id: github-mcp
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" }Reacted by Yme van der Linden- added a commit that references this issue
on 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.- added a commit that references this issue
on Apr 15, 2026 Reopening as the SDK upgrade didn't resolve the issue.
pachecocordovamoiseseduardo-byte commented
on Apr 19, 2026 More actionsEl vie., 17 de abril de 2026 12:25 p. m., Sam Morrow < ***@***.***> escribió:…*SamMorrowDrums* left a comment (github/github-mcp-server#2333) <#2333 (comment)> Reopening as the SDK upgrade didn't resolve the issue. — Reply to this email directly, view it on GitHub <#2333?email_source=notifications&email_token=B7EZGWLYRIFJTCAOORH7AGL4WKAK5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRXGA3TAMRYGAY2M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-4270702801>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/B7EZGWMPHAY2G3KAOC3277L4WKAK5AVCNFSM6AAAAACX2F7XFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DENZQG4YDEOBQGE> . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>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"- added a commit that references this issue
on Apr 21, 2026
Describe the bug
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