Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - Model Context Protocol
Answered

406: Not Acceptable: Client must accept both application/json and text/event-stream

(0) ShareShare
ReportReport
Posted on by
I have tried several variations in my OpenAPI 2.0 spec but can't seem to crack this one. Here's my latest attempt:
 
  "paths": {
    "/": {
      "post": {
        "tags": [
          "mcp-http-demoApi"
        ],
        "description": "Adds two numbers.",
        "operationId": "Add",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "text/plain"
        ],
        "parameters": [
            {
                "in": "header",
                "name":"Accept",
                "required": true,
                "type": "string",
                "default": "application/json; text/event-stream"
            },
          {
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "type": "object"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "type": "string"
            }
          }
        }
      }
    }
  },
In the swagger editor, this looks like:
curl -X 'POST' \
  'https://{my}.{api}.azurecontainerapps.io/mcp/' \
  -H 'accept: text/plain' \
  -H 'Accept: application/json; text/event-stream' \
  -H 'Content-Type: application/json' \
  -d '{
"a":5,"b":9
}'
but I still get the 406. I tried putting both MIME types in the "consumes". It ignores anything after the first item.

 
  • Verified answer
    GO-20061201-0 Profile Picture
    on at
    406: Not Acceptable: Client must accept both application/json and text/event-stream
    The Accept header wants a comma between the mime types, not a semicolon.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Copilot Studio

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 132

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 81 Super User 2025 Season 1

#3
Pablo Roldan Profile Picture

Pablo Roldan 61