Copilot Studio Agents with MCP using Logic Apps

Recently Microsoft introduced MCP support for Logic Apps (as described here –> Set up Standard Workflows as MCP Servers – Azure Logic Apps | Microsoft Learn) I just wanted to use this blog post to document a bit of the deployment and steps involved since the documentation was not that descriptive in some steps.

NOTE: The example I am going to show is configured without any authentication mechanism just to get it up and running quickly! NOTE:

1: Set up a Logic App that uses Workflow Service Plan and App Service

2: We need make some configuration changes to the Logic App. Go into the Logic App –> Development Tools –> Advanced Tools –> Go –> Debug Console –> CMD –> Go to site and wwwroot and click edit on the host.json file.

The JSON file should look like this. This enables MCP server configuration, anonymous authentication and SSE. The Microsoft docs describe how to set this up with authentication as well.

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
    "version": "[1.*, 2.0.0)"
  },
"extensions": {
    "workflow": {
        "Settings": {
            "Runtime.McpServerToMcpClientPingIntervalInSeconds": 30, 
            "Runtime.Backend.EdgeWorkflowRuntimeTriggerListener.AllowCrossWorkerCommunication": false
        },
      "McpServerEndpoints": {
        "enable": true,
        "authentication": {
          "type": "anonymous"
        }
      }
    }
  }
}

Once you have that added you can restart the Logic App, and TAKE A NOTE OF THE URL OF THE LOGIC APP WE NEED THIS LATER.

Once that is done we need to create a workflow.

Each workflow that you create needs two things to work
1: HTTP Request (The an activity that you want to trigger)
2: HTTP Response

The initial HTTP request needs to have a JSON structure and a description. This description is using by MCP to give the agent or workflow information when to trigger it. For instance if I want to have a workflow that creates a new user in Entra ID it might look something like this

The JSON Structure I use here is like this

{
  "type": "object",
  "properties": {
    "AccountEnabled": {
      "type": "boolean",
      "description": "True if the new account should be enabled when it is created."
    },
    "DisplayName": {
      "type": "string",
      "description": "The name displayed in the address book for the user."
    },
    "MailNickname": {
      "type": "string",
      "description": "The mail alias for the user."
    },
    "Password": {
      "type": "string",
      "description": "The password for the user. The user will be required to change the password on the next login."
    },
    "UserPrincipalName": {
      "type": "string",
      "description": "The user principal name (UPN) of the user."
    },
    "GivenName": {
      "type": "string",
      "description": "The user's given name (first name)."
    },
    "Surname": {
      "type": "string",
      "description": "The user's surname (family name or last name)."
    }
  },
  "required": [
    "AccountEnabled",
    "DisplayName",
    "MailNickname",
    "Password",
    "UserPrincipalName",
    "GivenName",
    "Surname"
  ]
}

Then I forward this into an workflow integrated with Entra ID where I paste in the correct information, once that is done I just have a response that forwards the body content back from Entra ID.

Great, so now I have created a simple workflow and enabled MCP support for the Logic App (without any authentication). It should be noted that if I add MORE workflows to this logic app, they will also appear to the user. Now let us just add this to a Copilot Studio Agent.

Create an agent go into Tools –> Add tool –> Model Context Protocol –> Here enter the URL of the Logic App like this
https://servername.azurewebsites.net/api/mcp

Then it will sync the workflows that are available and add them as tools, so if you open options to the tool it will look like this.

So If I ask the chat bot now to create a user in Entra ID, the agent will look at the description of the tools that are available and se which one to trigger.

This is a REALLY simple guide how to get MCP support in Logic Apps and how to use them from Copilot Studio Agents. However since it is using MCP it is not restricted to Copilot, it can be used in any MCP supported Client. Such as Claude, VS Code, ChatGPT or others.

Leave a Reply

Scroll to Top