Skip to content

Commit 0241ab8

Browse files
committed
added policy section
1 parent cd0135e commit 0241ab8

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

articles/api-management/export-rest-mcp-server.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ Document need an IcM for SKUv2 --
1818
1919
Need to use the GenAI release group -->
2020

21-
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.
21+
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 MCP clients can call using the MCP protocol.
2222

2323
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.
2424

2525
> [!NOTE]
26-
> This feature is currently in preview and is being released first to the **AI Gateway Early** [update group](configure-service-update-settings.md).
26+
> This feature is currently in preview. It's being released first to the **AI Gateway Early** [update group](configure-service-update-settings.md).
2727
28-
In this article, you learn how to:.
28+
In this article, you learn how to:
2929

3030
* Expose a REST API in API Management as an MCP server
31-
* Test the generated MCP server
31+
* Test the generated MCP server from an MCP client
3232

3333
[!INCLUDE [about-mcp-servers](../api-center/includes/about-mcp-servers.md)]
3434

@@ -56,6 +56,26 @@ The MCP server is created and the API operations are exposed as tools. The MCP s
5656

5757
:::image type="content" source="media/export-rest-mcp-server/mcp-server-list.png" alt-text="Screenshot of the MCP server list in the portal.":::
5858

59+
## Configure policies for the MCP server
60+
61+
You can configure one or more API Management [policies](api-management-howto-policies.md) for 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 tool.
62+
63+
For a tutorial on how to configure policies, see [Transform and protect your API](transform.md).
64+
65+
To configure policies for the MCP server:
66+
67+
1. In the portal, under **APIs**, select **MCP Servers**.
68+
1. Select the MCP server you created.
69+
1. In the left menu, under **MCP**, select **Policies**.
70+
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 an inbound policy to add an API Management subscription key for all requests to the MCP server. Substitute `your-subscription-key` with an actual subscription key configured in your API Management instance.
71+
72+
```xml
73+
<set-header name="Ocp-Apim-Subscription-Key" exists-action="override">
74+
<value>your-subscription-key</value>
75+
</set-header>
76+
```
77+
78+
:::image type="content" source="media/export-rest-mcp-server/mcp-server-policies.png" alt-text="Screenshot of the policy editor for an MCP server.":::
5979

6080
## Test and use the MCP server
6181

@@ -70,8 +90,9 @@ To use MCP inspector:
7090
```bash
7191
npx @modelcontextprotocol/inspector
7292
```
93+
1. Navigate to the local URL of the MCP Inspector that's displayed in the console.
7394

74-
1. Enter the following settings:
95+
1. In the browser, enter the following settings:
7596

7697
| **Setting** | **Description** |
7798
|------------------------|-----------------------------------------------------------------------------------------------------|
52 KB
Loading

0 commit comments

Comments
 (0)