Contoso Insurance MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Contoso Insurance MCP ServerCheck if my homeowners policy covers a burst pipe"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Contoso Insurance API + MCP Server
A demo insurance policy servicing and claims API built with FastAPI and FastMCP. The same business logic is exposed two ways:
REST API at
/api/...with Swagger UI at/docsMCP server (Streamable HTTP) at
/mcp, ready to plug into a Microsoft Foundry voice agent as an MCP tool
Every response includes a short summary written to be spoken aloud, which keeps realtime voice
agents (e.g. gpt-realtime) fast and natural.
Caller ── voice ──▶ Foundry agent (gpt-realtime + Azure voice)
│ MCP over HTTPS (/mcp, x-api-key)
▼
Azure Container Apps: FastAPI + FastMCP
│
InsuranceService ──▶ in-memory seed data (swap for Cosmos DB / SQL)MCP tools
Tool | What it does |
| Look up a customer by name, phone, email or policy number (returns masked PII) |
| Verify the caller with policy number + date of birth + ZIP |
| All policies for a verified customer |
| Status, term, vehicles/property, coverages, limits, deductibles, exclusions |
| "Am I covered for…?" Maps a plain-language incident to the coverage, deductible and limit |
| Amount due, due date, past-due balance, autopay, payment options |
| Claims on a policy with status |
| Claim status, adjuster, estimate, payments, next step, timeline |
| First notice of loss; returns claim number, adjuster, next steps |
| Add info (e.g. police report number) to a claim |
| Schedule a licensed human agent callback |
Related MCP server: hawksoft-mcp
REST endpoints
Method | Path |
GET |
|
GET |
|
POST |
|
GET |
|
GET |
|
GET |
|
GET |
|
GET |
|
GET |
|
POST |
|
POST |
|
POST |
|
Run locally
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements-dev.txt
pytest -q
uvicorn app.main:app --reloadSwagger: http://localhost:8000/docs
MCP endpoint: http://localhost:8000/mcp
Test the MCP server with the MCP Inspector:
npx @modelcontextprotocol/inspector
# Transport: Streamable HTTP, URL: http://localhost:8000/mcpOptional: export API_KEY=some-long-random-value to require an x-api-key header on /api and /mcp.
Or with Docker:
docker build -t insurance-mcp-api .
docker run -p 8000:8000 -e API_KEY=change-me insurance-mcp-apiDeploy to Azure Container Apps
Prerequisites: Azure Developer CLI (azd) and an Azure subscription. No local Docker needed — azd builds the image remotely in Azure Container Registry.
azd auth login
azd env new insurance-mcp # any environment name
azd env set MCP_API_KEY "$(openssl rand -hex 24)"
azd up # pick subscription + region
azd env get-value MCP_ENDPOINT # e.g. https://ca-insurance-xxxx.<region>.azurecontainerapps.io/mcpContinuous deployment from GitHub
azd pipeline config # sets up OIDC + repo variables for .github/workflows/azure-dev.yml
gh secret set MCP_API_KEY --body "$(azd env get-value MCP_API_KEY)"Every push to main then runs tests (ci.yml) and redeploys (azure-dev.yml).
Connect it to the Foundry agent
In Microsoft Foundry, open the agent → Tools → Add a MCP tool (custom / remote MCP server).
Name:
contoso-insurance; Remote MCP server endpoint: theMCP_ENDPOINTvalue from above.Authentication: key-based, header name
x-api-key, value = yourMCP_API_KEY.Approval: set to never require approval for the demo, so the voice conversation isn't interrupted.
Paste the instructions and greeting from docs/foundry-agent-instructions.md, then Save and try it in the voice playground using the demo callers listed there.
Project layout
app/
main.py FastAPI app, mounts MCP at /mcp, API-key middleware
mcp_server.py FastMCP tool definitions
api.py REST routes
services.py Business logic (shared by REST + MCP)
repository.py In-memory store loaded from data/seed.json
security.py Optional x-api-key check (pure ASGI, streaming-safe)
data/seed.json Fictional customers, policies, billing, claims
infra/ Bicep for Container Apps, ACR, Log Analytics, managed identity
docs/ Foundry agent instructions and demo script
tests/ pytest: service, REST and MCP testsNotes
All data is fictional. Claims and callbacks you create are stored in memory and reset on restart; the app runs as a single replica for that reason. Replace
InMemoryRepositorywith a Cosmos DB or SQL implementation for anything beyond a demo.Identity verification is a demo pattern (DOB + ZIP), not production-grade authentication.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Build and manage voice AI agents for real phone lines: assistants, calls, numbers and campaigns.
AI voice agents that place and answer phone calls, with transcripts and outcomes.
Sentiment, toxicity, entity extraction, PII, translation, summary, QA, fraud scoring, safety audit.
Give your AI agent a phone: place calls, navigate IVRs, wait on hold, get structured answers.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables management of insurance claims, inspections, and contractors through interactive UI widgets and data tools. Users can view claim dashboards, update statuses, and query service provider information using natural language.-
- AlicenseAqualityDmaintenanceEnables natural language interaction with HawkSoft insurance agency management data, including reading clients, policies, and claims, and writing log notes, attachments, and receipts.101MIT
- FlicenseNot gradedqualityDmaintenanceProvides an AI-powered insurance assistant with tools for customer, policy, claim, premium, fraud detection, and policy renewal operations.-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to place real phone calls, engage in spoken conversations across 12 languages, and report the outcomes for tasks like booking appointments, answering questions, negotiating, or confirming orders.MIT