Deftship MCP Server

Deftship MCP Server

Enables AI clients to quote, ship, track, void, and manage shipments via the Deftship multi-carrier shipping API using natural language commands.

Category
Visit Server

README

Deftship MCP Server

A Model Context Protocol server for the Deftship multi-carrier shipping API. It lets any MCP-capable AI client (Claude Desktop, Claude Code, Cursor, Codex CLI, and others) quote, ship, track, void and manage shipments in natural language using your Deftship API token.

What it can do

The full shipping lifecycle is exposed as tools:

Domain Tools
Parcel get rates, create draft, ship, void, get/track, merge labels, mark as shipped, list e-commerce orders
Freight get rates, create draft, ship, void, get/track
Pickup get rates, create, arrange, void, get
Insurance get rate, book, void
Batch (beta) create, add items, remove items, get, ship
Account check balance, address book, validate address, service names, carrier status, create ticket

A typical flow: deftship_get_parcel_rates → choose a rate_id → deftship_ship_parcel → deftship_get_parcel to fetch the label and track it.

Safety guardrails

Because an AI agent can drive this end to end, spending is deliberately hard to do by accident:

  • Sandbox by default. With DEFTSHIP_ENV=sandbox (the default) every operation runs against the isolated sandbox with a $10,000 dummy balance and never touches production. Going live is a deliberate one-line change.
  • Explicit confirmation. Every tool that spends your balance or is irreversible (ship, void, book_insurance, arrange_pickup, ship_batch) refuses to run unless called with "confirm": true, forcing the agent to surface the action to you first.
  • Honest tool hints. Read-only tools are marked readOnlyHint; spending tools are marked destructiveHint, so clients can prompt for approval.

Setup

1. Get an API token

Generate a sandbox token from your Deftship organisation's API page. Use sandbox while you test; switch to a production token only when you are ready to spend real money.

2. Configure your MCP client

Claude Desktop / Claude Code (claude_desktop_config.json or .mcp.json):

{
  "mcpServers": {
    "deftship": {
      "command": "npx",
      "args": ["-y", "deftship-mcp"],
      "env": {
        "DEFTSHIP_API_TOKEN": "bearer-your-token-here",
        "DEFTSHIP_ENV": "sandbox"
      }
    }
  }
}

Codex CLI (~/.codex/config.toml):

[mcp_servers.deftship]
command = "npx"
args = ["-y", "deftship-mcp"]
env = { DEFTSHIP_API_TOKEN = "bearer-your-token-here", DEFTSHIP_ENV = "sandbox" }

Cursor (.cursor/mcp.json): same shape as the Claude example above.

Environment variables

Variable Required Default Description
DEFTSHIP_API_TOKEN yes — Your Deftship API token.
DEFTSHIP_ENV no sandbox sandbox or production. Determines the base URL.
DEFTSHIP_BASE_URL no derived Override the API base URL entirely (takes precedence over DEFTSHIP_ENV).

Local development

npm install
npm run build      # compile TypeScript to dist/
npm run dev        # watch mode
DEFTSHIP_API_TOKEN=bearer-... npm start

The server speaks MCP over stdio. Do not write anything to stdout in tool code — stdout carries the JSON-RPC stream; diagnostics go to stderr.

Project structure

src/
  config.ts        env parsing, sandbox/production base URL resolution
  http.ts          fetch wrapper: auth, error + rate-limit normalization
  schemas.ts       shared Zod schemas (address, package, item, ...)
  server.ts        assembles the server and registers all tool modules
  index.ts         stdio entry point
  tools/
    helpers.ts     registration wrapper, confirm gate, result formatting
    parcel.ts freight.ts pickup.ts insurance.ts batch.ts account.ts

Tool schemas mirror the field tables in the official Deftship developer docs.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured