In Microsoft Foundry (Agent Service), when I attach a Foundry IQ Knowledge Base to a no-code Prompt Agent via Knowledge > Add (native Foundry IQ), every question I send to the agent in the playground fails with:
In Microsoft Foundry (Agent Service), when I attach a Foundry IQ Knowledge Base to a no-code Prompt Agent via Knowledge > Add (native Foundry IQ), every question I send to the agent in the playground fails with:
406 Not Acceptable
Client must accept both application/json and text/event-stream
The error happens while the agent tries to enumerate the KB's MCP tools, so the agent never reaches knowledge_base_retrieve and can't answer anything grounded on the knowledge base.
Environment
- Microsoft Foundry Agent Service, no-code Prompt Agent (portal, ai.azure.com)
- Foundry IQ Knowledge Base built on Azure AI Search (Standard tier), hybrid + semantic retrieval, system-assigned managed-identity auth, indexing blob documents
- KB chat model:
gpt-5.4-mini; vectorizer: text-embedding-ada-002
- Foundry project region: Sweden Central; Azure AI Search region: France Central
- MCP API version:
2026-05-01-preview
What I expected
Asking the Prompt Agent a question should trigger the KB's managed MCP tool (knowledge_base_retrieve) and return a grounded answer with citations, as described in the Foundry IQ docs.
What actually happens
Every prompt fails immediately with the 406 above — the agent can't list its tools, so it never calls the knowledge base. I traced the root cause to a missing Accept header in the internal MCP client used by the native Knowledge attachment.
Isolation / evidence (direct probe of the KB MCP endpoint)
I called the KB MCP endpoint directly (.../knowledgebases/<kb-name>/mcp?api-version=2026-05-01-preview, bearer token for audience https://search.azure.com/.default) and ran initialize:
-
Accept: application/json, text/event-stream → 200 OK (SSE stream, initialize responds correctly)
-
Accept: application/json (only) → 406 Not Acceptable (identical to the playground error)
So the endpoint itself is healthy and MCP-compliant. The failure is in the portal runtime client for the native Foundry IQ attachment, which sends Accept: application/json without text/event-stream.
The connection the portal creates for the native attach looks correct per the docs: metadata.type = knowledgeBase_MCP, authType = ProjectManagedIdentity, audience = https://search.azure.com (the project managed identity has Search Index Data Reader on the search service).
Workaround I found (works, but feels unsupported)
- Remove the Foundry IQ attachment under Knowledge.
- Add the same endpoint as a Custom MCP (Tools > Add > Model Context Protocol). This client (
metadata.type = custom_MCP) does send both Accept headers, so it passes the 406.
- The Microsoft Entra auth option on that flow creates
authType = AgenticIdentityToken, which has no role on Search → 403. I had to change the connection to authType = ProjectManagedIdentity (keeping audience = https://search.azure.com) via az rest PUT on the connection, since the portal doesn't expose that change.
After that, asking the agent a question lists and calls knowledge_base_retrieve correctly end to end.
Questions
- Is the 406 in the native Knowledge > Add (Foundry IQ /
knowledgeBase_MCP) path a known bug in the current preview (missing text/event-stream in the client's Accept header)? Is a fix planned?
- Is there a supported configuration to make the native Foundry IQ attachment work with a no-code Prompt Agent, so I don't need the custom-MCP +
az rest workaround?
- Is the
custom_MCP + ProjectManagedIdentity approach a supported pattern for connecting a Foundry IQ Knowledge Base to a Prompt Agent, or will it break with future changes?
Thanks!The error happens while the agent tries to enumerate the KB's MCP tools, so the agent never reaches knowledge_base_retrieve and can't answer anything grounded on the knowledge base.
Environment
- Microsoft Foundry Agent Service, no-code Prompt Agent (portal, ai.azure.com)
- Foundry IQ Knowledge Base built on Azure AI Search (Standard tier), hybrid + semantic retrieval, system-assigned managed-identity auth, indexing blob documents
- KB chat model:
gpt-5.4-mini; vectorizer: text-embedding-ada-002
- Foundry project region: Sweden Central; Azure AI Search region: France Central
- MCP API version:
2026-05-01-preview
What I expected
Asking the Prompt Agent a question should trigger the KB's managed MCP tool (knowledge_base_retrieve) and return a grounded answer with citations, as described in the Foundry IQ docs.
What actually happens
Every prompt fails immediately with the 406 above — the agent can't list its tools, so it never calls the knowledge base. I traced the root cause to a missing Accept header in the internal MCP client used by the native Knowledge attachment.
Isolation / evidence (direct probe of the KB MCP endpoint)
I called the KB MCP endpoint directly (.../knowledgebases/<kb-name>/mcp?api-version=2026-05-01-preview, bearer token for audience https://search.azure.com/.default) and ran initialize:
-
Accept: application/json, text/event-stream → 200 OK (SSE stream, initialize responds correctly)
-
Accept: application/json (only) → 406 Not Acceptable (identical to the playground error)
So the endpoint itself is healthy and MCP-compliant. The failure is in the portal runtime client for the native Foundry IQ attachment, which sends Accept: application/json without text/event-stream.
The connection the portal creates for the native attach looks correct per the docs: metadata.type = knowledgeBase_MCP, authType = ProjectManagedIdentity, audience = https://search.azure.com (the project managed identity has Search Index Data Reader on the search service).
Workaround I found (works, but feels unsupported)
- Remove the Foundry IQ attachment under Knowledge.
- Add the same endpoint as a Custom MCP (Tools > Add > Model Context Protocol). This client (
metadata.type = custom_MCP) does send both Accept headers, so it passes the 406.
- The Microsoft Entra auth option on that flow creates
authType = AgenticIdentityToken, which has no role on Search → 403. I had to change the connection to authType = ProjectManagedIdentity (keeping audience = https://search.azure.com) via az rest PUT on the connection, since the portal doesn't expose that change.
After that, asking the agent a question lists and calls knowledge_base_retrieve correctly end to end.
Questions
- Is the 406 in the native Knowledge > Add (Foundry IQ /
knowledgeBase_MCP) path a known bug in the current preview (missing text/event-stream in the client's Accept header)? Is a fix planned?
- Is there a supported configuration to make the native Foundry IQ attachment work with a no-code Prompt Agent, so I don't need the custom-MCP +
az rest workaround?
- Is the
custom_MCP + ProjectManagedIdentity approach a supported pattern for connecting a Foundry IQ Knowledge Base to a Prompt Agent, or will it break with future changes?
Thanks!