Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - Model Context Protocol
Suggested answer

Test of custom connector returns 415, swagger editor fails

(1) ShareShare
ReportReport
Posted on by
Architecture:
 
An Azure app service is running an MCP server. That MCP server has an echo endpoint. That echo endpoint accepts POST and OPTIONS. I created a custom connector + connection. 
 
Tests:
 
If I test the custom connector in Power Apps (page 6), it works. I send:  echo "joe", it replies "hello joe". I check app insights and I see POST /echo and a 200.
If I test the connection using the swagger editor, it seems to fail in that UI - it reports:

Failed to fetch.
Possible Reasons:

  • CORS
  • Network Failure
  • URL scheme must be "http" or "https" for CORS request.
However, if I look in app insights, I see OPTIONS /echo (returns a 200) and POST /echo (also returns a 200).
 
I added CORS related code to get this outcome:
 
// Echo API endpoint for OPTIONS
app.MapMethods("/echo", new[] { "OPTIONS" }, (HttpContext httpContext) =>
{
    httpContext.Response.Headers["Access-Control-Allow-Methods"] = "POST, OPTIONS, GET";
    httpContext.Response.Headers["Access-Control-Allow-Headers"] = "Content-Type, Accept, x-api-key";
    httpContext.Response.Headers["Access-Control-Allow-Origin"] = "*";
    return Results.Ok();
});
 
I added the custom connector as a Tool in an agent. I issue the request "echo joe". In the instructions I told the agent to wrap double quotes around the input string (in this case "joe"). 
 
On the Activity page, the Connector Action bubbles on the left show a red circle with ! in it. The larger panel on the right shows:
connectorRequestFailureThe connector 'Echo test api' returned an HTTP error with code 415.
 
And indeed, if I look in app insights, I see POST /echo with a 415 return code.
 
Question 1: is there a way I can see the details of the interaction between the agent and the custom connector? 
Question 2: why the variability in the various test contexts? 
Question 3: got a suggestion? what can I do to fix it?
  • Romain The Low-Code Bearded Bear Profile Picture
    356 on at
    Test of custom connector returns 415, swagger editor fails
    @GO-20061201-0 thanks for the update, it's much appreciated since this part is not at the moment well documented :) since last post we (with my team) had different problem with integration of custom connector but none of them near your :( hope you will find and share answer ! (or some one could save you)
  • Suggested answer
    GO-20061201-0 Profile Picture
    on at
    Test of custom connector returns 415, swagger editor fails
    For the CORS message, it was necessary to add:
    Access-Control-Allow-Origin = "*"
    to the POST /echo response. I found the needed debugging information by using browser tools. And referenced this SO:
     
    This answers question 1 - at least for testing the custom connector. And apparently, question 2 as well. The swagger editor sends the OPTIONS request, however, the test from the agent chat does not. So - still need to resolve the 415 question.
     
    So - part of question 3 yet to be solved.
  • GO-20061201-0 Profile Picture
    on at
    Test of custom connector returns 415, swagger editor fails
    Unfortunately, Power Platform doesn’t currently expose full request/response payloads from agent-to-connector interactions in the UI.
    Thanks. I was hoping there was a capability similar to in Azure AI Foundry that I just couldn't find. :/
     
    since you’re already logging requests, you can inspect the POST /echo entries use Application Insights.
    I think I've already learned as much as I can from app insights
     
    SSE MCP is now considered obsolete for PP and Copilot studio
    I knew that - the MCP server is http/streaming.
  • Romain The Low-Code Bearded Bear Profile Picture
    356 on at
    Test of custom connector returns 415, swagger editor fails
    previous answer is perfect, just to add : SSE MCP is now considered obsolet for PP and Copilot studio, try Streamable :) doc have change yesterday on MS learn :)
  • Suggested answer
    Vahid Ghafarpour Profile Picture
    167 on at
    Test of custom connector returns 415, swagger editor fails
    Unfortunately, Power Platform doesn’t currently expose full request/response payloads from agent-to-connector interactions in the UI. However, 
    since you’re already logging requests, you can inspect the POST /echo entries use Application Insights.
     

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