postnl-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@postnl-mcp Track my parcel 3STOTA1234567890 and show its delivery status"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
postnl-mcp
Een Model Context Protocol (MCP) server voor de PostNL API. Maak zendingen aan, genereer barcodes, volg pakketten, bereken bezorgdata en vind afhaalpunten — allemaal via natuurlijke taal in je AI-app.
Let op: Dit is een onofficieel, community-onderhouden project en is niet verbonden aan of goedgekeurd door PostNL.
A community-built Model Context Protocol (MCP) server for the PostNL API. Create shipments, generate barcodes, track parcels, calculate delivery dates, and find pickup locations — all through natural language via any MCP-compatible AI client.
Note: This is an unofficial, community-maintained project and is not affiliated with or endorsed by PostNL.
Snel starten
Je hoeft deze repo niet te clonen.
Zorg dat Node.js 20+ is geïnstalleerd (je AI-app draait
npxop je machine)Haal PostNL API-gegevens op (zie API Key Setup)
Voeg de server toe als MCP server in je AI-app (kopieer onderstaande configuratie)
Stel vragen in gewoon Nederlands (zie Voorbeelden)
Related MCP server: Easyship MCP
Quick Start (Non-Developers)
You do not need to clone this repo.
Make sure Node.js 20+ is installed (your AI app will run
npxon your machine)Get PostNL credentials (see API Key Setup)
Add this as an MCP server in your AI app (copy/paste config below)
Ask plain-language shipping/tracking questions (see Example Usage)
Add To Claude Desktop (Also Works In Cowork)
Cowork runs inside Claude Desktop and uses the same connected MCP servers and permissions.
Open your Claude Desktop MCP config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\\Claude\\claude_desktop_config.json
Add this server entry (or merge into existing
mcpServers):
{
"mcpServers": {
"postnl-mcp": {
"command": "npx",
"args": ["-y", "postnl-mcp"],
"env": {
"POSTNL_API_KEY": "your-api-key",
"POSTNL_CUSTOMER_CODE": "your-customer-code",
"POSTNL_CUSTOMER_NUMBER": "your-customer-number"
}
}
}
}Restart Claude Desktop
Add To Other AI Apps
Most MCP apps have an "Add MCP Server" screen where you can fill in:
Command:
npxArgs:
-y postnl-mcpEnv:
POSTNL_API_KEY=...,POSTNL_CUSTOMER_CODE=...,POSTNL_CUSTOMER_NUMBER=...
If your app wants JSON, paste this and adapt the top-level key name to your client (common keys are mcpServers, servers, or context_servers):
{
"<servers-key>": {
"postnl-mcp": {
"command": "npx",
"args": ["-y", "postnl-mcp"],
"env": {
"POSTNL_API_KEY": "your-api-key",
"POSTNL_CUSTOMER_CODE": "your-customer-code",
"POSTNL_CUSTOMER_NUMBER": "your-customer-number"
}
}
}
}Troubleshooting
Error:
Missing required env varsor startup validation errors.Fix: add
POSTNL_API_KEY,POSTNL_CUSTOMER_CODE, andPOSTNL_CUSTOMER_NUMBERto serverenvand restart your app.
Error:
npx: command not foundor server fails to start.Fix: install Node.js 20+ and restart your app.
Connected but API calls fail with
401/403or empty business data.Fix: verify PostNL API subscriptions for the tools you use (see Required API Subscriptions).
Features
7 tools across 4 categories covering the PostNL Shipping APIs
Barcode generation for domestic (3S), mailbox (2S), EU (CC/CP/CD/CF), and international (LA/RI/UE) shipments
Shipment creation with shipping label generation (PDF or ZPL format)
Parcel tracking with full status history and event timeline
Delivery date calculation with origin country and postal code support
Delivery timeframes with evening delivery and Sunday sorting options
Location finder — search PostNL pickup/drop-off points by postal code, city, or coordinates
Input validation via Zod schemas on every tool for safe, predictable operations
Response caching with configurable TTL and automatic invalidation on writes
Rate limit handling with exponential backoff and
Retry-Afterheader supportToolset filtering to expose only the tool categories you need
Docker support for containerized deployment via GHCR
Actionable error messages with context-aware recovery suggestions
Supported Clients
This MCP server is not tied to one coding agent. It works with any MCP-compatible client or agent runtime that can start a stdio MCP server.
Client / runtime | Docs |
Claude Code | |
Anthropic API (Messages API) | |
Codex CLI (OpenAI) | |
Gemini CLI (Google) | |
VS Code (Copilot) | |
Claude Desktop | |
Cursor | |
Windsurf | |
Cline | |
Zed | |
Any other MCP host | Use command/args/env from Generic MCP Server Config |
Claude Ecosystem Notes
Claude currently has multiple MCP-related concepts that are easy to mix up:
Local MCP servers (Claude Desktop): defined in
claude_desktop_config.jsonand started on your machine (docs).Cowork: reuses the MCP servers connected in Claude Desktop (docs).
Connectors: remote MCP integrations managed in Claude (docs).
Cowork plugins: Claude-specific workflow packaging (instructions + tools/data integrations) (docs). Useful in Claude, but not portable as a generic MCP server config for other agent clients.
Verified against vendor docs on 2026-03-05.
Setup (Power Users)
If Quick Start worked in your client, you can skip this section. These are additional per-client setup options and CLI one-liners.
Generic MCP Server Config
Use this as the baseline in any host:
Command:
npxArgs:
["-y", "postnl-mcp"]Required env vars:
POSTNL_API_KEY,POSTNL_CUSTOMER_CODE,POSTNL_CUSTOMER_NUMBEROptional env vars:
POSTNL_CACHE_TTL,POSTNL_MAX_RETRIES,POSTNL_TOOLSETS(see Configuration)
Minimal JSON (adapt the top-level key to your host):
{
"<servers-key>": {
"postnl-mcp": {
"command": "npx",
"args": ["-y", "postnl-mcp"],
"env": {
"POSTNL_API_KEY": "your-api-key",
"POSTNL_CUSTOMER_CODE": "your-customer-code",
"POSTNL_CUSTOMER_NUMBER": "your-customer-number"
}
}
}
}Host key mapping:
Host | Top-level key | Notes |
VS Code |
| Add |
Claude Desktop / Cursor / Windsurf / Cline |
| Same command/args/env block |
Zed |
| Same command/args/env block |
Codex CLI (TOML) |
| Uses TOML, shown below |
Claude Code
claude mcp add --scope user postnl-mcp \
--env POSTNL_API_KEY=your-api-key \
--env POSTNL_CUSTOMER_CODE=your-customer-code \
--env POSTNL_CUSTOMER_NUMBER=your-customer-number \
-- npx -y postnl-mcpCodex CLI (OpenAI)
codex mcp add postnl-mcp \
--env POSTNL_API_KEY=your-api-key \
--env POSTNL_CUSTOMER_CODE=your-customer-code \
--env POSTNL_CUSTOMER_NUMBER=your-customer-number \
-- npx -y postnl-mcp~/.codex/config.toml alternative:
[mcp_servers.postnl-mcp]
command = "npx"
args = ["-y", "postnl-mcp"]
env = { "POSTNL_API_KEY" = "your-api-key", "POSTNL_CUSTOMER_CODE" = "your-customer-code", "POSTNL_CUSTOMER_NUMBER" = "your-customer-number" }Gemini CLI (Google)
gemini mcp add postnl-mcp -- npx -y postnl-mcpSet POSTNL_API_KEY, POSTNL_CUSTOMER_CODE, and POSTNL_CUSTOMER_NUMBER in ~/.gemini/settings.json.
VS Code (Copilot)
Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P) > MCP: Add Server > Command (stdio), or use .vscode/mcp.json with top-level key servers and the canonical command/args/env block from Generic MCP Server Config.
Claude Desktop + Cowork / Cursor / Windsurf / Cline / Zed
Cowork runs inside Claude Desktop and uses the same connected MCP servers and permissions. Configure once in Claude Desktop, then the server is available in Cowork.
Use the canonical config block and place it in the host file below with the matching top-level key.
Client | Config location | Top-level key |
Claude Desktop (macOS) |
|
|
Claude Desktop (Windows) |
|
|
Cursor (project) |
|
|
Cursor (global) |
|
|
Windsurf |
|
|
Cline | MCP settings UI |
|
Zed (macOS/Linux) |
|
|
Docker
docker run -i --rm \
-e POSTNL_API_KEY=your-api-key \
-e POSTNL_CUSTOMER_CODE=your-customer-code \
-e POSTNL_CUSTOMER_NUMBER=your-customer-number \
ghcr.io/bartwaardenburg/postnl-mcpOther MCP Clients
Use the values from Generic MCP Server Config.
Terminology
What is portable across hosts:
MCP server runtime settings (
command,args,env)Transport model (
stdiocommand server)Tool names and tool schemas exposed by this server
What is host/vendor-specific (not portable as-is):
Host config key names (
servers,mcpServers,context_servers,mcp_servers)Host UX/workflows for adding servers (CLI commands, UI menus, settings paths)
Anthropic-specific concepts such as Claude Desktop local MCP servers, Claude Connectors via remote MCP, and Claude Code plugins used in Cowork workflows
Security Notes
Trust model: Any prompt or agent allowed to call this MCP server can execute PostNL API actions with the configured credentials.
Least-privilege credentials: Use separate PostNL credentials per environment/team/use case and only required API subscriptions.
Write-action approvals: Enable host-side approvals for mutating tools (shipment creation and other write operations).
Team config governance: Keep shared MCP config in version control, require review for changes to command/args/env/toolset filtering, and keep secrets in a vault or host secret manager (not in plain-text repo files).
Configuration
Required
Variable | Description |
| Your PostNL API key |
| Your PostNL customer code (used in barcode generation and shipments) |
| Your PostNL customer number (used in shipment requests) |
Get your API credentials from the PostNL Developer Portal. Your customer code and customer number can be found in your PostNL business account.
Optional
Variable | Description | Default |
| Response cache lifetime in seconds. Set to |
|
| Maximum retry attempts for rate-limited (429) requests with exponential backoff. |
|
| Comma-separated list of tool categories to enable (see Toolset Filtering). | All toolsets |
API Key Setup
Creating Your API Key
Register for a PostNL Developer Portal account
Subscribe to the APIs you need (Shipment, Barcode, Delivery Date, etc.)
Generate an API key for your application
Find your Customer Code and Customer Number in your PostNL business contract or portal
Required API Subscriptions
Depending on which tools you use, subscribe to:
API Subscription | Tools |
Barcode API |
|
Labelling API (Shipment v2) |
|
Status API (Shipment v2) |
|
Delivery Date API |
|
Timeframe API |
|
Locations API |
|
Available Tools
Shipping
Tool | Description |
| Generate a PostNL barcode for shipping (types: 2S mailbox, 3S domestic, CC/CP/CD/CF EU, LA/RI/UE international) |
| Create a shipment with label generation — provide sender/receiver address, get a PDF or ZPL shipping label back |
Tracking
Tool | Description |
| Track a parcel by barcode — returns current status, timestamps, and full event history |
Delivery
Tool | Description |
| Calculate the expected delivery date for a shipment based on postal code, shipping date, and product code |
| Get available delivery timeframes for an address (morning, afternoon, evening windows) |
Locations
Tool | Description |
| Find nearby PostNL pickup/drop-off points by postal code, city, or GPS coordinates |
| Get details of a specific PostNL location by location code |
Toolset Filtering
Reduce context window usage by enabling only the tool categories you need. Set the POSTNL_TOOLSETS environment variable to a comma-separated list:
POSTNL_TOOLSETS=shipping,trackingToolset | Tools included |
| Barcode generation and shipment creation |
| Parcel tracking by barcode |
| Delivery date calculation and timeframe options |
| PostNL location finder and details |
When not set, all toolsets are enabled. Invalid names are ignored; if all names are invalid, all toolsets are enabled as a fallback.
Barcode Types
PostNL uses different barcode types depending on the shipment:
Type | Description | Serie format |
| Mailbox parcel |
|
| Standard domestic parcel |
|
| EU consumer parcel |
|
| EU compact parcel |
|
| EU standard parcel |
|
| EU bulk parcel |
|
| International Letter Registered |
|
| International Registered Shipment |
|
| International EMS |
|
Common Product Codes
Code | Description |
| Standard shipment |
| Deliver to stated address only |
| Delivery to neighbour + return when not home |
| Extra cover |
| Signature on delivery + deliver to stated address only |
| Signature on delivery |
| Pickup + signature on delivery |
| Pickup + extra cover |
| Pickup + signature on delivery + notification |
| Age check (18+) |
| Mailbox parcel (brievenbuspakje) |
Evening delivery is not a separate product code — use any compatible product code (e.g. 3085) with product option {Characteristic: "118", Option: "006"} and a DeliveryDate.
Voorbeelden
Eenmaal verbonden kun je in gewoon Nederlands vragen stellen:
"Genereer een barcode voor een binnenlands pakket"
"Maak een zending aan van mijn magazijn op Hoofdstraat 1, Amsterdam naar Kerkstraat 42, Rotterdam"
"Volg pakket 3STBJG123456789"
"Wat is de verwachte bezorgdatum voor postcode 1234AB als ik vandaag verstuur?"
"Toon bezorgtijdvakken voor 2511 BT Den Haag"
"Zoek PostNL afhaalpunten bij postcode 3011 AA"
"Geef details van PostNL locatie 176227"
Example Usage
Once connected, you can interact with the PostNL API using natural language:
"Generate a barcode for a domestic parcel"
"Create a shipment from my warehouse at Hoofdstraat 1, Amsterdam to Kerkstraat 42, Rotterdam"
"Track parcel 3STBJG123456789"
"What's the expected delivery date for postal code 1234AB if I ship today?"
"Show me delivery timeframes for 2511 BT Den Haag"
"Find PostNL pickup points near postal code 3011 AA"
"Get details of PostNL location 176227"
Community
Support: SUPPORT.md
Security reporting: SECURITY.md
Contributing guidelines: CONTRIBUTING.md
Bug reports and feature requests: Issues
Development
# Install dependencies
pnpm install
# Run in development mode
pnpm dev
# Build for production
pnpm build
# Run tests
pnpm test
# Type check
pnpm typecheckProject Structure
src/
index.ts # Entry point (stdio transport)
server.ts # MCP server setup and toolset filtering
postnl-client.ts # PostNL API HTTP client with caching and retry
cache.ts # TTL-based in-memory response cache
types.ts # TypeScript interfaces for PostNL API
tool-result.ts # Error formatting with recovery suggestions
update-checker.ts # NPM update notifications
tools/
shipping.ts # Barcode generation and shipment creation
tracking.ts # Parcel tracking by barcode
delivery.ts # Delivery date and timeframe calculation
locations.ts # PostNL location finderRequirements
Node.js >= 20
A PostNL business account with API credentials
License
MIT - see LICENSE for details.
Available Tools
7 toolscreate_shipmentCreate ShipmentA
Create a PostNL shipment and generate a shipping label. Requires a barcode (use generate_barcode first), sender address (AddressType 02), and receiver address (AddressType 01). Returns a PDF label as base64. Common product codes: 3085 (standard), 3385 (stated address only), 3090 (neighbour + return), 3087 (extra cover), 3089 (signature on delivery), 3533/3534 (pickup point). Evening delivery: use product option {Characteristic: '118', Option: '006'} with a DeliveryDate. WARNING: Creating a shipment incurs shipping costs. Always confirm with the user before calling this tool.
Inputs: barcode (required), addresses (required), remark, confirm, +8 more.
find_locationsFind PostNL LocationsARead-only
Find nearby PostNL pickup/drop-off points (post offices, parcel lockers, retail points). Search by postal code, city, coordinates, or a combination. Useful for finding the nearest place to drop off or collect a parcel.
Inputs: city, street, latitude, longitude, +6 more.
generate_barcodeGenerate BarcodeA
Generate a PostNL barcode for shipping. The barcode is required before creating a shipment. Types: 2S (mailbox parcel), 3S (domestic NL parcels), CC/CP/CD/CF (EU parcels), LA (EU letter), RI (registered international), UE (non-EU parcels).
Inputs: type, range, serie.
get_delivery_dateGet Delivery DateARead-only
Calculate the expected delivery date for a shipment based on the shipping date, postal code, and delivery options. Useful for showing customers when they can expect their parcel.
Inputs: postalCode (required), shippingDate (required), city, houseNr, +6 more.
get_delivery_optionsGet Delivery OptionsARead-only
Get available delivery time windows for a specific address and date range. Returns available timeframes including daytime, evening, and morning delivery options.
Inputs: endDate (required), startDate (required), postalCode (required), city, +6 more.
get_locationGet PostNL LocationARead-only
Get detailed information about a specific PostNL location by its location code. Returns address, opening hours, available delivery options, and contact information.
Inputs: locationCode (required), retailNetworkID.
get_shipment_statusGet Shipment StatusARead-only
Track a PostNL shipment by barcode. Returns the current status, expected delivery date, and status history of the shipment.
Inputs: barcode (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools target clearly distinct actions (barcode generation, shipment creation, tracking, delivery calculation). The only mild overlaps are get_location vs find_locations and get_delivery_date vs get_delivery_options, but the descriptions clearly differentiate lookup-by-code vs nearby-search and date-calculation vs time-window-retrieval.
All tool names follow a consistent snake_case verb_noun pattern: get_location, generate_barcode, create_shipment, get_shipment_status, get_delivery_date, get_delivery_options, find_locations. Verbs are used predictably (get/find/generate/create).
Seven tools is well-scoped for a shipping/logistics server, covering the full create-track-locate workflow without obvious padding. Each tool earns its place.
The core shipment lifecycle (barcode, create, track, delivery estimation, location search) is well covered. Minor gaps exist: no cancel shipment, no separate label retrieval/reprint, and no shipping-cost/rate calculation, but these are workarounds rather than blocking dead ends.
Maintenance
Related MCP Connectors
Multi-carrier shipping for AI agents: compare rates, buy labels, track packages, validate addresses
Furgonetka MCP Server is an extension for LLMs (such as Claude) that integrates AI assistants with Poland's most popular courier brokerage platform. The server enables models to interact directly with services from various couriers (including InPost, DPD, DHL, UPS, and Poczta Polska) through a single, unified interface. With this integration, your AI stops just "writing about logistics" and starts actually managing it.
MCP server for EasyPost — rate shipments, buy & refund labels, track packages, verify addresses.
Manage Zineps shipments, labels, orders, invoices, and partner operations with AI assistants.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to track and manage deliveries by interacting with the Parcel delivery tracking API. Users can add new shipments, retrieve active delivery statuses, and look up carrier information through natural language.2MIT

Easyship MCPofficial
AlicenseNot gradedqualityDmaintenanceEnables AI agents to manage global shipping operations, including rate comparison, shipment creation, label purchasing, tracking, pickup scheduling, address validation, billing, and analytics, via natural language.MIT- AlicenseBqualityBmaintenanceIntegrates the Machship freight management platform with MCP-compatible LLMs, enabling shipment creation, quotes, labels, and carrier management via natural language.12568 npm1ISC
- AlicenseAqualityDmaintenanceEnables AI clients to quote, ship, track, void, and manage shipments via the Deftship multi-carrier shipping API using natural language commands.32MIT