# mcp-melhor-envio

Connects an agent to Melhor Envio for carrier rates, shipment orders, labels, agencies, and tracking. It fits delivery workflows that need API access.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 274
- Author: codespar
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codespar/mcp-dev-latam/tree/HEAD/packages/ecommerce/melhor-envio
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-melhor-envio

## What it does

mcp-melhor-envio connects an agent to Melhor Envio, a shipping service that compares carrier rates. Its tools can price a route, create or cancel shipment orders, retrieve order details, and follow a shipment by its ID.

The server also covers label previews and downloads, pickup-agency searches, stored addresses, available services, tracking history, account balance, and cart checkout. It runs through `npx` and authenticates with the Bearer token stored in `MELHOR_ENVIO_TOKEN`.

For testing, set `MELHOR_ENVIO_SANDBOX=true` to use the Melhor Envio sandbox. Without `MELHOR_ENVIO_TOKEN`, authentication will fail.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MELHOR_ENVIO_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-melhor-envio -e MELHOR_ENVIO_TOKEN=<MELHOR_ENVIO_TOKEN> -- npx -y @codespar/mcp-melhor-envio
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add melhor-envio --env MELHOR_ENVIO_TOKEN=<MELHOR_ENVIO_TOKEN> -- npx -y @codespar/mcp-melhor-envio
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "melhor-envio": {
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-melhor-envio"
            ],
            "env": {
                "MELHOR_ENVIO_TOKEN": "<MELHOR_ENVIO_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "melhor-envio": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@codespar/mcp-melhor-envio"
            ],
            "env": {
                "MELHOR_ENVIO_TOKEN": "<MELHOR_ENVIO_TOKEN>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MELHOR_ENVIO_TOKEN=<MELHOR_ENVIO_TOKEN> melhor-envio npx -y @codespar/mcp-melhor-envio
```
Replace <…> with your own values

## When to use it
- compare carrier rates for a route
- create a shipment order
- track a shipment by order ID
- generate and download a label PDF
- find nearby carrier pickup agencies

## Example prompts
- Compare shipping prices and available services for the sender and recipient addresses.
- Create a shipment, add it to the cart, and prepare the checkout.
- Show the full tracking history for this order ID and produce its label PDF.

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [OpenWork MCP Gateway](https://affpapa.org/en/nevibecode/mcp/openwork-mcp-gateway.md) — MCP server · ★ 24242
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [basebalance.cloud — x402 RPC & MCP gateway](https://affpapa.org/en/nevibecode/mcp/basebalancecloud-x402-rpc-mcp-gateway.md) — MCP server · ★ 7506

From the same set: [codespar/mcp-dev-latam](https://affpapa.org/en/nevibecode/by/codespar/mcp-dev-latam.md) — 124 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
