also to add .. i switched to a different instance of AI foundry and it works there .. ???
Having issues calling MCP servers using Azure Open AI responses api
Microsoft Support Ticket Details
Issue Summary
Azure OpenAI Responses API rejects MCP (Model Context Protocol) tool requests with error: "MCP server url 'mcp.zapier.com' is not allowed. Allowed domains: []."
This was working and stopped
Error Message
HTTP/1.1 400 Bad Request
{
"error": {
"message": "MCP server url 'mcp.zapier.com' is not allowed. Allowed domains: [].",
"type": "invalid_request_error",
"param": "tools",
"code": null
}
}
Environment
- Azure OpenAI Endpoint:
https://helioscore.openai.azure.com/openai/v1/responses - API Version: v1 (Responses API)
- Model: gpt-4.1 (also tested with other models)
- Region: (include your Azure region)
- SDK: OpenAI Python SDK (latest version)
Request Details
We are calling the Responses API with MCP tools as documented in Microsoft's official documentation:
https://dori-uw-1.kuma-moon.com/en-us/azure/ai-foundry/openai/how-to/responses
Request format:
client = OpenAI(
api_key="<AZURE_API_KEY>",
base_url="https://helioscore.openai.azure.com/openai/v1/",
)
response = client.responses.create(
model="gpt-4.1",
input=[{"role": "user", "content": "Hello"}],
tools=[
{
"type": "mcp",
"server_label": "zapier",
"server_url": "https://mcp.zapier.com/api/mcp/mcp",
"headers": {"Authorization": "Bearer <token>"},
"require_approval": "never"
}
]
)
Expected Behavior
Per Microsoft documentation, the Responses API should support remote MCP servers. The documentation states:
"You can extend the capabilities of your model by connecting it to tools hosted on remote Model Context Protocol (MCP) servers."
Actual Behavior
The API returns a 400 error stating the MCP server URL is not allowed, with an empty allowed domains list: Allowed domains: []
This blocks all API requests when any MCP tool is included - even for simple queries that wouldn't invoke the MCP tool.
Questions for Microsoft
- Is there a configuration setting in Azure Portal or AI Foundry to whitelist MCP server domains?
- Is this a new security feature that requires explicit configuration?
- If domain whitelisting is required, where is this configured?
- Is this behavior specific to certain Azure regions or subscription types?
Impact
- MCP tool integration is completely blocked
- This was previously working (unclear when it stopped)
- Affects production application functionality
What We've Tried
- Using
AzureOpenAIclient vs standardOpenAIclient withbase_url- same error - Different MCP server URLs (Zapier, custom servers) - same error
- Different models (gpt-4.1, gpt-4o, gpt-5) - same error
- Verified MCP tool format matches Microsoft documentation exactly