Contoso Insurance MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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 toolPublic "Talk to Sam" page at
/, where anyone can talk to that voice agent, avatar included, from the browser

Every response includes a short summary written to be spoken aloud, which keeps realtime voice
agents (e.g. gpt-realtime) fast and natural.
Browser (/) ── mic over WebSocket ──▶ /voice/ws relay (managed identity, call limits)
▲ │
└── avatar video + voice over WebRTC ──── Foundry voice agent (gpt-realtime, HD voice, avatar)
│ MCP over HTTPS (/mcp, x-api-key)
▼
Azure Container Apps: FastAPI + FastMCP
│
InsuranceService ──▶ in-memory seed data (swap for Cosmos DB / SQL)The relay, MCP server and REST API are one container app; Application Insights traces all three.
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)"
# Windows PowerShell: azd env set MCP_API_KEY ([guid]::NewGuid().ToString("N") + [guid]::NewGuid().ToString("N"))
azd up # pick subscription + region
azd env get-value MCP_ENDPOINT # e.g. https://ca-insurance-xxxx.<region>.azurecontainerapps.io/mcpTelemetry goes to the Application Insights resource appi-<token> (azd env get-value APPLICATIONINSIGHTS_NAME).
Requests and dependencies are collected automatically, and each MCP tool call appears as an
mcp.tool <name> span, marked failed when the tool returns an error. Locally, telemetry is off unless
APPLICATIONINSIGHTS_CONNECTION_STRING is set.
Public voice demo page
The app's home page (/) is a public "Talk to Sam" page: visitors talk to your Foundry voice agent,
with its avatar, straight from the browser. The browser streams microphone audio to /voice/ws, and
the app relays it to the Foundry voice agent's realtime endpoint using its managed identity, so no Azure key or
token ever reaches the visitor. The relay only forwards audio, interruptions and the avatar handshake;
visitors can't change the agent's instructions or tools.
It needs a Foundry voice agent (kind: voice), the kind with a voice, avatar and greeting
configured in Foundry. The relay connects to that agent's realtime route,
/api/projects/<project>/agents/<agent>/endpoint/protocols/voice. Point it at your agent, then run
azd up again:
azd env set FOUNDRY_RESOURCE_NAME <foundry-resource> # e.g. arul1
azd env set FOUNDRY_RESOURCE_GROUP <its-resource-group> # e.g. rg_aml
azd env set FOUNDRY_PROJECT_NAME <project> # e.g. proj-default
azd env set VOICE_AGENT_NAME <agent-name>
azd up
azd env get-value VOICE_DEMO_URLThis grants the app's identity Foundry User (formerly Azure AI User) and Cognitive Services User on the Foundry
resource, so the account running azd up needs permission to assign roles there (Owner or User
Access Administrator).
Because the page is public, every call is capped. Defaults, overridable as container app env vars:
Variable | Default | Meaning |
| 180 | Calls end automatically after this long |
| 2 | Simultaneous callers |
| 40 | Calls per UTC day, across all visitors |
| 4 | Calls per IP address per hour |
| (any) | Comma-separated origins allowed to open the WebSocket |
The voice, avatar, greeting and instructions all come from the agent's configuration in Foundry; change them there. If the avatar can't connect (for example on a network that blocks WebRTC), the call continues with voice only.
After code changes, azd deploy updates just the app, which is faster than azd up.
Troubleshooting. The page logs every non-audio event from the agent to the browser console as
[voice] <event type> <json>, and the relay records errors and empty responses in Application Insights.
Sam greets you but never hears you: turn off Echo cancellation in the agent's Advanced settings (see docs/foundry-agent-instructions.md). The relay also asks the service to switch it to a server reference for each call, and the page sends the two-channel audio that mode expects if the setting stays on.
Every response is empty (0 tokens): the agent isn't a voice agent, or the relay is pointed at the wrong project or agent name.
Continuous 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, apply the settings listed there, then Save and try it in the voice playground using the demo callers.
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)
telemetry.py Application Insights setup and per-tool MCP spans
voice.py Public voice demo: relay to the Foundry voice agent, with call limits
static/ "Talk to Sam" page (HTML, CSS, mic capture, WebRTC avatar)
data/seed.json Fictional customers, policies, billing, claims
infra/ Bicep for Container Apps, ACR, Log Analytics, Application Insights, managed identity
docs/ Foundry agent instructions and demo script
tests/ pytest: service, REST, MCP, telemetry and voice relay testsNotes
All data is fictional. Claims and callbacks you create are stored in memory and reset on restart; the app runs as at most one replica for that reason. It scales to zero when idle, so the first visitor (or the agent's first tool call) after a quiet spell waits a few seconds for it to start, and in-memory data and call counts reset then. 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.
The voice page is public and every call costs money (realtime model, neural voice and avatar minutes). Keep the call limits in place, and tighten
VOICE_DAILY_SESSION_LIMITif you share the link widely.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Voice agents that book into the software your clients actually run, built and audited from chat.
Build and manage voice AI agents for real phone lines: assistants, calls, numbers and campaigns.
Build, call and manage AI voice agents on real phone calls.
AI voice agents that place and answer phone calls, with transcripts and outcomes.
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.102MIT
- 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