Expose REST API in API Management as an MCP server - Not exposing tools

Pamoli Banerjee 0 Reputation points
2025-12-18T10:17:11.7566667+00:00

Hello ,

I am currently following this blog to expose SAP REST API's as MCP servers that need to be accessed via copilot studio / Microsoft new foundry : https://learn.microsoft.com/en-us/azure/api-management/export-rest-mcp-server

I have an API Management Service instance in Tier Basic v2. Here I have configured an SAP API which works fine ( status 200 ) when tested from API managment .This API handles a Oauth2 protected SAP REST API and policy configured works fine.:

User's image

Now , I want to use create an MCP server "cloudalmtasksbasicv2" for this API and expose the tools to be used from other MCP client. I am able to connect to this MCP server in any client but the tools/calls get a timeout error. Please note I have not put any policies at the MCP server level:
User's image

How to make the MCP server work. Is there any other step I am missing .

  1. Create an API in API management . Protect using ocp-apim-subscription-key. Set API policies for Oauth2 token handling.
  2. Create an MCP server for this API and expose the tools . No policy handling here.

Do we need API center / gateway / products in this scenario .

Thanks,
Pamoli.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rakesh Mishra 4,115 Reputation points Microsoft External Staff Moderator
    2025-12-18T12:47:31.71+00:00

    Hey @Pamoli Banerjee ,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    It sounds like you're facing an issue with your MCP server setup in API Management, particularly with timeouts when trying to access tools or calls. Here's a breakdown of what could be happening and some steps you can take to troubleshoot and resolve this:

    1. Endpoint Configuration: Ensure that you are using the correct endpoint for your MCP server. For a typical MCP configuration, if your client is using Streamable HTTP, the endpoint should end with /mcp. If it's using Server-Sent Events (SSE), it should end with /sse. Check to see what endpoint your MCP client is attempting to reach.
    2. Buffering Issues: Each MCP server has specific conditions regarding buffering:
      • If you have enabled payload logging in Azure Monitor or Application Insights, this can cause unexpected behavior. Try temporarily disabling these settings to see if the issue persists.
      • Avoid accessing the context.Response.Body in your policies, as this can trigger response buffering that interferes with the streaming behavior required by MCP servers.
    3. Network Configuration: For SKU v2, ensure that the VNET being used can resolve the Azure API Management service's fully qualified domain name (FQDN) and allows outbound traffic to it. If outbound traffic is blocked, it may cause timeouts.
    4. MCP Tool Initialization: If your MCP tool has a complex schema, it might be causing timeouts. To troubleshoot:
      • Verify that any API operations associated with the MCP tools exist.
      • Simplify the tool definitions by removing tools one at a time to identify if one is causing the timeout.
      • Review the schema for excessive complexity.
    5. Policies and Permissions: Since you mentioned that you haven't put any policies at the MCP server level, consider implementing some basic policies to manage and control access. Although not necessary, well-defined policies can help ensure proper access and mitigate issues.
    6. Testing Environment: If you're leveraging tools like Visual Studio Code with GitHub Copilot, make sure your setup is correctly configured to access the MCP server without issues.

    As for your question about needing API Center, gateway, or products in this scenario, while it’s not strictly necessary for basic functionality, using these features can help with management and scalability in more complex software ecosystems.

    Follow-up Questions:

    • What type of endpoint is your MCP client using to connect? Is it Streamable HTTP or SSE?
    • Have you enabled any diagnostic logging in Azure Monitor or Application Insights?
    • Can you provide details on your network setup, particularly if you're using a VNET?
    • How complex is the schema of the API operation associated with your MCP tool?
    • Are you able to test the MCP server from tools like MCP Inspector or similar?

    I hope this helps! Let me know if you have any other questions or need further clarification on any of the points.

    References:

    Note: This content was drafted with the help of an AI system.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.