You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Azure API Management now supports secure integration with external MCP-compatible servers — tool servers hosted outside of API Management — through its built-in [AI gateway](genai-gateway-capabilities.md). This capability adds to existing support for MCP servers [natively exposed in API Management](export-rest-mcp-server.md) from managed REST APIs. Wit this enhancement, organizations can apply consistent governance, security, and observability to all MCP tools, regardless of where they are hosted.
17
+
This article shows how Azure API Management supports secure integration with existing MCP-compatible servers — tool servers hosted outside of API Management — through its built-in [AI gateway](genai-gateway-capabilities.md).
18
18
19
-
This capability is essential for enterprises building AI agents and copilots that rely on tools distributed across cloud services, open-source runtimes, and internal platforms. With API Management, you can now centralize access, enforce policies, and monitor usage across your entire AI tool ecosystem.
19
+
Example scenarios include:
20
20
21
-
### Example scenarios
21
+
- Proxy [LangServe](https://langchain-ai.github.io/langserve/) or [LangChain](https://python.langchain.com/) tool servers through API Management with per-tool authentication and rate limits.
22
+
- Securely expose Azure Logic Apps–based tools to copilots using IP filtering and OAuth.
23
+
- Centralize MCP tools from Azure Functions and open-source runtimes into [Azure API Center](../api-center/register-discover-mcp-server.md).
24
+
- Enable GitHub Copilot, Claude by Anthropic, or ChatGPT to interact securely with tools across your enterprise.
22
25
23
-
- Proxy LangServe or LangChain tool servers through API Management with per-tool authentication and rate limits.
24
-
- Securely expose Logic App–based tools to copilots using IP filtering and OAuth.
25
-
- Centralize tools from Azure Functions and open-source runtimes into Azure API Center.
26
-
- Enable GitHub Copilot, Claude, or ChatGPT to interact securely with tools across your enterprise.
26
+
API Management also supports MCP servers natively exposed in API Management from managed REST APIs. For more information, see [Expose a REST API as an MCP server](export-rest-mcp-server.md)
27
27
28
+
With support for existing and exposed MCP servers, API Management provides centralized control over authentication, authorization, and monitoring. It simplifies the management of MCP servers while helping to mitigate common security risks and ensuring scalability.
28
29
29
30
## Prerequisites
30
31
31
-
- An Azure API Management instance with the AI Gateway feature enabled.
32
+
+ If you don't already have an API Management instance, complete the following quickstart: [Create an Azure API Management instance](get-started-create-service-instance.md). Your API Management instance must be in one of the supported service tiers for preview: classic Basic, Standard, Premium, Basic v2, Standard v2, or Premium v2.
33
+
+ If your instance is in the classic Basic, Standard, or Premium tier, you must join the **AI Gateway Early**[update group](configure-service-update-settings.md) to access MCP server features. It can take up to 2 hours for the update to be applied.
32
34
- Access to an external MCP-compatible server (for example, hosted in Azure Logic Apps, Azure Functions, LangServe, or other platforms).
33
35
- Appropriate credentials to the MCP server (OAuth 2.0 client credentials or API keys) for secure access.
34
-
35
-
36
+
+ To test the MCP server, you can use Visual Studio Code with access to [GitHub Copilot](https://code.visualstudio.com/docs/copilot/setup).
36
37
37
38
## Connect an existing MCP Server
38
39
39
-
1.Navigate to your Azure API Management instance in the Azure portal.
40
-
2. In the left-hand menu, select **MCP servers** > **+ Create MCP server**.
41
-
2. Choose**Connect existing MCP server**.
42
-
3. Enter the following details:
40
+
1.In the [Azure portal](https://portal.azure.com), navigate to your API Management instance.
41
+
1. In the left-hand menu, select **MCP servers** > **+ Create MCP server**.
42
+
1. Select**Connect existing MCP server**.
43
+
1. Enter the following details for the backend MCP server:
43
44
-**Base URL** of the external MCP server.
44
45
-**Metadata endpoint** (if available).
45
46
-**Tool schema** describing the server’s capabilities.
47
+
1. Enter the following details for the frontend MCP server accessed through API Management:
48
+
-**Display name** for the MCP server in API Management.
49
+
-**Endpoint URL** where the MCP server will be accessible.
Copy file name to clipboardExpand all lines: articles/api-management/export-rest-mcp-server.md
+5-89Lines changed: 5 additions & 89 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,14 +17,9 @@ ms.custom:
17
17
18
18
In API Management, you can expose a REST API managed in API Management as a remote [Model Context Protocol (MCP)](https://www.anthropic.com/news/model-context-protocol) server. Expose one or more of the API operations as tools that MCP clients can call using the MCP protocol.
19
19
20
-
In addition to exposing your OpenAPI and HTTP endpoints as MCP servers, you can expose REST APIs managed in API Management such as the following:
20
+
Azure API Management also supports secure integration with existing MCP-compatible servers — tool servers hosted outside of API Management - such as Azure logic apps or function apps, or tools hosted in LangServe or LangChain. See [Connect and govern existing MCP server](connect-govern-existing-mcp-server.md) for more information.
21
21
22
-
*[Azure function app](import-function-app-as-api.md), for accessing serverless APIs
23
-
*[Azure logic app](import-logic-app-as-api.md), for automating workflows
24
-
*[Azure container app](container.md), for deploying containerized APIs
25
-
26
-
27
-
Using API Management to expose remote MCP servers provides centralized control over authentication, authorization, and monitoring. It simplifies the process of exposing APIs as MCP servers while helping to mitigate common security risks and ensuring scalability.
22
+
With support for existing and exposed MCP servers, API Management provides centralized control over authentication, authorization, and monitoring. It simplifies the management of MCP servers while helping to mitigate common security risks and ensuring scalability.
28
23
29
24
> [!IMPORTANT]
30
25
> This feature is currently in preview. Review the [prerequisites](#prerequisites) to access MCP server features.
@@ -41,9 +36,9 @@ In this article, you learn how to:
41
36
42
37
+ If you don't already have an API Management instance, complete the following quickstart: [Create an Azure API Management instance](get-started-create-service-instance.md). Your API Management instance must be in one of the supported service tiers for preview: classic Basic, Standard, Premium, Basic v2, Standard v2, or Premium v2.
43
38
+ If your instance is in the classic Basic, Standard, or Premium tier, you must join the **AI Gateway Early**[update group](configure-service-update-settings.md) to access MCP server features. It can take up to 2 hours for the update to be applied.
44
-
+ Make sure that your instance manages a REST API that you'd like to expose as an MCP server. To import a sample API, see [Import and publish your first API](import-and-publish.md).
39
+
+ Make sure that your instance manages an HTTP-compatible API (any API imported as a REST API) that you'd like to expose as an MCP server. To import a sample API, see [Import and publish your first API](import-and-publish.md).
45
40
> [!NOTE]
46
-
> Only HTTP APIs from API Management can be exposed as MCP servers.
41
+
> Only HTTP APIs managed in API Management can be exposed as MCP servers.
47
42
+ To test the MCP server, you can use Visual Studio Code with access to [GitHub Copilot](https://code.visualstudio.com/docs/copilot/setup).
48
43
49
44
@@ -62,83 +57,4 @@ The MCP server is created and the API operations are exposed as tools. The MCP s
62
57
63
58
:::image type="content" source="media/export-rest-mcp-server/mcp-server-list.png" alt-text="Screenshot of the MCP server list in the portal.":::
64
59
65
-
## Configure policies for the MCP server
66
-
67
-
Configure one or more API Management [policies](api-management-howto-policies.md) to help manage the MCP server. The policies are applied to all API operations exposed as tools in the MCP server and can be used to control access, authentication, and other aspects of the tools.
68
-
69
-
For a tutorial on how to configure policies, see [Transform and protect your API](transform-api.md).
70
-
71
-
To configure policies for the MCP server:
72
-
73
-
1. In the portal, under **APIs**, select **MCP Servers**.
74
-
1. Select the MCP server you created.
75
-
1. In the left menu, under **MCP**, select **Policies**.
76
-
1. In the policy editor, add or edit the policies you want to apply to the MCP server's tools. The policies are defined in XML format. For example, you can add a policy to limit calls to the MCP server's tools (in this example, 5 calls per 30 second per client IP address).
:::image type="content" source="media/export-rest-mcp-server/mcp-server-policies-small.png" alt-text="Screenshot of the policy editor for an MCP server." lightbox="media/export-rest-mcp-server/mcp-server-policies.png":::
83
-
84
-
## Test and use the MCP server
85
-
86
-
To verify that the MCP server is working, you can use Visual Studio Code to send requests to the MCP server tools.
87
-
88
-
In Visual Studio Code, use GitHub Copilot chat in agent mode (preview) to add the MCP server and use the tools. For background about MCP servers in Visual Studio Code, see [Use MCP Servers in VS Code (Preview)](https://code.visualstudio.com/docs/copilot/chat/mcp-servers).
89
-
90
-
> [!TIP]
91
-
> If you use the [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) to test an MCP server created by API Management, we recommend using version 0.9.0.
92
-
93
-
### Add the MCP server in Visual Studio Code
94
-
95
-
To add the MCP server in Visual Studio Code:
96
-
97
-
1. Use the **MCP: Add Server** command from the Command Palette.
98
-
99
-
1. When prompted, select the server type: **HTTP (HTTP or Server Sent Events)**.
100
-
1. Enter the **URL of the MCP server** in API Management. Example: `https://<apim-service-name>.azure-api.net/<api-name>-mcp/sse` (for SSE endpoint) or `https://<apim-service-name>.azure-api.net/<api-name>-mcp/mcp` (for MCP endpoint)
101
-
1. Enter a **server ID** of your choice.
102
-
1. Select whether to save the configuration to your **workspace settings** or **user settings**.
103
-
* **Workspace settings** - The server configuration is saved to a `.vscode/mcp.json` file only available in the current workspace.
104
-
105
-
* **User settings** - The server configuration is added to your global `settings.json` file and is available in all workspaces. The configuration looks similar to the following:
106
-
107
-
:::image type="content" source="media/export-rest-mcp-server/mcp-servers-visual-studio-code.png" alt-text="Screenshot of MCP servers configured in Visual Studio Code.":::
108
-
109
-
Add fields to the JSON configuration for settings such as authentication header. The following example shows the configuration for an API Management subscription key passed in a header as in input value. Learn more about the [configuration format](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_configuration-format)
110
-
111
-
:::image type="content" source="media/export-rest-mcp-server/mcp-server-with-header-visual-studio-code.png" alt-text="Screenshot of authentication header configuration for an MCP server":::
112
-
113
-
### Use tools in agent mode
114
-
115
-
After adding an MCP server, you can use tools in agent mode.
116
-
117
-
1. In GitHub Copilot chat, select **Agent** mode and select the **Tools** button to see available tools.
118
-
119
-
:::image type="content" source="media/export-rest-mcp-server/tools-button-visual-studio-code.png" alt-text="Screenshot of Tools button in chat.":::
120
-
121
-
1. Select one or more tools from the MCP server to be available in the chat.
122
-
123
-
:::image type="content" source="media/export-rest-mcp-server/select-tools-visual-studio-code.png" alt-text="Screenshot of selecting tools in Visual Studio Code.":::
124
-
125
-
1. Enter a prompt in the chat to invoke the tool. For example, if you selected a tool to get information about an order, you can ask the agent about an order.
126
-
127
-
```copilot-prompt
128
-
Get information for order 2
129
-
```
130
-
131
-
Select **Continue** to see the results. The agent uses the tool to call the MCP server and returns the results in the chat.
132
-
133
-
:::image type="content" source="media/export-rest-mcp-server/chat-results-visual-studio-code.png" alt-text="Screenshot of chat results in Visual Studio Code.":::
134
-
135
-
## Related content
136
-
137
-
* [Python sample: Secure remote MCP servers using Azure API Management (experimental)](https://github.com/Azure-Samples/remote-mcp-apim-functions-python)
0 commit comments