Skip to content

Add VNet enterprise tests for Foundry IQ KB MCP server#545

Open
farzad528 wants to merge 6 commits intomicrosoft-foundry:mainfrom
farzad528:vnet-foundry-iq-kb-mcp-testing
Open

Add VNet enterprise tests for Foundry IQ KB MCP server#545
farzad528 wants to merge 6 commits intomicrosoft-foundry:mainfrom
farzad528:vnet-foundry-iq-kb-mcp-testing

Conversation

@farzad528
Copy link

Summary

Adds test scripts and infrastructure for validating the Foundry IQ Knowledge Base MCP server with Azure AI Foundry Agent Service V2 in a VNet/private endpoint scenario (template 19).

This mirrors the testing approach from #450 but specifically targets the Foundry IQ KB MCP server and Azure AI Search Knowledge Base API (\2025-11-01-preview).

New Files

File Purpose
\ oundry-iq-kb-mcp/Dockerfile\ Node 22 multi-stage container image for the MCP server
\ ests/create_sample_kb.py\ Seeds AI Search with 12 sample KB documents (SharePoint, index, web)
\ ests/test_kb_api_connectivity.py\ 5 direct REST tests against AI Search KB API
\ ests/test_foundry_iq_kb_mcp.py\ 4 Agent V2 integration tests via MCP tool
\ ests/TESTING-GUIDE-KB-MCP.md\ Full testing guide with VNet setup and troubleshooting

Architecture

\
Test Client → Agent Service → Data Proxy → (networkInjection) → VNet
├── Foundry IQ KB MCP Server (Container App)
└── Azure AI Search (Private Endpoint)
\\

Key finding: The MCP server must be containerized inside the VNet when AI Search has public access disabled, because the MCP server makes direct HTTP \ etch()\ calls to the AI Search KB API endpoint. A hosted MCP server (e.g., on Vercel) cannot reach private endpoints.

Test Coverage

  • MCP Connectivity: Direct HTTP session flow (initialize → tools/list → tools/call for \knowledge_base_retrieve)
  • KB Retrieve via Agent V2: Create agent with MCPTool → query KB → validate results
  • SharePoint Headers: Verify \x-ms-sharepoint-*\ header passthrough
  • Multi-Source Retrieval: Results from SharePoint, search index, and web sources
  • KB API Direct Tests: Endpoint reachability, index query, semantic search

Related

djetchev and others added 6 commits February 19, 2026 13:26
…sources)

- Reverted 15-private-network-standard-agent-setup to match upstream/main exactly
- Added 19-hybrid-private-resources-agent-setup: hybrid architecture with public
  AI Services endpoint and private backend resources (AI Search, Cosmos DB, Storage)
- Template 19 enables portal-based agent testing while keeping data resources private
- Includes TESTING-GUIDE.md, test scripts, and architecture diagrams in template 19
Updates based on actual testing:
- Fixed SDK usage: use AzureAISearchTool class, not dict format
- Added note about portal limitation with network injection
- Added correct API version (2025-05-15-preview) for REST API
- Added MCP HTTP server implementation (Streamable HTTP transport)
- Updated MCP deployment instructions with proper HTTP-based server
- Added connection name lookup command
- Fixed test script to use AzureAISearchTool class

MCP Server:
- Added mcp-http-server/server.py - Flask-based MCP server
- Added mcp-http-server/Dockerfile for containerization
- Implements JSON-RPC over HTTP as required by Azure AI Agents
Add test scripts and infrastructure for validating the Foundry IQ Knowledge
Base MCP server with Azure AI Foundry Agent Service V2 in a VNet/private
endpoint scenario (template 19).

New files:
- foundry-iq-kb-mcp/Dockerfile: Container image for the MCP server
- tests/create_sample_kb.py: Seed AI Search with sample KB data
- tests/test_kb_api_connectivity.py: Direct REST tests against AI Search KB API
- tests/test_foundry_iq_kb_mcp.py: Agent V2 integration tests via MCP tool
- tests/TESTING-GUIDE-KB-MCP.md: Full testing guide with VNet setup guidance

The MCP server must be containerized inside the VNet when AI Search has
public access disabled, as it makes direct HTTP calls to the KB API endpoint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Covers 11 enterprise scenarios with pre-configured variables:
1. Public (basic), 2. PNA disabled, 3. VNet injection,
4. PNA+PLE+VPN, 5. CMK, 6. Custom subdomain,
7. Disable local auth, 8. RBAC only, 9. UAI,
10. BYO Storage, 11. Actionable error messaging

Use with VS Code REST Client extension.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments