Mcp Melhor Envio

io.github.codesparPublished by GitHub account codesparv0.1.4Updated Oct 24, 2026

MCP server for Melhor Envio — shipping rates, labels, tracking, agencies

Overview

AI-generated overview

Local MCP server for Melhor Envio that lets an assistant calculate shipping rates, create and track shipments, and manage labels and pickup agencies.

What you can do
Calculate shipping rates across multiple carriers and list available services for a route, plus preview labels before generating them. Create, list, inspect and cancel shipment orders, and track shipments with full event history. Generate, preview, print or download shipping label PDFs. Add orders to a cart, check out and pay for the cart, and check the account balance. Look up store information, create stored sender or recipient addresses, and list or search pickup agencies by service and location.
When to use it
Useful when you work with Brazilian shipping through Melhor Envio and want an assistant to compare carrier rates, prepare labels, follow deliveries, or manage shipment orders and pickup points from a chat session.
Requirements
Runs locally via npx from the npm package, so Node.js is needed. Requires a Melhor Envio account and a Bearer token supplied in the MELHOR_ENVIO_TOKEN environment variable. The optional MELHOR_ENVIO_SANDBOX variable set to true switches to the sandbox. Network access to Melhor Envio is required.
Before you install
The MELHOR_ENVIO_TOKEN is a secret account credential and should be kept out of shared configs. Checkout and payment tools spend real money from the account balance, and creating, cancelling or printing shipments changes real orders. Test with MELHOR_ENVIO_SANDBOX first. Shipment, address and store data is sent to Melhor Envio.

Installation

In SourceWeft

  1. Open Mcp Melhor Envio in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@codespar/mcp-melhor-envio

MCP server for Melhor Envio — shipping aggregator with multi-carrier rate comparison

[npm] [License: MIT]

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

json
{  "mcpServers": {    "melhor-envio": {      "command": "npx",      "args": ["-y", "@codespar/mcp-melhor-envio"],      "env": {        "MELHOR_ENVIO_TOKEN": "your-token",        "MELHOR_ENVIO_SANDBOX": "true"      }    }  }}

Claude Code

bash
claude mcp add melhor-envio -- npx @codespar/mcp-melhor-envio

Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

json
{  "servers": {    "melhor-envio": {      "command": "npx",      "args": ["-y", "@codespar/mcp-melhor-envio"],      "env": {        "MELHOR_ENVIO_TOKEN": "your-token",        "MELHOR_ENVIO_SANDBOX": "true"      }    }  }}

Tools (18)

ToolPurpose
calculate_shippingCalculate shipping rates from multiple carriers
create_shipmentCreate a shipment order
track_shipmentTrack a shipment by order ID
generate_labelGenerate shipping label for an order
list_agenciesList carrier pickup agencies near a location
cancel_shipmentCancel a shipment order
get_balanceGet current account balance
add_cartAdd shipment orders to cart for batch checkout
checkout_cartCheckout all items in the cart and pay
preview_labelPreview a shipping label before generating
print_labelPrint/download label PDF
get_shipmentGet shipment order details by ID
list_shipmentsList all shipment orders with filters
get_storeGet store/company information
search_agenciesSearch pickup agencies by service and location
create_addressCreate a stored address for sender/recipient
list_services_availableList available shipping services for a route
get_tracking_historyGet complete tracking history with events

Authentication

Melhor Envio uses a Bearer token for authentication.

Sandbox / Testing

Melhor Envio provides a sandbox at sandbox.melhorenvio.com.br. Set MELHOR_ENVIO_SANDBOX=true to use it.

Get your credentials

  1. Go to Melhor Envio
  2. Create an account
  3. Navigate to API settings and generate a token
  4. Set the MELHOR_ENVIO_TOKEN environment variable

Environment Variables

VariableRequiredDescription
MELHOR_ENVIO_TOKENYesBearer token from Melhor Envio
MELHOR_ENVIO_SANDBOXNoSet to "true" for sandbox mode

Roadmap

v0.2 (planned)

  • create_store — Create a store in Melhor Envio
  • update_store — Update store details
  • get_receipt — Get shipping receipt/label
  • list_companies — List available shipping companies
  • get_invoice — Get invoice for a shipment

v0.3 (planned)

  • batch_shipments — Create multiple shipments in a single request
  • detailed_reports — Generate detailed shipping reports
  • webhook_management — Register, list, and delete webhooks

Want to contribute? Open a PR or request a tool.

Links

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Source: packages/ecommerce/melhor-envio/README.md at commit d0a519a

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.4LatestSep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts