This guide explains how to connect Merge Agent Handler to a Microsoft Copilot Studio agent as a Model Context Protocol (MCP) tool. Once connected, every tool exposed in your Agent Handler Tool Pack becomes callable by the Copilot Studio agent on behalf of a specific Registered User.
In Copilot Studio, an MCP integration has two parts:
You configure the Tool first, then create a Connection that supplies the API key.
Before starting, confirm you have all of the following:
If you are using a Test Registered User, you must also use a test API key. If you are using a Production Registered User, you must use a production API key.
You will paste these exact values into the Copilot Studio “Add a Model Context Protocol server” form. Substitute the bracketed placeholders with the IDs from the Prerequisites table above.
Open Copilot Studio and select the agent you want to connect Agent Handler to. If no agent exists yet, click Create blank agent.
Inside the agent, click the Tools tab in the top navigation.
Click Add a tool.
In the “Add tool” dialog, select Model Context Protocol.
In the “Add a Model Context Protocol server” form, enter the values from the Values you will enter in Copilot Studio table:
https://ah-api.merge.dev/api/v1/tool-packs/{Tool Pack ID}/registered-users/{Registered User ID}/mcpAuthorizationClick Create.
After clicking Create, you will be prompted to attach a Connection (this is what stores your API key).
In the “Connection” dropdown, click Create new connection.
In the “Connect to Agent Handler” dialog, paste your API key in the format below, then click Create.
The value must include the Bearer prefix (with a trailing space) before your API key. Without it, requests to Agent Handler will fail with 401 Unauthorized.
Open the tool you just created. On the Tool description page, the Tools section should list the tools exposed by your Agent Handler Tool Pack (for example, cms_coverage__list_local_coverage_articles).
If the tools list is empty or shows an error, see Troubleshooting below.
Set up data-loss prevention rules for tool calls with the Security Gateway.