Skip to content

Commit e451d44

Browse files
author
gitName
committed
wip
1 parent d99e247 commit e451d44

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed
Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,48 @@
11
---
22
title: Expose REST API in API Management as MCP server | Microsoft Docs
3-
description: Learn how to...
3+
description: Learn how to expose a REST API in Azure API Management as an MCP server, enabling API operations as tools accessible via the Model Context Protocol (MCP).
44
author: dlepow
5-
65
ms.service: azure-api-management
76
ms.topic: how-to
8-
ms.date: 05/05/2025
7+
ms.date: 05/06/2025
98
ms.author: danlep
109
---
10+
1111
# Expose REST API in API Management as an MCP server
1212

1313
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1414

15-
Intro
15+
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. You can expose one or more of the API operations as tools that can be called by clients using the MCP protocol.
1616

1717
> [!NOTE]
18-
> Only the API definition can be exported directly from API Management to Postman. Other information such as policies or subscription keys isn't exported.
18+
> This feature is currently in preview.
19+
20+
In this article, you learn how to:
21+
22+
* Expose a REST API in API Management as an MCP server
23+
* Test the generated MCP server
24+
1925

2026
## Prerequisites
2127

2228
+ Complete the following quickstart: [Create an Azure API Management instance](get-started-create-service-instance.md).
23-
+ Make sure that your instance manages a REST API that you'd like to expose as an MCP serer.
24-
29+
+ 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).
2530
> [!NOTE]
26-
> You can only expose HTTP APIs from API Management as MCP servers.
27-
+ To test the MCP server, you can use a tool like [MCP Inspector](
31+
> Only expose HTTP APIs from API Management can be exposed as MCP servers.
32+
+ To test the MCP server, you can use a tool like [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector)
2833

2934
[!INCLUDE [api-management-navigate-to-instance.md](../../includes/api-management-navigate-to-instance.md)]
3035

31-
3236
## Expose API as an MCP server
3337

3438
1. In the portal, under **APIs**, select **MCP Servers** > **+ Create new MCP Server**.
3539
1. In **API**, select a REST API to expose as an MCP server.
3640
1. Select one or more **API Operations** to expose as tools. You can select all operations or only specific operations.
3741
1. Select **Create**.
3842

39-
:::image type="content" source="media/export-rest-mcp-server/create-mcp-server.png" alt-text="Screenshot of creating an MCP server in the portal.":::
43+
:::image type="content" source="media/export-rest-mcp-server/create-mcp-server-small.png" alt-text="Screenshot of creating an MCP server in the portal." lightbox="media/export-rest-mcp-server/create-mcp-server.png":::
4044

41-
The MCP server is created and the API operations are exposed as tools. The MCP server is listed in the **MCP Servers** blade. The **URL** column shows the endpoint of the MCP server that you can call for testing or within a client application.
45+
The MCP server is created and the API operations are exposed as tools. The MCP server is listed in the **MCP Servers** pane. The **URL** column shows the endpoint of the MCP server that you can call for testing or within a client application.
4246

4347

4448
:::image type="content" source="media/export-rest-mcp-server/mcp-server-list.png" alt-text="Screenshot of the MCP server list in the portal.":::
@@ -55,15 +59,21 @@ To use MCP inspector:
5559
```bash
5660
npx @modelcontextprotocol/inspector
5761
```
58-
1. Select **Transport Type** of **SSE**.
59-
1. In **URL**, enter the MCP server URL that's configured in API Management.
60-
1. Under **Authentication**, provide credentials of the underlying API if required in API Management. For example, if a subscription key is required, enter `Ocp-Apim-Subscription-Key` in **Header Name**, and provide the key value in **Bearer token**.
61-
1. Select **Connect** to connect to the MCP server.
62+
63+
1. Enter the following settings:
64+
65+
| **Setting** | **Description** |
66+
|------------------------|-----------------------------------------------------------------------------------------------------|
67+
| **Transport Type** | Select **SSE**. |
68+
| **URL** | Enter the MCP server URL that's configured in API Management. |
69+
| **Authentication** | Optionally, provide credentials of the underlying API if required in API Management. For example, if a subscription key is required, enter `Ocp-Apim-Subscription-Key` in **Header Name**, and provide the key value in **Bearer token**. |
70+
1. Select **Connect** to connect to the MCP server.
6271
1. In **Tools**, select **List Tools**, and select a tool configured in the MCP server.
6372
1. Enter any required parameters for the tool, and select **Run Tool** to run the tool. The results are displayed in the **Tool Result** pane.
6473
6574
:::image type="content" source="media/export-rest-mcp-server/test-mcp-inspector.png" alt-text="Screenshot of testing an MCP server tool in MCP Inspector.":::
6675
6776
## Related content
6877
78+
* [Register and discover remote MCP servers in Azure API Center](../api-center/register-discover-mcp-server.md)
6979
85.7 KB
Loading

0 commit comments

Comments
 (0)