@opensure-mcp/mcp-server-stdio
v2.2.0
Published
Opensure MCP Server - Multi-tenant insurance CRM with API key authentication
Downloads
597
Maintainers
Readme
Opensure MCP Server v2.0.0
Multi-tenant insurance CRM MCP server for Model Context Protocol clients (Claude Desktop, etc.).
Features
- Multi-Tenant Isolation: Automatic tenant_id filtering on ALL queries
- API Key Authentication: Secure authentication with Opensure backend
- 8 CRUD Tools: Complete client and policy management
- Idempotent Migrations: Safe database schema setup with version tracking
- PostgreSQL Support: Works with Supabase, AWS RDS, or any PostgreSQL provider
Quick Start
1. Install
npm install -g @opensure/mcp-server-stdio2. Get API Key
Sign up at https://app.opensure.dev and generate an API key from Settings → API Keys.
3. Set Environment Variables
export OPENSURE_API_KEY="osk_xxxxxxxx_..." # pragma: allowlist secret
export DATABASE_URL="postgresql://user:password@host:port/database" # pragma: allowlist secret4. Run Migrations
npx opensure-mcp-migrate \
--api-key=$OPENSURE_API_KEY \
--database-url=$DATABASE_URLThis creates mcp_clients and mcp_policies tables with tenant_id isolation.
5. Configure Claude Desktop
Add to your Claude Desktop MCP settings (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"opensure": {
"command": "npx",
"args": ["-y", "@opensure/mcp-server-stdio"],
"env": {
"OPENSURE_API_KEY": "osk_xxxxxxxx_...", // pragma: allowlist secret
"DATABASE_URL": "postgresql://..."
}
}
}
}6. Test in Claude
"Create a client named 'Apex Manufacturing Ltd' with email [email protected]"Claude will use the client.create tool to create the client in your database.
Available Tools
Client Tools (4)
- client.create: Create a new client
- client.get: Get client by UUID
- client.list: List clients (max 100)
- client.update: Update client information
Policy Tools (4)
- policy.create: Create a new policy (auto-generates policy_number)
- policy.get: Get policy by UUID
- policy.list: List policies with optional status filter
- policy.update: Update policy information
Multi-Tenant Security
CRITICAL: All tools automatically enforce tenant_id isolation.
- API key validation returns your
tenant_id - Every query includes
WHERE tenant_id = $extracted_from_api_key - Cross-tenant data access is IMPOSSIBLE (database-level enforcement)
Example: Tenant A cannot read/write Tenant B's clients or policies.
Database Schema
mcp_clients
CREATE TABLE mcp_clients (
id UUID PRIMARY KEY,
uuid UUID UNIQUE NOT NULL,
tenant_id VARCHAR(26) NOT NULL,
name VARCHAR(255) NOT NULL,
email VARCHAR(255),
phone VARCHAR(50),
company VARCHAR(255),
address TEXT,
city VARCHAR(100),
region VARCHAR(100),
country VARCHAR(100),
postal_code VARCHAR(20),
created TIMESTAMPTZ,
modified TIMESTAMPTZ
);mcp_policies
CREATE TABLE mcp_policies (
id UUID PRIMARY KEY,
uuid UUID UNIQUE NOT NULL,
tenant_id VARCHAR(26) NOT NULL,
client_id UUID REFERENCES mcp_clients(id),
policy_number VARCHAR(50),
status VARCHAR(20),
start_date DATE,
end_date DATE,
premium DECIMAL(12,2),
service_fee DECIMAL(12,2),
-- ... 40 total fields
created TIMESTAMPTZ,
modified TIMESTAMPTZ
);Development
Build from Source
git clone https://github.com/opensure-mcp/Opensure-MCP.git
cd Opensure-MCP/mcp-server
npm install
npm run buildRun Locally
export OPENSURE_API_KEY="osk_xxx" # pragma: allowlist secret
export DATABASE_URL="postgresql://..."
npm run devArchitecture
Claude Desktop (MCP Client)
↓ stdio (JSON-RPC 2.0)
@opensure/mcp-server-stdio (This Package)
↓ HTTP (API Key Validation)
Opensure API (api.opensure.dev)
← Returns tenant_id
@opensure/mcp-server-stdio
↓ PostgreSQL (tenant_id filtered queries)
Your PostgreSQL Database (Supabase, AWS RDS, etc.)Support
- Documentation: https://docs.opensure.dev
- Issues: https://github.com/opensure-mcp/Opensure-MCP/issues
- Discord: https://discord.opensure.dev
License
UNLICENSED - Proprietary software. Contact [email protected] for licensing.
Version History
v2.0.0 (2025-10-27)
- 🎉 Fresh build with multi-tenant architecture
- ✅ API key authentication (replaces v1 DATABASE_URL)
- ✅ 8 CRUD tools (client + policy)
- ✅ Automatic tenant_id injection (security by design)
- ✅ Idempotent migrations with tracking
- ✅ Auto-generate policy_number and policyholder
- ✅ TypeScript rewrite with strict types
v1.0.0 (Legacy)
- Single-tenant DATABASE_URL authentication (deprecated)
- 12 tools (policy, client, compliance, system)
- No multi-tenancy support
