web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Test of custom connect...
Copilot Studio
Answered

Test of custom connector returns 415, swagger editor fails

(2) 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?
I have the same question (0)
  • Suggested answer
    Vahid Ghafarpour Profile Picture
    712 Super User 2025 Season 2 on at
    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.
     
  • Romain The Low-Code Bearded Bear Profile Picture
    2,179 Super User 2025 Season 2 on at
    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 :)
  • GO-20061201-0 Profile Picture
    on at
    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.
  • Suggested answer
    GO-20061201-0 Profile Picture
    on at
    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.
  • Romain The Low-Code Bearded Bear Profile Picture
    2,179 Super User 2025 Season 2 on at
    @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)
  • GO-20061201-0 Profile Picture
    on at
    Regarding the 415:
     
    I went back and reread my notes from the beginnings of learning about MCP servers. I started out with one using the stdio transport and did a couple of tutorials. And using Claude - until rate limits got me. So I switched to VSCode. Wow - what a wonderful implementation that is! 
     
    Anyway - in the mcp.json file you get these little buttons "Start | Stop | Restart" that switch on/off the MCP server protocol bits for your underlying server api. In my architecture, I have the standard echo api as an McpServerTool. If you look at it and kind of squint, it sort of looks like a controller. NOT! 
     
    Anyway - this is I think what's causing my 415 problem. I set up OpenAPI in program.cs and imported my service into a custom controller using the swagger spec. I also had HarVEy (get it? HVE - Hypervelocity Engineering) (also a 6 ft tall invisible rabbit - Jimmy Stuart's friend) generate headers for me - and it did this by creating mini-api's in program.cs. It's hard to be 100% sure, but I think it created a conflicting route under the covers. It worked from swagger UI, but I think it obscured the McpServerTool echo. What a mess!
     
    So I started over - brand new project, [McpServerTool] echo, etc. Published it as an app service. I added it to the vscode mcp.json and it works nicely as a mcp remote server (and local for that matter) from VSCode Github Copilot.
     
    BUT!
     
    When I attempt to create a custom connector in PowerApps, I can't get it done. On the 3. Definition page, it wants to import the usage from a sample. Ok - I fill out the form. It wants the URL, headers, body (as it's a POST). All looks good. 

    Until I actually try to test it on the 6. Test page. I get a 404. I look at the request details and see a URL that makes no sense at all:

    https://{my environment id}.15.custom.firstrelease.azure-apihub.net/apim/http-20mcp-20echo-5fd1b4820ac061ef33-5f99c7d58f865f2440/0d92e1d5f025457c87c23262b3c8e647/echo

    WTF?

    I get a 404 when I try it from the agent as well. 
  • Verified answer
    GO-20061201-0 Profile Picture
    on at
    I'm pretty sure that weird URL is generated for the Connection object. Inside that connection object is my "real" url. And I think that rather than /echo at the end, it needs /mcp. At least that's what seems to be working in another test that I'm running. So I'll mark this one answered.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 270 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 181 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard