Hi all. I set myself the goal of deploying a MCP server with an api tool into an Azure Container App and then invoking it from a Copilot Studio agent. It took some trial and error, but ultimately I was successful. Hopefully, this will help you with your own work.
I tested the deployment by changing the server URL in the repo's client.py app to point to the ACA.
Next, I wrote an OpenApi 2.0 spec. This is the tricky bit. According to the
mcp samples page, there is no specification of tool inputs. That's almost true. With this line in the spec:
x-ms-agentic-protocol: mcp-streamable-1.0, when you create the custom connector, it knows to look at the server and pull in its requirements. But you have to add some bits so the right request headers get added. Here's my final OpenApi spec:
{
"swagger": "2.0",
"info": {
"title": "mcp-http-demoApi | v1",
"description": "An MCP server demo API that adds two numbers.",
"version": "1.0.0"
},
"host": "{my}.{api}.azurecontainerapps.io",
"basePath": "/",
"schemes": [
"https"
],
"paths": {
"/mcp": {
"post": {
"summary": "An MCP server that adds two numbers.",
"description": "An MCP server that adds two numbers.",
"x-ms-agentic-protocol": "mcp-streamable-1.0",
"operationId": "Add",
"parameters": [
{
"in": "header",
"name": "Accept",
"type": "string",
"required": true,
"default": "application/json, text/event-stream"
},
{
"in": "header",
"name": "Content-Type",
"type": "string",
"required": true,
"default": "application/json"
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
}
}
}