MCP Server for Claude Code

Calculate U.S. surplus lines taxes directly in Claude Code without leaving your development environment. Our MCP (Model Context Protocol) server brings the full power of the Surplus Lines Tax API to your AI assistant.

What is MCP?

Model Context Protocol (MCP) is an open protocol developed by Anthropic that allows AI assistants like Claude to securely connect to external tools and data sources. With MCP, Claude can call APIs, access databases, and perform actions on your behalf—all within a natural conversation.

Why Use the MCP Server?

  • Stay in Flow — Calculate taxes without switching to a browser or separate tool
  • Natural Language — Just ask Claude: "What's the SL tax on a $50,000 premium in Texas?"
  • Full API Access — All 50 states + DC + territories, all coverage types
  • Instant Results — Get detailed breakdowns in seconds
  • Developer Friendly — Perfect for insurance software development
  • Automatic Fallback — Historical queries never fail, always return useful data

Prerequisites

Before installing the MCP server, ensure you have:

  1. Node.js 18+

    The MCP server requires Node.js 18 or later. Check your version:

    node --version
  2. Claude Code or Claude Desktop

    You need Claude Code (CLI) or Claude Desktop with MCP support enabled.

  3. API Key

    Get your API key at app.surpluslinesapi.com. New accounts include 100 free queries.

How It Works

The MCP server acts as a bridge between Claude and the Surplus Lines Tax API:

1

You Ask Claude
"Calculate surplus lines tax for $25,000 in California"

2

Claude Calls MCP Server
Invokes calculate_surplus_lines_tax tool

3

MCP Server Calls API
Authenticates and sends request to our API

4

Claude Responds
Presents results in a clear, readable format

Installation

Install the MCP server via npm:

Terminal
# Install globally (recommended)
npm install -g surplus-lines-tax-mcp

# Or install locally in your project
npm install surplus-lines-tax-mcp

The package is available on npm at npmjs.com/package/surplus-lines-tax-mcp

After Installation

The MCP server executable will be available as surplus-lines-tax-mcp. You can verify the installation by running:

surplus-lines-tax-mcp --help

Configuration

Add the MCP server to your Claude Code or Claude Desktop configuration.

Option 1: User Settings (All Projects)

Edit ~/.claude/settings.json to enable the server globally:

~/.claude/settings.json
{
  "mcpServers": {
    "surplus-lines-tax": {
      "command": "npx",
      "args": ["surplus-lines-tax-mcp"],
      "env": {
        "SLAPI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Option 2: Project Settings (Specific Project)

Create .claude/settings.local.json in your project root:

.claude/settings.local.json
{
  "mcpServers": {
    "surplus-lines-tax": {
      "command": "npx",
      "args": ["surplus-lines-tax-mcp"],
      "env": {
        "SLAPI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Keep Your API Key Secure

Never commit your API key to version control. Consider using environment variables or a secrets manager for production environments.

Claude Desktop Configuration

For Claude Desktop on macOS, edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "surplus-lines-tax": {
      "command": "npx",
      "args": ["surplus-lines-tax-mcp"],
      "env": {
        "SLAPI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Testing the Server

Verify your installation works by running the server directly:

Quick Test

# Test that the server starts (Ctrl+C to exit)
SLAPI_API_KEY="your-api-key" npx surplus-lines-tax-mcp

If configured correctly, the server will start and wait for MCP connections. Press Ctrl+C to exit.

Test with Claude Code

After configuring your settings, restart Claude Code and ask:

"Calculate the surplus lines tax for a $10,000 premium in Texas"

Expected response: Claude will return the tax calculation with state tax ($485), stamping fee ($18), and grand total ($10,503).

Tool: calculate_surplus_lines_tax

The main calculation tool. Returns detailed tax breakdowns for any state and premium amount.

Parameters

Parameter Type Required Description
state string Yes State name or 2-letter code (e.g., "Texas" or "TX", "California" or "CA")
premium number Yes Premium amount in USD
effective_date string No Date for historical tax calculation in YYYY-MM-DD format (e.g., '2024-06-15'). If omitted or if historical data is unavailable, uses current rates with a notice.
wet_marine boolean No Wet marine coverage (affects Alaska)
fire_insurance boolean No Fire insurance (affects SD, MT)
electronic_filing boolean No Electronic filing (affects MT stamping fee)
medical_malpractice boolean No Medical malpractice (exempt in PR)
workers_comp boolean No Workers compensation (exempt in VA)
year integer No Tax year (affects Iowa rates 2024-2027)
new_business boolean No New vs renewal policy (affects Oregon $10 fee)

Example Response

{
  "success": true,
  "state": "Texas",
  "state_code": "TX",
  "premium": 10000,
  "total_tax": 489,
  "total_due": 10489,
  "rates_from": "current",
  "breakdown": {
    "base_tax": { "rate": "4.85%", "amount": 485 },
    "stamping_fee": { "rate": "0.04%", "amount": 4 },
    "filing_fee": null,
    "service_fee": null,
    "surcharge": null,
    "regulatory_fee": null,
    "fire_marshal_tax": null,
    "slas_clearinghouse_fee": null,
    "flat_fee": null
  },
  "legislative_source": "https://statutes.capitol.texas.gov/docs/IN/htm/IN.225.htm",
  "account": {
    "balance": "0.00",
    "free_queries_remaining": 685,
    "was_free_query": true
  }
}

Tool: get_state_rate

Get tax rate information for a specific state. Supports current rates or historical rates with automatic fallback if historical data is unavailable. Each call costs $0.38.

Automatic Fallback

When you request historical rates, the tool automatically falls back to current rates if historical data isn't available for the requested date. You'll receive a clear indication when fallback occurs—no more errors!

Parameters

Parameter Type Required Description
state string Yes Full US state name (e.g., 'Texas', 'California', 'New York'). Case-insensitive.
effective_date string No Optional: Date for historical rates in YYYY-MM-DD format (e.g., '2024-06-15'). If omitted or if historical data is unavailable, returns current rates with a notice.

Example Response (Current Rate)

{
  "state": "Texas",
  "state_code": "TX",
  "tax_rate": "4.85%",
  "stamping_fee": "0.04%",
  "filing_fee": "",
  "service_fee": "",
  "surcharge": "",
  "regulatory_fee": "",
  "fire_marshal_tax": "",
  "slas_clearinghouse_fee": "",
  "flat_fee": "",
  "legislative_source": "https://statutes.capitol.texas.gov/docs/IN/htm/IN.225.htm",
  "confidence": "high",
  "data_source": "current_rate",
  "account": {
    "balance": "0.00",
    "free_queries_remaining": 684,
    "was_free_query": true
  }
}

Example Response (Historical Rate - Texas)

{
  "state": "Texas",
  "state_code": "TX",
  "tax_rate": "4.85%",
  "stamping_fee": "0.04%",
  "filing_fee": "",
  "service_fee": "",
  "surcharge": "",
  "regulatory_fee": "",
  "fire_marshal_tax": "",
  "slas_clearinghouse_fee": "",
  "flat_fee": "",
  "effective_from": "2024-01-01T00:00:00.000Z",
  "effective_to": null,
  "query_date": "2024-09-12",
  "legislative_source": "https://statutes.capitol.texas.gov/docs/IN/htm/IN.225.htm",
  "confidence": "high",
  "data_source": "initial_migration",
  "field_sources": {
    "tax_rate": "initial_migration",
    "stamping_fee": "initial_migration",
    "filing_fee": "initial_migration",
    "service_fee": "initial_migration",
    "surcharge": "initial_migration",
    "regulatory_fee": "initial_migration",
    "fire_marshal_tax": "initial_migration",
    "slas_clearinghouse_fee": "initial_migration",
    "flat_fee": "initial_migration",
    "rounding_rule": "initial_migration",
    "special_notes": "initial_migration"
  },
  "account": {
    "balance": "0.00",
    "free_queries_remaining": 683,
    "was_free_query": true
  }
}

Example Response (Automatic Fallback)

When historical data is unavailable, the API falls back to current rates. The data_source field will return "current_rate" (instead of "initial_migration") to indicate the fallback occurred. The query_date still reflects the originally requested date.

{
  "state": "Texas",
  "state_code": "TX",
  "tax_rate": "4.85%",
  "stamping_fee": "0.04%",
  "filing_fee": "",
  "service_fee": "",
  "surcharge": "",
  "regulatory_fee": "",
  "fire_marshal_tax": "",
  "slas_clearinghouse_fee": "",
  "flat_fee": "",
  "query_date": "2010-01-01",
  "legislative_source": "https://statutes.capitol.texas.gov/docs/IN/htm/IN.225.htm",
  "confidence": "high",
  "data_source": "current_rate",
  "field_sources": null,
  "account": {
    "balance": "0.00",
    "free_queries_remaining": 683,
    "was_free_query": true
  }
}

Use Cases

  • Current Rates — Get today's tax rates for quote generation
  • Policy Audits — Verify taxes using rates in effect at policy inception
  • Renewals — Compare current vs. prior year rates
  • Compliance — Document historical rate information for regulatory filings
  • Rate Monitoring — Track rate changes over time (Iowa has scheduled rate reductions through 2027)

Historical Data Available

Currently, only Iowa has true historical data with 4 rate periods (2024-2027+). For all other states, the tool returns current rates with a fallback notification if you request historical dates.

Usage Examples

Once configured, just ask Claude naturally:

Basic Calculation

"Calculate the surplus lines tax for a $50,000 premium in Texas"

Claude will return: State tax ($2,425), stamping fee ($90), total due ($52,515)

Special Coverage Type

"What's the SL tax for a wet marine policy in Florida with $100,000 premium?"

Claude will apply wet marine rules and return the correct calculation

State Information

"What is the current surplus lines tax rate in California?"

Claude will return the current rate (3.0%) plus any applicable fees

Multi-State Comparison

"Compare surplus lines taxes for a $25,000 premium in Texas, California, and New York"

Claude will calculate all three and present a comparison

Historical Tax Calculation

"Calculate the surplus lines tax for a $10,000 premium in Texas as of June 15, 2024"

Claude will calculate using historical rates from that date, or show current rates with a fallback notice if historical data is unavailable

Current Rate Lookup

"What is the current surplus lines tax rate in Iowa?"

Claude will return the current rate (1.00%) plus stamping fee (0.25%) with legislative source

Historical Rate Lookup

"What was the surplus lines tax rate in Iowa on June 15, 2025?"

Claude will return the historical rate (0.95%) that was in effect on that date, along with the effective date range

Historical Fallback Example

"What was the surplus lines tax rate in Texas on January 1, 2010?"

Claude will return current Texas rates with a notice: "No historical data available for 2010-01-01. Showing current rates instead."

Troubleshooting

"SLAPI_API_KEY environment variable is required"

Your API key is not configured. Make sure the env section in your settings includes your API key:

"env": {
  "SLAPI_API_KEY": "your-actual-api-key"
}

"API error (401)"

Your API key is invalid or expired. Verify your key at app.surpluslinesapi.com.

"API error (402)"

Your account balance is depleted. Add funds at app.surpluslinesapi.com.

MCP Server Not Appearing in Claude

  • Restart Claude Code or Claude Desktop after editing settings
  • Verify the package is installed: npx surplus-lines-tax-mcp --help
  • Check that Node.js 18+ is installed and in your PATH
  • Try running manually: SLAPI_API_KEY="your-key" npx surplus-lines-tax-mcp

Getting Help

Contact us at support@undtec.com for assistance.

Pricing

MCP server usage follows the same pricing as the REST API:

Free Tier 100 free queries for new accounts
Per Query $0.38 per calculation
Monthly Minimum $18/month (after free tier)
Initial Deposit $50 (credited to your balance)

Get Your API Key View Full Documentation