DEV Community

Daniel Jonathan
Daniel Jonathan

Posted on

Host LogicApps as an MCP Server on Azure Container Apps

Host an MCP Server on ACA and Consume It from a Logic App Agent

Run Logic Apps Standard as an MCP server in a Docker container on Azure Container Apps — then call it from another Logic App using the built-in MCP client connector inside an agent loop.

This post connects two earlier pieces:

If you haven't read those, here's what's already running before this post starts.


What's already deployed

Seven arithmetic workflows — add, sub, mul, div, mod, pow, sqrt — each an HTTP trigger workflow that takes inputs and returns a result. They're baked into a Docker image and running as a single container on ACA.

One block in host.json enables the MCP endpoint:

"workflow": {
  "McpServerEndpoints": {
    "enable": true,
    "authentication": { "type": "anonymous" }
  }
}
Enter fullscreen mode Exit fullscreen mode

The runtime exposes each workflow as an MCP tool automatically. No extra code, no separate service — the container itself is the MCP server, reachable at:

https://la-arithmeticmcp.<env>.westeurope.azurecontainerapps.io/api/mcp
Enter fullscreen mode Exit fullscreen mode

All seven tools are immediately discoverable:

MCP Inspector showing all 7 arithmetic tools listed against the ACA endpoint


Consuming it from another Logic App

A second Logic App — BODMASAgent — receives a math expression via HTTP and uses an Agent action (Azure OpenAI) to solve it. The agent has one tool available: the MCP server connector pointing at the endpoint above.

When you add the MCP server action inside the Agent loop and connect it to the endpoint, the designer auto-discovers all tools and lets you pick which ones the agent can call:

Logic App designer showing the MCP server connector with all 7 arithmetic tools selectable as checkboxes

POST (2 + 3) * 4^2 / 2 and the agent works through BODMAS order on its own, calling one tool per step:

✅ Step 1: (2 + 3) = 5   → wf_arithmetic_add
✅ Step 2: 4² = 16        → wf_arithmetic_pow
✅ Step 3: 5 × 16 = 80    → wf_arithmetic_mul
✅ Step 4: 80 ÷ 2 = 40    → wf_arithmetic_div
✅ Final Answer: 40
Enter fullscreen mode Exit fullscreen mode

Agent log showing each BODMAS step — each one a live MCP tool call to the server container

No orchestration code in the consuming Logic App. The agent decides the order and arguments; each tool call triggers a real workflow run on the server container and returns the result.


Securing the MCP endpoint on ACA

The host.json above sets "type": "anonymous" — fine for local dev and demos, but for production you want the endpoint protected.

ACA doesn't have App Service Easy Auth built in, but it has its own ingress-level authentication that works the same way: the ACA runtime validates the Azure AD Bearer token before the request reaches the container. The Logic App MCP endpoint stays anonymous internally; ACA acts as the auth gateway.

Setup — two steps:

  1. Create an Azure AD app registration (la-arithmeticmcp-auth) and create a service principal for it in the tenant:
az ad sp create --id <app-id>
Enter fullscreen mode Exit fullscreen mode
  1. Enable ACA auth and point it at the app registration:
az containerapp auth update \
  --name la-arithmeticmcp --resource-group LogicAppHubRG \
  --enabled true --action Return401

az containerapp auth microsoft update \
  --name la-arithmeticmcp --resource-group LogicAppHubRG \
  --client-id <app-id> \
  --tenant-id <tenant-id> \
  --allowed-audiences "api://<app-id>"
Enter fullscreen mode Exit fullscreen mode

Getting a token (client credentials):

curl -X POST "https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token" \
  --data-urlencode "grant_type=client_credentials" \
  --data-urlencode "client_id=<app-id>" \
  --data-urlencode "client_secret=<secret>" \
  --data-urlencode "scope=api://<app-id>/.default"
Enter fullscreen mode Exit fullscreen mode

Result:

# No token
HTTP 401  ← blocked by ACA ingress

# Valid Bearer token → initialize session
HTTP 200  {"protocolVersion":"2025-06-18","serverInfo":{"name":"Logic Apps Remote MCP Server",...}}

# Session established → tools/list
HTTP 200  {"tools":[{"name":"wf_arithmetic_div",...},{"name":"wf_arithmetic_add",...}]}
Enter fullscreen mode Exit fullscreen mode

The MCP client (Postman, Logic App connector, or any client) just needs to include Authorization: Bearer <token> on every request.


Further reading — how MCP session handling works under the hood

The built-in MCP client connector handles session initialization, tool discovery, and JSON-RPC framing automatically. If you're building a custom client or want to understand what's happening behind the scenes — how initialize establishes a session, how tools/list returns the catalog, and how tools/call invokes a tool — this post walks through it manually:

Consume an MCP Endpoint from Azure Logic Apps with an Agent Loop

Top comments (0)