Pirate Ship MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Pirate Ship MCP Servercompare USPS and UPS rates to 10001 for a 1 lb package"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Pirate Ship API and MCP server, self-hosted
A Pirate Ship API and a Pirate Ship MCP server you run on your own computer, in Python, on the session of your own Google Chrome. 51 of the 57 Pirate Ship tools we run in production at Cotlet: USPS and UPS rates, draft labels and batches, label downloads, SCAN Forms, shipments and tracking, reports, store order import, Ship From Addresses, Saved Packages, tracking emails and label settings. The six tools that spend or refund money are not in this version.
Pirate Ship has no public API and no official MCP server. This repo gives you both:
MCP server for Claude Code, Claude Desktop, Cursor, Codex and any MCP client, over stdio or HTTP. Setup
REST API on
http://127.0.0.1:8787/api/v1/pirate-ship, with OpenAPI docs at/docs. SetupPython:
call("get_rates", to_zip="10001", weight_oz=16), plus 11 ready scripts inexamples/.
It is for technical people who want to run it themselves, for personal use only (license). If you want it running 24/7 on a server, kept working when Pirate Ship changes its app, for a team or a business, use the hosted version at cotlet.dev.
git clone https://github.com/cotletdev/pirate-ship-api-mcp-server.git && cd pirate-ship-api-mcp-server
python3 -m venv .venv && . .venv/bin/activate && pip install -e .
pirate-ship-mcp connect # reads your Pirate Ship session from Chrome
pirate-ship-mcp call get_rates to_zip=10001 weight_oz=16
claude mcp add pirate-ship -- "$PWD/.venv/bin/pirate-ship-mcp" mcpContents
Related MCP server: AKIMCP
How it works
AI agent (MCP) / script (REST, Python) ──▶ pirate-ship-mcp on your computer ──your cookies──▶ ship.pirateship.com
▲
pirate-ship-mcp connect ──────┘ reads them once from your Chrome (DevTools Protocol)You sign in to Pirate Ship in your own Chrome, the way you always do.
pirate-ship-mcp connectattaches to that Chrome through the Chrome DevTools Protocol, reads the pirateship.com cookies and Chrome's time zone, and saves them to~/.config/pirate-ship-api-mcp/session.json, readable by your user only. It never sees or stores your password.Every tool call is one of the GraphQL operations Pirate Ship's own web app sends to
ship.pirateship.com/api/graphql, with those cookies, sent with curl_cffi, which copies Chrome's TLS fingerprint. No headless browser runs.
Pirate Ship's web app sends each operation as a persisted query: its name and the sha256 of the query text. The tools may send only the operations listed in operations.py, and account, password, payment method and identity operations are not on that list. When Pirate Ship changes one of the listed queries, the tool answers "Pirate Ship changed its app" until we record the new hash.
Pirate Ship's session cookie lives about a day and is renewed by use. When Pirate Ship signs you out, the server reads the cookies from Chrome again, if Chrome is open with remote debugging on. Tick "Stay signed in" when you sign in, so Chrome keeps you signed in between visits.
Requirements
Python 3.11 or newer.
Google Chrome 144 or newer, signed in to Pirate Ship. Any Chrome or Chromium works with a debugging port.
macOS, Linux or Windows.
A Pirate Ship account with a Ship From Address. Rates, drafts, reports and settings need nothing else. Buying labels needs Account Balance or a payment method, and you buy in Pirate Ship itself.
Install
git clone https://github.com/cotletdev/pirate-ship-api-mcp-server.git
cd pirate-ship-api-mcp-server
python3 -m venv .venv
. .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
pirate-ship-mcp --versionWith uv: uv venv && uv pip install -e ., then uv run pirate-ship-mcp ....
Setting it up with an AI agent (Claude Code, Codex, Cursor)? Open it in this folder and ask it to set up the repo: AGENTS.md tells it every step, and it asks you only for the steps in Chrome.
To update: git pull && pip install -e .. We copy every change of the hosted Pirate Ship tools into this repo.
Connect your Chrome
Option A: your everyday Chrome (recommended)
Open
chrome://inspect/#remote-debuggingin Chrome and switch remote debugging on. Chrome then accepts DevTools connections from programs on this computer, and asks you before each one.Make sure you are signed in at ship.pirateship.com.
Run:
pirate-ship-mcp connectChrome asks whether to allow the connection. Click Allow.
Saved 32 Pirate Ship cookies to /Users/you/.config/pirate-ship-api-mcp/session.json
Signed in to Pirate Ship as Linda Morales (linda@example.com)Leave remote debugging on if you want the server to pick up a new session by itself after Pirate Ship signs you out. With a one-day cookie, that happens more often than with most apps.
connect looks for Chrome's DevToolsActivePort file in the default profile folder. For Chrome Beta, Canary or a custom profile folder, pass --profile-dir "<folder>".
Option B: a Chrome with a debugging port
Chrome does not open a debugging port on your default profile, so start a separate one, sign in to Pirate Ship there once, and connect to it:
# macOS
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --remote-debugging-port=9222 --user-data-dir="$HOME/.chrome-pirate-ship"
# Linux
google-chrome --remote-debugging-port=9222 --user-data-dir="$HOME/.chrome-pirate-ship"
# Windows
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="%USERPROFILE%\.chrome-pirate-ship"
pirate-ship-mcp connect --cdp http://127.0.0.1:9222--cdp also takes a ws:// DevTools URL, for example of a Chrome on another machine reached over an SSH tunnel.
Option C: paste the cookie by hand
For a server with no Chrome: in Chrome open DevTools on ship.pirateship.com, Application > Cookies > https://ship.pirateship.com, copy the value of pirate_id_f0fecf84, then:
pirate-ship-mcp connect --token # paste it, input is hidden
# or, without a session file:
export PIRATE_SHIP_AUTH_TOKEN=...A pasted cookie is not refreshed on its own, and this one lasts about a day without use. Paste a new one when Pirate Ship signs you out.
Check the session at any time:
pirate-ship-mcp statusMCP server
The MCP server lists every tool with its input schema, a description written for agents, and hints: read tools are marked read-only, and tools that delete something or change what your recipients get are marked so your client asks before running them.
Claude Code
claude mcp add pirate-ship -- /path/to/pirate-ship-api-mcp-server/.venv/bin/pirate-ship-mcp mcp
# read only:
claude mcp add pirate-ship -- /path/to/pirate-ship-api-mcp-server/.venv/bin/pirate-ship-mcp mcp --read-onlyClaude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"pirate-ship": {
"command": "/path/to/pirate-ship-api-mcp-server/.venv/bin/pirate-ship-mcp",
"args": ["mcp"]
}
}
}Cursor
~/.cursor/mcp.json, the same block as Claude Desktop. A ready copy is in mcp.json.
Codex
~/.codex/config.toml:
[mcp_servers.pirate-ship]
command = "/path/to/pirate-ship-api-mcp-server/.venv/bin/pirate-ship-mcp"
args = ["mcp"]Over HTTP
pirate-ship-mcp serve also serves MCP over streamable HTTP at http://127.0.0.1:8787/mcp, for clients that take a URL:
pirate-ship-mcp serve
claude mcp add --transport http pirate-ship http://127.0.0.1:8787/mcpThen ask your agent things like:
What does a 2 lb box, 12x10x6, cost to ZIP 94103 with USPS and UPS? Cheapest first.
Make a draft batch from orders.csv with my "Small box" Saved Package and show me the rates per group.
Which labels from the last 10 days still have no carrier scan?
How much did I spend on labels in October, and what were the carrier adjustments?
REST API
pirate-ship-mcp serve # http://127.0.0.1:8787, MCP at /mcp, docs at /docsEach tool has its own route under /api/v1/pirate-ship, the same paths as the hosted API at cotlet.dev, so code written against one works with the other. Path parts and the query string are arguments, and a JSON body adds the rest.
curl 'http://127.0.0.1:8787/api/v1/pirate-ship/balance'
curl 'http://127.0.0.1:8787/api/v1/pirate-ship/rates?to_zip=10001&weight_oz=16&length_in=10&width_in=8&height_in=4'
curl 'http://127.0.0.1:8787/api/v1/pirate-ship/shipments?from_date=2026-10-01&limit=50'
curl -X POST http://127.0.0.1:8787/api/v1/pirate-ship/shipments \
-H 'Content-Type: application/json' \
-d '{"full_name": "Linda Morales", "address1": "350 5th Ave", "city": "New York", "state": "NY", "zip": "10118", "weight_oz": 20}'Any tool by name, body as its arguments:
curl -X POST http://127.0.0.1:8787/api/v1/pirate-ship/tools/list_shipments -d '{"carrier": ["UPS"]}'GET /api/v1/pirate-ship/tools: every tool with its route, input schema and an example answer.GET /docs: interactive OpenAPI docs,GET /openapi.jsonthe schema, for n8n, Postman or a generated client.Answers are JSON. Report lists take
limitandoffsetand answer withtotal.
The server listens on 127.0.0.1 only. To reach it from another device of yours, set a token, and every request then needs Authorization: Bearer <token>:
PIRATE_SHIP_MCP_TOKEN=$(openssl rand -hex 24) pirate-ship-mcp serve --host 0.0.0.0Python and the example scripts
Straight from Python, no server needed:
from pirate_ship_api_mcp import call
from pirate_ship_api_mcp.scripting import paginate_offset, write_rows
rates = call("get_rates", to_zip="10001", weight_oz=16, length_in=10, width_in=8, height_in=4)["rates"]
shipments = list(paginate_offset("list_shipments", {"from_date": "2026-10-01"}, "shipments"))
write_rows(shipments, "october.csv")
call("create_shipment", full_name="Linda Morales", address1="350 5th Ave", city="New York", zip="10118", weight_oz=20)Or one tool from the shell: pirate-ship-mcp call list_shipments limit=10, or with a JSON object.
Ready scripts in examples/. Each prints JSON or a short report, takes --out file.csv or --out file.json where it makes sense, and --help:
Script | What it does |
USPS and UPS rates for one package, cheapest first. | |
A CSV of recipients becomes one unpaid draft batch with a Saved Package; prints the rate of each group. Rows without an address are listed, not guessed. | |
Refreshes your connected stores and lists the orders waiting to ship. | |
Bought labels to CSV or JSON: recipient, tracking number, service, cost, status. | |
Labels of the last N days that are not delivered, with the last event and a | |
Duplicate labels and labels with no carrier scan in the 28-day refund window. Lists them; you refund in Pirate Ship. | |
The USPS SCAN Form for today's labels, as a PDF link. | |
Today's packages and weight per carrier, with the pickup price. Books nothing. | |
Carrier adjustments with the weight and size you entered next to what the carrier measured. | |
Labels, spend, savings, carrier split, top states and balance for a date range. | |
Your Ship From Addresses and Saved Packages with the ids other tools take. |
python examples/compare_rates.py --to-zip 94103 --weight-oz 32 --size 12x10x6
python examples/draft_batch_from_csv.py orders.csv --title "Wholesale 19 Oct" --package "Small box"On a schedule, cron on your own computer works while it is on: 0 18 * * 1-5 cd ~/pirate-ship-api-mcp-server && .venv/bin/python examples/tracking_report.py --days 10 --out late.csv.
All 51 tools
Money is in US dollars, weights in ounces, sizes in inches, dates in Chrome's time zone. pirate-ship-mcp tools prints this list, pirate-ship-mcp tools --json adds the input schemas.
Rates and addresses
Tool | Access | REST route | What it does |
| read |
| USPS and UPS services with price for one package, cheapest first. |
| read |
| Splits a pasted address into name, street, city, state, ZIP and country. |
| read |
| Past recipients' addresses matching a name, email or phone. |
| read |
| Packaging types per carrier (box, envelope, flat rate) and the size and weight limits. |
Draft labels and batches
Tool | Access | REST route | What it does |
| write |
| Unpaid draft label for one package with every rate; buy it in Pirate Ship. |
| write |
| Unpaid draft batch for many packages with the rates of each rate group; buy it in Pirate Ship. |
| write |
| Turns store orders into a batch of shipments with one saved package; nothing is bought. |
| read |
| A draft or bought batch: shipments, tracking, rates to buy, what can be refunded. |
| read |
| Latest batches and single labels, newest first, with status and tracking counts. |
| write |
| Moves a draft batch to another ship date and returns its new rates. |
| write |
| Changes a batch's title. |
| write |
| Deletes an unpaid draft batch or single shipment. |
Printing and SCAN Forms
Tool | Access | REST route | What it does |
| read |
| A download link for the printable labels of a batch or of chosen shipments. |
| write |
| USPS End of Day SCAN Form for the labels of one Ship Date, as a PDF link. |
| read |
| USPS SCAN Forms per Ship From Address, with their PDF links and labels still without one. |
Shipments and tracking
Tool | Access | REST route | What it does |
| read |
| Labels bought in Pirate Ship with recipient, tracking, cost and status, newest first. |
| read |
| One shipment with tracking, service, cost, recipient and carrier adjustments. |
| read |
| A CSV of the shipments report with every column, as a download link. |
Reports, balance and refunds
Tool | Access | REST route | What it does |
| read |
| Account Balance, Pending Refunds and Pending Returns from the Reports page. |
| read |
| Labels, spend, savings, tracking and where packages went for a date range, as on Reports. |
| read |
| Every charge, payment and refund on the Pirate Ship balance, newest first. |
| read |
| Payments made to Pirate Ship, newest first; get_receipt shows one. |
| read |
| One payment to Pirate Ship with its billing address and the labels it paid for. |
| read |
| Label refunds with their status and amount, newest request first. |
| read |
| Pay-on-use return labels and whether a customer used them. |
| read |
| Extra charges or credits the carrier made after a label was used, with old and actual package. |
| read |
| A CSV of the transactions, refunds, receipts, return labels or carrier adjustments report. |
Pickups
Tool | Access | REST route | What it does |
| read |
| What a USPS or UPS pickup would cost; USPS pickups are free. Nothing is booked. |
| read |
| Your scheduled and past USPS and UPS pickups with confirmation numbers. |
Store orders
Tool | Access | REST route | What it does |
| read |
| Stores and marketplaces connected to Pirate Ship for order import, with their status. |
| write |
| Pulls new orders from every connected store into Pirate Ship's Import list. |
| read |
| Unshipped orders from your connected store integrations, as in the Import grid. |
| write |
| Hides store orders from the Import list without shipping them. |
| write |
| Puts ignored store orders back on the Import list. |
Ship From Addresses
Tool | Access | REST route | What it does |
| read |
| Your Ship From Addresses with their return addresses; one is the default. |
| write |
| Adds a US Ship From Address, optionally with a separate return address. |
| write |
| Changes a Ship From Address: its name, origin or return address. |
| write |
| Makes one Ship From Address the default for new shipments and rate quotes. |
| write |
| Removes a saved Ship From Address. The default address cannot be removed. |
Saved Packages
Tool | Access | REST route | What it does |
| read |
| Your Saved Packages from Settings: size, weight and the extra services stored with each. |
| write |
| Saves a package (type, size, weight, extra services) for reuse on labels. |
| write |
| Changes a Saved Package; fields you leave out keep their values. |
| write |
| Removes a Saved Package. Labels made with it are not affected. |
Tracking emails
Tool | Access | REST route | What it does |
| read |
| Whether recipients get tracking emails by default, how long after purchase, and the template. |
| write |
| Turns default tracking emails on or off and sets their delay after purchase. |
| read |
| Tracking email templates: subject, sender, HTML body; one is the default. |
| write |
| Adds a tracking email template for the emails recipients get with their tracking link. |
| write |
| Changes a tracking email template; fields you leave out keep their values. |
| write |
| Removes a tracking email template. |
Label settings
Tool | Access | REST route | What it does |
| read |
| Label size and file format, packing list, logo, QR codes, address correction, export format. |
| write |
| Changes label size, file format, packing list, logo, QR codes, address correction or export format. |
Not in this version
Tool | Why |
| Spends your Account Balance or charges your card. Buy in Pirate Ship. |
| Refund requests are final and move money. Request them in Pirate Ship. |
| A UPS pickup is charged and its cancellation refunded. |
| A dispute is about a charge on your balance. |
In tool descriptions "buy it with buy_label" means: buy the draft in Pirate Ship's web app. Never built, on purpose: your Pirate Ship sign-in, email, password, security settings, payment methods, billing and identity checks.
Configuration
Variable | Default | What it does |
|
| Folder of |
| The | |
| Proxy for every request to Pirate Ship, e.g. | |
|
| |
| Bearer token required by | |
|
| Address of |
| Chrome's zone | Time zone for "today" and date ranges when |
Security and your Pirate Ship account
Your password never reaches this code. Only cookies are read, and only those of pirateship.com.
The session file is yours.
session.jsonis created with mode 0600. Anyone who has it can act as you on Pirate Ship, so keep it out of git and shared folders.Local by default.
servebinds to127.0.0.1and refuses another address withoutPIRATE_SHIP_MCP_TOKEN.pirateship.com only. Requests and redirects outside pirateship.com are refused.
No tool moves money. None buys a label, requests a refund, books a paid pickup or touches your payment methods.
Read-only mode.
--read-onlyorPIRATE_SHIP_MCP_READ_ONLY=1exposes the 29 read tools only.Some changes reach your recipients. Tracking email settings and templates change the emails your customers get. MCP clients ask before those tools run; a script does not.
Errors
The REST API answers {"error": "<code>", "message": "..."}. The MCP server returns the same code and message as a tool error.
Status | Code | What to do |
401 |
| No session, or Pirate Ship signed you out. Sign in to Pirate Ship in Chrome and run |
403 |
| The server runs read-only. |
403 |
| Pirate Ship refused the request or showed a bot check. Open ship.pirateship.com in Chrome once, then retry. |
409 |
| Pirate Ship asks for a CAPTCHA. Solve it in Chrome. |
422 |
| An argument is missing or wrong; the message names it. |
429 |
| Pirate Ship is limiting the account. Wait a few minutes. |
502 |
| Pirate Ship answered with an error (an unknown id, an address it cannot rate), or changed its app. |
Self-hosted or hosted
This repo | ||
Tools | 51 | all 57, with buying, refunds, pickups and disputes |
Runs | on your computer, while it is on | in the cloud, 24/7 |
Pirate Ship session | your Chrome, cookies in a local file | your own Cloud Browser in the EU, profile encrypted with AES-256-GCM, kept signed in |
When Pirate Ship changes its app |
| fixed for you, every tool tested daily |
Approvals | your MCP client asks per call | purchases and refunds wait for your OK, switchable per tool |
Works with | MCP clients on your machine, local scripts | Claude.ai and ChatGPT connectors, n8n, Make, Zapier, any HTTP client |
Who may use it | you, for personal use | teams, businesses, agencies |
Price | free | free 7-day trial with 2,000 credits, no card; then one-time packs from $29 for 5,000 credits |
On the hosted version a successful call uses 20 to 30 credits (25 for most tools), failed calls are free, and the Cloud Browser uses 50 credits a day while it has an app enabled for agents. Full pricing.
FAQ
Does Pirate Ship have an official API? No. Pirate Ship has no API, no webhooks and no official MCP server (checked 11 Oct 2026). Its help center says so and points to the built-in store integrations and spreadsheet uploads instead. Details: cotlet.dev/integrations/pirate-ship-api-mcp-server.
Is there a Pirate Ship MCP server for Claude, ChatGPT or Cursor?
Yes, this one runs on your machine: pirate-ship-mcp mcp for Claude Code, Claude Desktop, Cursor and Codex. ChatGPT and Claude.ai connectors need a public HTTPS URL, which the hosted Pirate Ship MCP server gives you.
Can I get USPS and UPS rates from a script?
Yes. get_rates returns every service with Pirate Ship's price, the retail price, zone and delivery estimate, cheapest first, and saves nothing: python examples/compare_rates.py --to-zip 10001 --weight-oz 16 --size 10x8x4.
Can it buy labels?
Not this repo. It builds the draft (create_shipment, create_batch, create_batch_from_orders) with the rates of each group, and you click Buy in Pirate Ship. The hosted version has buy_label with a price cap per purchase.
Can I create a batch from a spreadsheet or from my store orders?
Yes. create_batch takes up to 500 recipients per call, create_batch_from_orders takes orders from your connected stores. examples/draft_batch_from_csv.py reads a CSV.
Can I export shipments and tracking to CSV?
Yes: python examples/export_shipments.py --since 2026-10-01 --out october.csv, or export_shipments for Pirate Ship's own spreadsheet with every column.
Why does it need my Chrome? To read your Pirate Ship session without your password. Pirate Ship's sign-in sits behind a Cloudflare check, so you sign in in the browser and plain requests do the rest. Chrome is used once per sign-in, not for each call.
What happens when Pirate Ship signs me out?
Calls fail with auth_expired. With Chrome remote debugging on, the server reads the new cookies on the next call (click Allow when Chrome asks); otherwise run pirate-ship-mcp connect again.
Can it run on a VPS or in Docker?
Technically yes, with PIRATE_SHIP_AUTH_TOKEN. The cookie lasts about a day without use, Pirate Ship then sees your session from a datacenter IP, and the license allows it only on a server you alone use. For an always-on setup the hosted version keeps your session in your own Cloud Browser.
Will my Pirate Ship account get blocked? Requests carry Chrome's fingerprint and go out one at a time, as you would click. Nobody can promise a platform never acts. Keep to your normal use.
Can I use it at work or for my clients? No, the license is for personal use by one person. For a team, a company or client work, use Cotlet or write to contact@cotlet.dev.
Is it open source? The source is public, the license is not an open source license: personal use only, no business use, no hosting for others.
A tool broke or I need another one. Open an issue with the tool name and the error message.
License
Cotlet Personal Use License 1.0. In short:
Allowed: one person, on their own computers, with their own Pirate Ship accounts, for their own purposes. Changing the code for yourself, and a GitHub fork under the same license.
Not allowed: any use in or for a company or organization, your own business included; letting other people use your instance (shared server, team machine, cloud service); selling or offering it or a service built on it.
Maintained by Cotlet (@cotletdev). Pirate Ship is a trademark of its owner. This project is unofficial and not affiliated with, endorsed or sponsored by Pirate Ship.
This server cannot be deployed
Maintenance
Related MCP Connectors
Run eBay, Amazon, Walmart, Etsy and Shopify stores from your AI assistant. 150+ tools, no code.
1Read, crawl and act on websites, signed in as the user, and turn any site into an API.
13 privacy-first network, auth & web tools for AI agents — no API key, 60 req/min free.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceExposes an OAuth-gated suite of 38 tools that let web-based AI chat clients securely operate a local machine, covering files, shell, search, Git, SQLite, browser automation, DevTools, background tasks, localhost services, clipboard, notifications, ports, and Postman. A strict command whitelist and configurable folder allowlist keep that broad local access governed rather than unrestricted.-
- FlicenseNot gradedqualityAmaintenanceExposes an OAuth-gated suite of 38 tools that lets web-based AI clients read and edit files, run whitelisted shell commands, search content, use Git and SQLite, drive browsers and DevTools, and reach localhost or LAN services, clipboard, notifications, ports, Postman, and long-running background tasks on your own machine. Everything runs locally with security controls such as folder scoping, command whitelisting, rate limits, and a call log.-
- AlicenseNot gradedqualityAmaintenanceLets AI agents control the real, already-logged-in Chrome browser: reading pages, clicking, typing, navigating tabs, taking screenshots, and inspecting cookies, network traffic, console output, and storage. It connects as a local extension over Native Messaging, so no remote-debugging port or headless profile is needed.1 npmISC
- AlicenseNot gradedqualityAmaintenanceEnables AI agents such as Antigravity, Claude, and Codex to drive the user's real Chrome in background tabs through a local bridge, exposing 47 tools for tab management, trusted input, element finding, network capture, downloads, output, and page access.4MIT