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
This article introduces features in Azure API Management that you can use to manage Model Context Protocol (MCP) servers. MCP servers allow AI agents to access external data sources, such as databases or APIs, through a standardized protocol.
17
+
This article introduces features in Azure API Management that you can use to manage Model Context Protocol (MCP) servers. MCP servers allow large language models (LLMs) and AI agents to access external data sources, such as databases or APIs, through a standardized protocol.
18
18
19
-
Use API Management to securely expose and govern API operations as tools for large language models (LLMs) and AI agents like GitHub Copilot, ChatGPT, Claude, and more. API Management provides centralized control over MCP server authentication, authorization, and monitoring. It simplifies the management of MCP servers while helping to mitigate common security risks and ensuring scalability.
19
+
With the proliferation of AI agents and large language models (LLMs), management of MCP servers is becoming increasingly important:
20
20
21
+
* Agents need secure, governed access to tools and resources
22
+
* Developers want to reuse existing APIs as agent tools
23
+
* Enterprises need observability, control, and scaling
24
+
25
+
Use API Management to securely expose and govern API operations as tools for LLMs and AI agents like GitHub Copilot, ChatGPT, Claude, and more. API Management provides centralized control over MCP server authentication, authorization, and monitoring. It simplifies the management of MCP servers while helping to mitigate common security risks and ensuring observability, control, and scalability.
21
26
22
27
## MCP concepts and architecture
23
28
@@ -85,7 +90,7 @@ Configure policies such as the following::
85
90
86
91
## Secure access to the MCP server
87
92
88
-
You can secure either or both inbound access to the MCP server (from an MCP client to API Management) and outbound access (from API Management to the MCP server backend). For information and examples, see [Secure access to MCP servers](secure-mcp-servers.md).
93
+
You can secure either or both inbound access to the MCP server (from an MCP client to API Management) and outbound access (from API Management to the MCP server backend). For more information and examples, see [Secure access to MCP servers](secure-mcp-servers.md).
89
94
90
95
## Monitoring
91
96
@@ -103,9 +108,11 @@ For more information, see [Monitor API Management](monitor-api-management.md).
103
108
104
109
## Discover MCP servers
105
110
106
-
Use [Azure API Center](../api-center/register-discover-mcp-server.md) to register and discover MCP servers in your organization. Azure API Center provides a centralized location for managing MCP servers, including those exposed in API Management and those hosted outside of API Management.
111
+
Use [Azure API Center](../api-center/register-discover-mcp-server.md) to register and discover MCP servers in your organization.
107
112
113
+
* Azure API Center provides a centralized location for managing MCP servers, including those exposed in API Management and those hosted outside of API Management.
108
114
115
+
* Deploy the [API Center portal](../api-center/set-up-api-center-portal.md) to enable your users to discover and interact with MCP servers through a private, enterprise-ready MCP server registry.
109
116
110
117
## Availability
111
118
@@ -115,7 +122,7 @@ MCP servers in API Management are available in the following service tiers:
115
122
***v2 tiers**: Basic v2, Standard v2, Premium v2
116
123
117
124
> [!NOTE]
118
-
> * In the classic tiers, you must join the [AI Gateway Early update group](configure-service-update-settings.md) to access MCP server features, and access the portal at a feature-specific URL.
125
+
> * In the classic tiers, you must join the [AI Gateway Early update group](configure-service-update-settings.md) to access MCP server features.
119
126
> * MCP servers aren't currently supported in [workspaces](workspaces-overview.md).
120
127
121
128
## Related content
@@ -130,4 +137,6 @@ MCP servers in API Management are available in the following service tiers:
130
137
131
138
*[Expose and govern existing MCP server](expose-existing-mcp-server.md)
132
139
133
-
*[Secure access to MCP servers](secure-mcp-servers.md)
140
+
*[Secure access to MCP servers](secure-mcp-servers.md)
141
+
142
+
* Visit [https://mcp.azure.com](https://mcp.azure.com) for a live example of an MCP server registry created using Azure API Center.
Copy file name to clipboardExpand all lines: articles/api-management/secure-mcp-servers.md
+48-9Lines changed: 48 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,14 +19,40 @@ With [MCP server support in API Management](mcp-server-overview.md), you can ex
19
19
20
20
You can secure either or both inbound access to the MCP server (from an MCP client to API Management) and outbound access (from API Management to the MCP server backend).
21
21
22
-
###Secure inbound access
22
+
## Secure inbound access
23
23
24
-
One option to secure inbound access is to configure a policy to validate a JSON web token (JWT) generated using an identity provider in the incoming requests. This ensures that only authorized clients can access the MCP server. Use the generic [validate-jwt](validate-jwt-policy.md) policy, or the [validate-azure-ad-token](validate-azure-ad-token-policy.md) policy when using Microsoft Entra ID, to validate the JWT in the incoming requests.
24
+
### Key-based authentication
25
25
26
-
The following is a basic example of validating a Microsoft Entra ID token presented in an `Authorization` header in the incoming request:
26
+
If the backend API is protected with an API Management subscription key passed in a `Ocp-Apim-Subscription-Key` header, MCP clients can present the key in the incoming requests, and the MCP server can validate the key. For example, in Visual Studio Code, you can add a `headers` section to the MCP server configuration to require the subscription key in the request headers:
Visual Studio Code provides ways to store the subscription key in the workspace or user settings, or to pass the key through user input, so you don't have to hard-code it in the MCP server configuration.
42
+
43
+
> [!CAUTION]
44
+
> When you use an MCP server in API Management, incoming headers like **Authorization** aren't automatically passed to your backend API. If your backend needs a token, you can add it as an input parameter in your API definition. Alternatively, use policies like `get-authorization-context` and `set-header` to generate and attach the token, as noted in the following section.
45
+
46
+
### Token-based authentication
47
+
48
+
You can generate an access token (JWT) using your identity provider, and pass the token in a request to the MCP server in an `Authorization` header. Then, API Management can use a policy to validate the JWT in the incoming request. This ensures that only authorized clients can access the MCP server.
49
+
50
+
API Management provides the generic [validate-jwt](validate-jwt-policy.md) policy, or the [validate-azure-ad-token](validate-azure-ad-token-policy.md) policy when using Microsoft Entra ID, to validate the JWT in the incoming requests.
51
+
52
+
For example, you can use the following policy to validate a Microsoft Entra ID token presented in an incoming request:
27
53
28
54
```xml
29
-
<validate-azure-ad-tokenheader-name="Authorization"failed-validation-httpcode="401"failed-validation-error-message="Unauthorized. Access token is missing or invalid.">
55
+
<validate-azure-ad-tokentenant-id="your-tenant-id"header-name="Authorization"failed-validation-httpcode="401"failed-validation-error-message="Unauthorized. Access token is missing or invalid.">
30
56
<client-application-ids>
31
57
<application-id>your-client-id</application-id>
32
58
</client-application-ids>
@@ -41,13 +67,10 @@ For more inbound authorization options and samples, including using OAuth author
> When you use an MCP server in API Management, incoming headers like **Authorization** aren't automatically passed to your backend API. If your backend needs a token, you can add it as an input parameter in your API definition. Alternatively, use policies like `get-authorization-context` and `set-header` to generate and attach the token, as noted in the following section.
46
-
47
70
48
-
###Secure outbound access
71
+
## Secure outbound access
49
72
50
-
You can use API Management's [credential manager](credentials-overview.md) to securely inject secrets or tokens for calls to a backend API. For example, use the credential manager to obtain and present an access token from an identity provider to access the API called by an MCP server tool.
73
+
Use API Management's [credential manager](credentials-overview.md) to securely inject secrets or tokens for calls to a backend API. For example, use the credential manager to obtain and present an OAuth 2.0 access token from an identity provider to access the backend API called by an MCP server tool.
51
74
52
75
At a high level, the process is as follows:
53
76
@@ -56,6 +79,22 @@ At a high level, the process is as follows:
56
79
1. Configure a connection to the provider in API Management.
57
80
1. Configure `get-authorization-context` and `set-header` policies to fetch the token credentials and present them in an **Authorization** header of the API requests.
58
81
82
+
For example, the following policy retrieves an access token from the credential manager and sets it in the `Authorization` header of the request to the backend API:
For a step-by-step guide to call an example backend API using credentials generated in credential manager, see [Configure credential manager - GitHub](credentials-how-to-github.md).
0 commit comments