Insurance MCP Demo
README.md
# Insurance MCP Demo
A demonstration project that showcases how to build an AI-powered insurance assistant using the **Model Context Protocol (MCP)**. The client uses an LLM (Qwen running locally through Ollama) to determine which MCP tools to call, executes those tools, and then generates a natural language response.
## Features
* š MCP server built with **FastMCP**
* š» MCP client using **stdio transport**
* š Dynamic tool discovery (`list_tools`)
* š ļø Automatic tool selection using **Qwen**
* š MCP tool execution with `call_tool`
* š¤ Natural language response generation
* š¦ Local LLM integration with **Ollama**
* š¦ Insurance domain demo with customer, policy, premium, claim, fraud detection, and policy renewal tools
## Project Structure
```text
.
āāā client.py # MCP client and AI orchestration
āāā server.py # MCP server exposing insurance tools
āāā requirements.txt
āāā .env.example
āāā README.md
```
## Available MCP Tools
| Tool | Description |
| ------------------ | ---------------------------------- |
| `get_customer` | Retrieve customer information |
| `get_policy` | Retrieve policy details |
| `get_claim_status` | Check insurance claim status |
| `get_premium_due` | View premium due for a customer |
| `run_fraud_check` | Perform fraud risk analysis |
| `renew_policy` | Renew an inactive insurance policy |
## Requirements
* Python 3.10+
* Ollama
* Qwen 2.5 model
## Installation
Clone the repository:
```bash
git clone https://github.com/<your-username>/insurance-mcp-demo.git
cd insurance-mcp-demo
```
Install dependencies:
```bash
pip install -r requirements.txt
```
Install the Qwen model:
```bash
ollama pull qwen2.5:3b
```
Start Ollama:
```bash
ollama serve
```
## Running the Project
```bash
python client.py
```
The client will:
1. Launch the MCP server.
2. Perform the MCP handshake.
3. Discover available tools.
4. Ask the LLM which tools should be used.
5. Execute the selected MCP tools.
6. Generate a user-friendly response.
## Example Queries
```text
What is the status of claim CL001?
Is there any fraud risk on claim CL003?
Show me the details for policy P1002.
Please renew policy P1003.
Tell me about customer C002 and their policy.
Run a fraud check on claim CL002 and show me the claim status.
```
## Technologies Used
* Python
* FastMCP
* Model Context Protocol (MCP)
* Ollama
* Qwen 2.5
* httpx
* Rich
## Future Improvements
* Support multiple LLM providers
* Add conversation memory
* Integrate a real insurance database
* Add authentication and authorization
* Containerize with Docker
* Build a web interface using Streamlit or FastAPI
* Add unit and integration tests
## License
This project is intended for educational and demonstration purposes.
This server cannot be deployed
Maintenance
ActivityStale
ResponsivenessNo issues