Skip to main content
ME

Melhor Envio

v20260413_01OAuth2

Multi-carrier shipping: quote Correios, Jadlog, Loggi, and 10+ carriers. Generate labels, track packages, and manage agencies.

16 tools0 triggers๐Ÿ‡ง๐Ÿ‡ท Brazillive in production

Install

terminal
$ npm install @codespar/mcp-melhor-envio

Quickstart

quickstart.ts
// your agent can now call any Melhor Envio tool via MCP
import { CodeSpar } from "@codespar/sdk";

const cs = new CodeSpar();
const session = await cs.create("user_123");
const tools = await session.tools("@codespar/mcp-melhor-envio");

Why this toolkit

Built for production AI commerce workflows

โ†’ MANAGED AUTH

OAuth2 without the pain

We handle token refresh, rotation, and multi-tenant credential storage. Your agent never touches raw secrets.

โ†’ LLM-FRIENDLY

Optimized schemas

Every tool has a JSON Schema tuned for LLM function-calling. Fewer hallucinations, fewer retries.

โ†’ SLA 99.9%

Running in production

Managed hosting with auto-scaling, circuit breakers, and retry logic. Battle-tested in real commerce loops.

Available tools ยท 16

Each tool is independent โ€” your agent loads only what it needs to reduce context and response time.

READmelhorenvio_calculate_freight
Get shipping quotes from multiple carriers
โ†’
WRITEmelhorenvio_generate_label
Create a shipping label for an order
โ†’
READmelhorenvio_track
Track a package by tracking code
โ†’
READmelhorenvio_list_carriers
List available shipping carriers
โ†’

Compatible frameworks

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Usage patterns

Pattern #1

Autonomous collections

Agent monitors overdue invoices, sends WhatsApp reminders via send_message, generates Pix charges with create_pix_charge, and reconciles payments -- fully autonomous.

Pattern #2

Overnight fiscal reconciliation

Scheduled agent cross-references ERP orders with NF-e emissions using list_receivables, flags mismatches, and auto-corrects when confidence is high.

Frequently asked questions

All credentials are encrypted at rest with AES-256 and stored in an isolated vault per organization. OAuth2 tokens are automatically refreshed before expiry. Your agent code never sees raw secrets -- it receives scoped, short-lived session tokens.
CodeSpar โ€” Commerce Infrastructure for AI Agents