Appearance
Opensure MCP Quickstart Guide
Welcome to Opensure MCP! This guide will walk you through setting up the Opensure Model Context Protocol (MCP) server to manage insurance clients and policies directly from Claude Desktop.
What is Opensure MCP?
Opensure MCP is a Model Context Protocol server that enables AI assistants like Claude to interact with your insurance CRM data. Think of it as "the HTTP of insurance operations" – a foundational protocol for AI-powered insurance workflows.
Key Features
- 🔐 Multi-tenant isolation – Your data stays completely separate from other brokers
- 🗄️ Your own database – Data stored in your Supabase (PostgreSQL) instance
- 🔑 Secure authentication – API key-based access with bcrypt hashing
- 📊 Full CRUD operations – Create, read, update, and list clients and policies
- 🚀 Serverless-ready – Optimized for Vercel and serverless deployments
Prerequisites
Before you begin, you'll need:
- ✅ A Supabase account (free tier works)
- ✅ Node.js v18 or higher
- ✅ Claude Desktop installed
- ✅ An Opensure account (sign up at app.opensure.dev)
Step 1: Create Your Opensure Account
- Go to https://app.opensure.dev/signup
- Enter your email and create a password
- Verify your email address (check your inbox for verification code)
- Log in to your dashboard
Note: Your tenant ID is automatically created during signup. This isolates your data from other users.
Step 2: Generate Your API Key
API keys authenticate the MCP server with your Opensure account.
From the Dashboard:
- Navigate to Settings → API Keys (
/api-keys) - Click "Create New Key"
- Select scope:
- Read + Write (Recommended) – Full access to create and update data
- Read Only – Query data only, no modifications
- Click "Generate Key"
- ⚠️ IMPORTANT: Copy the key immediately – it's shown only once!
Your API Key Format:
osk_a1b2c3d4_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- Prefix:
osk_(Opensure Key) - First segment: 8 random characters (visible in dashboard)
- Second segment: 48 random characters (secret)
Security Notes:
- ✅ Keys are hashed with bcrypt (plaintext never stored)
- ✅ Keys are tenant-scoped (can only access your data)
- ✅ Keys can be revoked anytime from the dashboard
- ❌ Never commit keys to git or share publicly
Step 3: Set Up Your Supabase Database
Opensure MCP stores data in your own Supabase PostgreSQL database.
3.1 Create a Supabase Project
- Go to https://supabase.com/dashboard
- Click "New Project"
- Fill in project details:
- Name:
opensure-mcp(or your choice) - Database Password: Choose a strong password (save it!)
- Region: Select closest to you
- Name:
- Click "Create new project" (takes ~2 minutes)
3.2 Get Your Database Connection URL
- In your Supabase project, go to Settings → Database
- Scroll to "Connection string"
- Select "Connection pooling" tab (recommended for serverless)
- Copy the URI format:
postgresql://postgres.xxxxxxxxxxxxx:[YOUR-PASSWORD]@aws-0-us-west-1.pooler.supabase.com:6543/postgres- Replace
[YOUR-PASSWORD]with your actual database password
Why pooled connection?
- ✅ Better for serverless environments (Vercel, AWS Lambda)
- ✅ Handles connection limits automatically
- ✅ Faster cold starts
3.3 Configure Database in Opensure Dashboard
- Navigate to Settings → Database (
/database) - Paste your connection URL
- Select "Pooled" connection type
- Click "Test Connection" to verify
- Click "Save Configuration" once test passes
Step 4: Run Database Migrations
The MCP server needs database tables for clients and policies. Run the migration command to set up your schema.
4.1 Run Migration Command
Open your terminal and run:
bash
npx @opensure/mcp-migrate --api-key=osk_xxx --database-url=postgresql://...Parameters:
--api-key– Your Opensure API key (from Step 2)--database-url– Your Supabase connection URL (from Step 3.2)
4.2 What Gets Created
The migration creates two tables in your Supabase database:
mcp_clients table:
uuid(primary key)tenant_id(your isolation key)name,email,phone,addresscreated,modifiedtimestamps- Indexes on
(tenant_id, created)
mcp_policies table:
uuid(primary key)tenant_id(your isolation key)client_uuid(foreign key to clients)policy_number(auto-generated:POL-{tenant_prefix}-{counter})- 40 fields total (coverage, premiums, dates, etc.)
- Indexes on
(tenant_id, created),(tenant_id, policy_number)
schema_migrations table:
- Tracks applied migrations (ensures idempotency)
- Re-running migrations is safe – already-applied migrations are skipped
4.3 Verify in Supabase
- Go to Supabase → Table Editor
- You should see 3 new tables:
mcp_clientsmcp_policiesschema_migrations
Step 5: Configure Claude Desktop
Now let's connect Claude Desktop to your Opensure MCP server.
5.1 Locate Claude Config File
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json5.2 Add Opensure MCP Server
Edit the config file and add the Opensure MCP server:
json
{
"mcpServers": {
"opensure": {
"command": "npx",
"args": ["-y", "@opensure/mcp-server-stdio"],
"env": {
"OPENSURE_API_KEY": "osk_a1b2c3d4_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // pragma: allowlist secret
"DATABASE_URL": "postgresql://postgres.xxxxxxxxxxxxx:[YOUR-PASSWORD]@aws-0-us-west-1.pooler.supabase.com:6543/postgres"
}
}
}
}Replace:
OPENSURE_API_KEYwith your actual API key (from Step 2)DATABASE_URLwith your Supabase connection URL (from Step 3.2)
5.3 Restart Claude Desktop
- Quit Claude Desktop completely
- Relaunch Claude Desktop
- Look for the 🔌 MCP icon in the bottom-right
- You should see "opensure" listed as a connected server
Step 6: Create Your First Client
Let's test the MCP server by creating a client record.
6.1 Ask Claude to Create a Client
In Claude Desktop, type:
Create a new insurance client named "Apex Manufacturing Ltd" with email [email protected] and phone 416-555-01236.2 What Happens Behind the Scenes
- Claude calls
client.createtool with your parameters - MCP server validates API key via Opensure backend
- Tenant ID extracted from validated API key
- Record inserted into
mcp_clientstable in your Supabase - UUID auto-generated for the client
- Response returned to Claude with client details
6.3 Expected Response
Claude will respond with something like:
✓ Client created successfully!
Client Details:
- Name: Apex Manufacturing Ltd
- UUID: 01HTABC123XYZ456789...
- Email: [email protected]
- Phone: 416-555-0123
- Created: 2025-10-27T15:30:00ZStep 7: Verify in Supabase
Let's confirm the data was actually saved to your database.
7.1 View in Supabase Table Editor
- Go to Supabase → Table Editor
- Click on
mcp_clientstable - You should see your new client record:
| uuid | tenant_id | name | phone | created | |
|---|---|---|---|---|---|
| 01HT... | your_tenant_id | Apex Manufacturing Ltd | [email protected] | 416-555-0123 | 2025-10-27... |
7.2 Verify Tenant Isolation
Notice the tenant_id column – this ensures your data is isolated from other users. Even if someone else creates a client with the same name, they'll have a different tenant_id.
Next Steps
🎉 Congratulations! You've successfully set up Opensure MCP. Here's what you can do next:
Available MCP Tools
Client Management:
client.create– Create a new clientclient.get– Retrieve client by UUIDclient.list– List all clients (paginated, sorted by created DESC)client.update– Update client details
Policy Management:
policy.create– Create a new policy (auto-generates policy number)policy.get– Retrieve policy by UUIDpolicy.list– List all policies (paginated, supports status filter)policy.update– Update policy status, premium, coverage, etc.
Example Commands
List all clients:
Show me all my insurance clientsCreate a policy:
Create a General Liability policy for client UUID 01HTABC123... with $2,000,000 coverage limit and $3,500 annual premiumUpdate a client:
Update client 01HTABC123... to add address "123 Main St, Toronto, ON M5V 3A8"Search policies:
Show me all active policies with premium over $5,000Troubleshooting
MCP Server Not Showing in Claude Desktop
Symptoms:
- No 🔌 icon in bottom-right of Claude Desktop
- "opensure" server not listed
Solutions:
- Verify
claude_desktop_config.jsonsyntax is valid JSON - Check file path is correct for your OS
- Restart Claude Desktop completely (quit and relaunch)
- Check Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\logs\mcp*.log
- macOS:
API Key Validation Failed
Symptoms:
- Error: "Invalid API key" or "Authentication failed"
Solutions:
- Verify API key copied correctly (no extra spaces)
- Check key is active in dashboard (Settings → API Keys)
- Ensure key has correct scope (write access needed for create operations)
- Generate a new key if needed
Database Connection Failed
Symptoms:
- Error: "Connection refused" or "Connection timeout"
Solutions:
- Verify database URL copied correctly
- Check password replaced
[YOUR-PASSWORD]placeholder - Test connection in dashboard (Settings → Database → Test Connection)
- Verify Supabase project is not paused (free tier pauses after inactivity)
- Check Supabase project region matches connection string
Migration Already Applied
Symptoms:
- Migration command says "Already applied"
Solutions:
- This is normal – migrations are idempotent
- If you need to re-apply, manually delete from
schema_migrationstable - Or start fresh by dropping all MCP tables (⚠️ deletes data!)
Tenant ID Mismatch
Symptoms:
- Can't see records you created
- "No records found" when you know they exist
Solutions:
- Verify using same API key that created the records
- Check
tenant_idin Supabase matches your API key's tenant - Each API key is tied to one tenant – switching keys changes data visibility
Security Best Practices
API Key Management
✅ DO:
- Store keys in environment variables or secure vaults
- Use different keys for development vs production
- Revoke compromised keys immediately
- Rotate keys periodically (every 90 days)
❌ DON'T:
- Commit keys to git repositories
- Share keys in public channels
- Use same key across multiple environments
- Store keys in plaintext files
Database Security
✅ DO:
- Use connection pooling for production
- Enable Row-Level Security (RLS) in Supabase (optional extra layer)
- Regularly backup your Supabase database
- Monitor database connection limits
❌ DON'T:
- Use direct connections in serverless environments
- Share database credentials
- Expose database publicly without firewall rules
Architecture Overview
┌─────────────────┐
│ Claude Desktop │
│ │
│ User: "Create │
│ client Acme" │
└────────┬────────┘
│
│ MCP Protocol (stdio)
│
▼
┌─────────────────────────┐
│ @opensure/mcp-server │
│ (Running via npx) │
│ │
│ 1. Validate API key │────┐
│ 2. Extract tenant_id │ │
│ 3. Execute query │ │
└────────┬────────────────┘ │
│ │
│ │ HTTPS
▼ │
┌─────────────────────────┐ │
│ Your Supabase DB │ │
│ (PostgreSQL) │ │
│ │ │
│ - mcp_clients │ │
│ - mcp_policies │ │
│ - schema_migrations │ │
└─────────────────────────┘ │
│
▼
┌──────────────────────┐
│ api.opensure.dev │
│ (Django REST API) │
│ │
│ Validates API keys │
│ Returns tenant_id │
└──────────────────────┘Data Flow
- User types command in Claude Desktop
- Claude identifies tool to use (e.g.,
client.create) - MCP server receives request via stdio transport
- API key validated with Opensure backend
- Tenant ID extracted from validation response
- Query executed with automatic
tenant_idfiltering - Results returned to Claude
- Claude formats response for user
Multi-Tenancy Enforcement
Every database query automatically includes WHERE tenant_id = $1:
sql
-- Example client.list query
SELECT * FROM mcp_clients
WHERE tenant_id = $1 -- Your tenant ID injected automatically
ORDER BY created DESC
LIMIT 100;This ensures you can ONLY access your own data, even if another user has records with the same name or email.
Support & Resources
Documentation
- Opensure Docs: docs.opensure.dev
- MCP Protocol Spec: modelcontextprotocol.io
- Supabase Docs: supabase.com/docs
Community
- Discord: discord.gg/opensure
- GitHub Issues: github.com/opensure-mcp/Opensure-MCP/issues
- Email Support: [email protected]
Changelog
- v2.0.0 – Multi-tenant architecture, Supabase support, dashboard UI
- v1.0.0 – Initial MCP server release
Frequently Asked Questions
Q: Is my data stored in Opensure's servers?
A: No! Your client and policy data is stored in your own Supabase database. Opensure only stores:
- Your account credentials (email, hashed password)
- API key metadata (prefix, hash, tenant ID)
- Database connection settings (connection URL)
Q: Can other users see my data?
A: No. Every query is automatically filtered by tenant_id, ensuring complete isolation between tenants. Even Opensure admins cannot see your client/policy data without your Supabase credentials.
Q: What happens if I delete my Supabase project?
A: Your MCP server will stop working (connection errors). Your Opensure account remains active. You can create a new Supabase project, update the connection settings, and re-run migrations.
Q: Can I use a different database (not Supabase)?
A: Currently, only PostgreSQL via Supabase is supported. Support for other PostgreSQL providers (AWS RDS, Google Cloud SQL) is planned for v2.1.
Q: How much does Opensure MCP cost?
A: Opensure has a free tier for development and small teams. Check opensure.dev/pricing for current plans. Supabase also has a generous free tier (500MB database, 2GB bandwidth).
Q: Can I self-host the MCP server?
A: The MCP server is distributed via npm and runs locally on your machine (via npx). There's nothing to self-host – it's already client-side. The Django backend (API key validation) is hosted by Opensure.
Happy building! 🚀
Last updated: October 2025
