---
title: "MCP server"
description: "Connect an AI assistant to SendIt over Model Context Protocol: quote, create shipments, buy and void labels (guías) in conversation."
---

SendIt speaks the [Model Context Protocol](https://modelcontextprotocol.io) at `POST /v1/mcp`, so an assistant can quote, create shipments, buy labels (guías), and void them in conversation. Each tool performs one REST operation with your API key — it can do exactly what that key can do and nothing more: the same scopes, validation, TEST/LIVE mode, rate limits, and request logs apply.

## Connect your client

You need a key with the `mcp:use` scope plus the scopes of the tools you want (a `*` key has them all). **Start with a `sk_test_` key:** it only spends virtual test balance.

| Setting | Value |
| --- | --- |
| URL | Your API base URL followed by `/mcp` |
| Transport | Streamable HTTP (stateless, JSON responses) |
| Header | `Authorization: Bearer <your key>` |

Claude Code:

```bash
claude mcp add --transport http sendit "https://api.sendit.mx/v1/mcp" \
  --header "Authorization: Bearer ${SENDIT_API_KEY}"
```

Cursor (`.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "sendit": {
      "url": "https://api.sendit.mx/v1/mcp",
      "headers": { "Authorization": "Bearer ${env:SENDIT_API_KEY}" }
    }
  }
}
```

Keep the key in an environment variable or a secret store — never in a prompt or a URL. The endpoint is for servers and developer tools, not browser code.

## Available tools

| Tool | REST operation it performs | Scopes | Effect |
| --- | --- | --- | --- |
| `get_rates` | `POST /v1/rates` | `rates:read` | Reads |
| `list_shipments` | `GET /v1/shipments` | `shipments:read` | Reads |
| `get_shipment` | `GET /v1/shipments/:id` | `shipments:read` | Reads |
| `get_shipment_rates` | `GET /v1/shipments/:id/rates` | `shipments:read`, `rates:read` | Reads |
| `list_trackers` | `GET /v1/trackers` | `trackers:read` | Reads |
| `get_wallet_balance` | `GET /v1/wallet/balance` | `wallet:read` | Reads |
| `get_carrier_status` | `GET /v1/carriers/status` | `carrier_services:read` | Reads |
| `create_shipment` | `POST /v1/shipments` | `shipments:write` | Creates a draft; charges nothing |
| `purchase_label` | `POST /v1/shipments/:id/label` | `labels:write` + the preview | **Debits the prepaid wallet (monedero)** |
| `void_label` | `POST /v1/shipments/:id/label/void` | `labels:write` + the preview | **Voids a label and refunds** |

The `purchase_label` preview reads the shipment's rates (`shipments:read`, `rates:read`); the `void_label` preview reads the shipment (`shipments:read`).

## Buying and voiding take two calls

`purchase_label` and `void_label` move no money on the first call. Without `confirm: true` they return a preview with `status: "confirmation_required"` — the rate, the IVA breakdown, and what will be charged. Repeat the call with `confirm: true` to execute. This keeps an assistant from spending balance by accident.

Prices are MXN with IVA included. A label costs exactly the total of the rate it was purchased at.

:::note
Use a client that supports API keys. A TEST key uses the virtual balance. A LIVE key requests operations available to that account. For a foreign destination in TEST, supply the country, city and state. You can include the customs declaration when creating the shipment.
:::
