Skip to content

MCP Server Setup

The ShipRules AI MCP (Model Context Protocol) server lets AI assistants like Claude Desktop and Cursor manage your shipping rules directly. You can ask Claude to “add a $5 surcharge for Alaska” and it will use the MCP tools to do it.

Terminal window
npm install @shiprules/mcp

Add to your claude_desktop_config.json:

{
"mcpServers": {
"shiprules": {
"command": "npx",
"args": ["@shiprules/mcp"],
"env": {
"SHIPRULES_API_KEY": "sr_live_your_key_here"
}
}
}
}

Replace sr_live_your_key_here with your actual API key. See Authentication for how to create one.

The MCP server exposes 24 tools organized into 6 categories:

ToolDescription
list_zonesList all shipping zones with countries and subzones
list_product_groupsList product groups and variant assignments
list_methodsList shipping methods for a zone (optionally by product group)
list_rulesList rules for a shipping method
list_blended_ratesList all blended rates with preferences
get_settingsGet shop settings, plan, and usage
get_version_historyGet paginated version history
simulate_rateSimulate a rate calculation with destination + cart items
ToolDescription
create_ruleCreate a rule on a shipping method
update_ruleUpdate a rule’s action, conditions, or position
delete_ruleDelete a rule
ToolDescription
create_methodCreate a shipping method (flat, weight-tiered, etc.)
update_methodUpdate a method’s config, threshold, or enabled status
delete_methodDelete a method and its rules
ToolDescription
create_product_groupCreate a product group
assign_productsAssign variants to a group
ToolDescription
export_configExport full configuration as JSON snapshot
import_configImport a configuration snapshot (with optional preview)
ToolDescription
enter_stagingEnter staging mode for shadow testing
promote_stagedPromote staged changes to live
discard_stagedDiscard staged changes
get_shadow_resultsGet shadow comparison results
ToolDescription
rollbackRoll back to a previous version
diff_versionsCompare two configuration versions

Here’s what a conversation with Claude Desktop looks like when the ShipRules AI MCP server is connected:

You: “Show me all my shipping methods for the US zone”

Claude: Uses list_zones to find the US zone ID, then list_methods filtered by that zone. Shows you a formatted list of methods with their rates.

You: “Add a $5 surcharge on Standard Shipping for Alaska and Hawaii”

Claude: Uses list_methods to find Standard Shipping’s ID, then create_rule with action adjust_add, adjustmentValue 500, and a destination_state condition for AK,HI. Confirms the rule was created.

You: “Test that — simulate an order to Alaska with a $50 cart”

Claude: Uses simulate_rate with a test cart going to AK. Shows you the rate results including the $5 surcharge and the rule trace proving it fired.

You: “Looks good. Now show me what changed in the last 3 versions”

Claude: Uses get_version_history with limit 3, then diff_versions between the oldest and newest. Shows a summary of what was added, modified, or removed.

“Tool not found” error in Claude Desktop Make sure you’ve restarted Claude Desktop after adding the MCP config. The server needs to be running.

“Unauthorized” error from tools Check that your SHIPRULES_API_KEY environment variable is set correctly and the key hasn’t been revoked.

“Plan limit exceeded” error MCP server access requires the Enterprise plan. Check your plan at Settings > Billing.