Ship packages with Shippo. Multi-carrier rate shopping, label generation, package tracking, address validation, customs declarations, and batch processing from CSV files.
MCP server: https://app.getgram.ai/mcp/shippo-mcp-beta with header Mcp-Shippo-Merged-Api-Key-Header set to the SHIPPO_API_KEY environment variable.
Prerequisites: A valid Shippo API key and at least one carrier account (Shippo provides managed accounts for USPS, UPS, FedEx, DHL Express by default). See references/tool-reference.md for the full tool catalog.
Test vs live mode -- check the API key prefix before any purchase workflow:
shippo_test_*: Labels are free. No real charges. Tracking uses mock numbers only.shippo_live_*: Real charges. Inform the user which mode they are in.Test and live mode have completely separate data and object IDs.
The Shippo API uses v1 field names for address components in most endpoints (including shipments-create). Always use:
| Field | Description | Example |
|---|---|---|
name | Full name | Jane Smith |
street1 | Street address line 1 | 731 Market St |
street2 | Street address line 2 (optional) | Suite 200 |
city | City | San Francisco |
state | State or province | CA |
zip | Postal code | 94103 |
country | ISO 3166-1 alpha-2 country code | US |
email | Email (required for international senders) | [email protected] |
phone | Phone (required for international senders) | +1-555-123-4567 |
Note: The v2 address endpoints (addresses-create-v2, addresses-validate-v2) use different field names (address_line_1, city_locality, state_province, postal_code), but when passing addresses inline to shipments-create, you must use the v1 names above.
street1, city, state, zip, country (ISO 3166-1 alpha-2).addresses-create-v2 with the address fields (creates the address, returns object ID).addresses-validate-v2 with the same fields as query parameters (not object ID).analysis.validation_result.value: "valid", "invalid", or "partially_valid". Check reasons for details.changed_attributes). Note analysis.address_type ("residential", "commercial", "unknown") -- affects carrier surcharges.recommended_address if returned.partially_valid: show corrections and ask user to confirm.addresses-parse with the raw string. Response uses v2 field names: address_line_1, city_locality, state_province, postal_code.country. Ask the user or infer it, then add it.country field. Do not guess.No batch endpoint. Call addresses-create-v2 per address. Track results and report a summary. For 50+ addresses, set expectations about processing time.
"10" not 10).shipments-create with address_from, address_to (inline v1 field names), and parcels.rates array as a table: carrier, service level, price, estimated days. Deduplicate by carrier/service combination.Carriers charge based on the greater of actual weight and dimensional weight:
dim_weight = (length x width x height) / divisor
| Carrier | Divisor (inches) | Divisor (cm) |
|---|---|---|
| USPS | 166 | 5000 |
| UPS | 139 | 5000 |
| FedEx | 139 | 5000 |
| DHL Express | 139 | 5000 |
If a package is large but light, dimensional weight will exceed actual weight and the carrier charges the higher rate. When rates seem surprisingly high, check if dimensional weight is the cause.
USPS flat-rate options charge a fixed price regardless of weight (up to 70 lbs). Set the parcel template to a flat-rate token (e.g., USPS_SmallFlatRateBox) instead of custom dimensions. Flat rate wins for heavy or long-distance shipments; custom dimensions win for light, nearby packages.
Map user requests: "overnight" = estimated_days 1, "2-day" = estimated_days <= 2, "within N days" = estimated_days <= N. Filter the rates array accordingly. If nothing matches, show the fastest available.
Some carriers require a customs declaration or phone number on the destination address for international rates. If no rates are returned, try attaching a customs declaration. See references/customs-guide.md for customs details.
Call rates-at-checkout-create instead of shipments-create. Accepts address_from, address_to, and line_items (each with title, quantity, total_price, currency, weight, weight_unit).
Identify the cheapest (lowest amount), fastest (lowest estimated_days), and best-value options. Compute by sorting -- these are not API fields. State the trade-off: "Option A is $X cheaper but takes Y more days."
carrier-accounts-list if needed.Before every transactions-create, summarize carrier/service, cost, delivery time, and origin/destination. Do not proceed without explicit user confirmation.
shipments-create with address_from, address_to (inline v1 field names), parcels, async: false.transactions-create with rate (object_id), label_file_type (default PDF_4x6), async: false.status:
SUCCESS: return tracking_number, label_url (complete URL), tracking_url_provider.QUEUED/WAITING: poll transactions-get until resolved.ERROR: report messages array.All domestic steps apply, plus customs before shipment creation. See references/customs-guide.md.
email and phone. Ask if missing.customs-items-create per item, or pass inline objects in step 3.customs-declarations-create with contents_type, non_delivery_option, certify: true, certify_signer, and items.shipments-create with standard fields plus customs_declaration (object_id).| Scenario | Value |
|---|---|
| Commercial sale | MERCHANDISE |
| Free gift | GIFT |
| Product sample | SAMPLE |
| Paper documents only | DOCUMENTS |
| Customer returning item | RETURN_MERCHANDISE |
| Charitable donation | HUMANITARIAN_DONATION |
| None of the above | OTHER (requires contents_explanation) |
DDU (Delivered Duty Unpaid) -- recipient pays duties.DDP (Delivered Duty Paid) -- seller covers duties/taxes.FCA (Free Carrier) for advanced trade scenarios.Default to DDU if the user does not specify.
Default to PDF_4x6 unless the user specifies otherwise.
| Format | Dimensions | Use Case |
|---|---|---|
PDF_4x6 | 4" x 6" | Default. Standard thermal label. |
PDF_4x8 | 4" x 8" | Extended label for UPS/FedEx |
PDF_A4 | 8.27" x 11.69" | Standard office printer |
PDF_A5 | 5.83" x 8.27" | Half-sheet label |
PDF_A6 | 4.13" x 5.83" | Quarter-sheet label |
PDF | Varies | Generic PDF, carrier-determined size |
PDF_2.3x7.5 | 2.3" x 7.5" | Narrow format label printers |
PNG | Varies | Image format for web display |
PNG_2.3x7.5 | 2.3" x 7.5" | Narrow PNG format |
ZPLII | N/A | Zebra thermal printers only |
Set these on the shipment's extra field:
signature_confirmation): STANDARD, ADULT, CERTIFIED, INDIRECT, CARRIER_CONFIRMATION.insurance): with amount, currency, provider.saturday_delivery): true. Only certain carriers/service levels.metadata on the transaction for order numbers.Swap address_from and address_to so the original recipient becomes the sender. All other steps remain the same.
Call refunds-create with the transaction object_id. Eligibility depends on carrier and timing. If it fails, advise the user to contact Shippo support.
orders-create with shipping address, line items, and order details.shipments-create, then follow the standard label purchase flow.orders-get-packing-slip for a PDF packing slip.usps, ups, fedex, dhl_express) and tracking number. See references/carrier-guide.md for format hints. If uncertain, ask the user.tracking-status-get with carrier and tracking_number.tracking_status (status, status_details, status_date, location), tracking_history, eta. Each event includes a substatus with code, text, action_required.| Status | Meaning |
|---|---|
| PRE_TRANSIT | Label created, carrier has not received the package |
| TRANSIT | Package is in transit |
| DELIVERED | Delivered |
| RETURNED | Being returned or returned to sender |
| FAILURE | Delivery failed |
| UNKNOWN | No tracking information from carrier |
In test mode, use shippo as the carrier token with these mock tracking numbers:
| Tracking Number | Simulated Status |
|---|---|
SHIPPO_PRE_TRANSIT | Label created, not yet with carrier |
SHIPPO_TRANSIT | Package in transit |
SHIPPO_DELIVERED | Package delivered |
SHIPPO_RETURNED | Package returned to sender |
SHIPPO_FAILURE | Delivery failed |
SHIPPO_UNKNOWN | Status unknown |
Example: tracking-status-get carrier="shippo" tracking_number="SHIPPO_DELIVERED"
Call transactions-list. Filter for object_status: SUCCESS. Each successful transaction has tracking_number and carrier info. Then call tracking-status-get for selected items.
webhooks-create with the user's HTTPS url and event: track_updated.tracking-status-create with carrier and tracking number to register a shipment for push updates.Before every batches-purchase, summarize total shipments, carrier/service, estimated total cost, and domestic vs international count. Do not proceed without explicit user confirmation.
See references/csv-format.md for column spec. See references/customs-guide.md for international rows.
RETURN_MERCHANDISE (not RETURN), HUMANITARIAN_DONATION (not HUMANITARIAN).batch_shipments array with inline address and parcel objects per row.batches-create. Poll batches-get until status is VALID.batches-purchase. Poll batches-get until PURCHASED.batches-get.shipments-create per shipment for rate quotes (see Rate Shopping above).batch_shipments with servicelevel_token per item.batches-add-shipments (before purchase only). Adding an invalid shipment changes entire batch to INVALID.batches-remove-shipments (before purchase only).carrier_account (object_id), shipment_date (YYYY-MM-DD), address_from, and optionally specific transaction object_ids.manifests-create. Poll manifests-get until SUCCESS or ERROR.carrier-accounts-list to see configured carriers.shipments-create per destination to collect rates. Shipment creation is free; only transactions-create costs money.analysis/ directory (markdown + CSV). Columns: Route, Destination, Carrier, Service, Cost, Currency, EstimatedDays, Zone.carrier-parcel-templates-list and user-parcel-templates-list for flat-rate and saved templates.shipments-create per profile on the same route.references/carrier-guide.md for carrier limits.shipments-create for the route. Group the rates array by provider.shipments-list and transactions-list to get past activity.tracking-status-get to check actual vs. estimated delivery times.Write reports to the analysis/ directory (create if needed). Include markdown (with timestamp and input parameters) and CSV (with header row).
"10" not 10).carrier-accounts-list.app.getgram.ai/mcp/shippo-mcp-beta.SHIPPO_API_KEY environment variable is sent as a header (Mcp-Shippo-Merged-Api-Key-Header) to authenticate requests.