Files
aura-courier-mcp/README.md
T

20 KiB
Raw Blame History

🚚 AURA COURIER MCP v2.7.5 — THE ENTERPRISE LOGISTICS MASTER MANUAL

Universal Multi-Carrier Logistics Engine, Spatial Intelligence Hub & Zero-Risk COD Gateway

Published by Aura Agentic AI · Architected with DeepMind Principles & Google Maps Platform

Google Cloud Partner Advantage auraajenticai/aura-courier-mcp MCP server Antigravity Plugin User Guide BN/EN License: Apache-2.0 Status Node

Aura Courier MCP server

1. Executive Architecture Overview

Aura Courier MCP (https://courier.auraajenticai.cloud/mcp) is an enterprise-grade, carrier-agnostic Cash On Delivery (COD) logistics gateway and Model Context Protocol (MCP) server. It bridges autonomous AI models (Vertex AI, Claude, Antigravity, ChatGPT, Cursor) with physical courier networks across all 64 districts of Bangladesh.

Core Architectural Pillars

graph TD
    AI[AI Agent / Vertex AI / Dashboard] -->|Streamable-HTTP / MCP| MCP[Aura Courier MCP Server v2.7.5]
    
    subgraph "Intelligent Logic Engines"
        MCP --> ROUTER[Multi-Carrier Smart Router]
        MCP --> FRAUD[Bayesian Fraud & Delivery Risk Engine]
        MCP --> SPATIAL[Google Maps Platform Spatial Engine]
        MCP --> NDR[Automated NDR Resolution Suite]
        MCP --> WEBHOOKS[Bidirectional Webhook Hub]
    end
    
    subgraph "Physical Logistics Carriers"
        ROUTER --> SF[Steadfast Courier - 64 Districts]
        ROUTER --> PT[Pathao Express - On-Demand]
        ROUTER --> RX[RedX Delivery - 2,849 Hubs]
        ROUTER --> PF[Paperfly Go - Doorstep Coverage]
    end
    
    subgraph "Spatial Services"
        SPATIAL --> GEO[Geocoding API]
        SPATIAL --> ROUTES[Routes API v2:computeRoutes]
        SPATIAL --> STUDIO[Dynamic Map Studio]
    end
  1. Carrier-Agnostic Multi-Routing: Unifies Steadfast, Pathao, RedX, and Paperfly into a single normalized interface.
  2. Zero Mock Data Policy: Every single metric, delivery status, tariff calculation, and fraud score is computed against live carrier databases or authentic mathematical models.
  3. Spatial Hierarchy Resolver: Resolves street addresses into precise administrative hierarchies (City → Zone → Area) eliminating HTTP 422 errors.
  4. Automated NDR & Dispute Suite: Resolves failed courier deliveries via automated customer WhatsApp re-engagement and carrier operational hold tickets.
  5. Real-Time Webhook Processing: Instant asynchronous updates from carriers dispatched directly to merchant dashboards.

2. Multi-Carrier Enterprise Integration Matrix

Aura Courier MCP seamlessly interfaces with all tier-1 Bangladesh courier APIs under a unified standard:

Provider Endpoint / Base URL Merchant Account / IDs Auth Header / Secret Operational Status
Steadfast https://portal.packzy.com/api/v1 Account: <MERCHANT> (ID: <STORE_ID>) Api-Key: <STEADFAST_API_KEY>
Secret-Key: <STEADFAST_SECRET_KEY>
Active: get_balance verified 200 OK. Order booking pending carrier-side toggle.
Pathao https://api-hermes.pathao.com User: <PATHAO_USERNAME>
Store: <MERCHANT> (ID: <PATHAO_STORE_ID>)
Client-ID: <PATHAO_CLIENT_ID>
Client-Secret: <PATHAO_CLIENT_SECRET>
100% Active: OAuth2 token issuing, price calculation, auto-geocoding live.
RedX https://openapi.redx.com.bd/v1.0.0-beta Shop ID: <REDX_SHOP_ID>
Pickup Store ID: <REDX_STORE_ID>
API-ACCESS-TOKEN: <REDX_API_TOKEN>
(JWT Bearer Token)
100% Active: 2,849 delivery areas and parcel booking verified.
Paperfly https://api.paperfly.com.bd Store: <MERCHANT>
User: <PAPERFLY_USERNAME>
paperflykey: <PAPERFLY_KEY>
Basic Auth: <PAPERFLY_USERNAME> / <PAPERFLY_PASSWORD>
100% Active: Order placement (new_order_v2.php) and tracking verified.
Google Maps https://maps.googleapis.com Project: <GOOGLE_CLOUD_PROJECT> <GOOGLE_MAPS_API_KEY>
(Field Masked)
100% Active: Geocoding, Routes API, and Dynamic Map Studio active.

3. Official Carrier Integration Specifications

3.1. Pathao Express Integration

  • Token Issuance: POST /aladdin/api/v1/issue-token
    curl --location 'https://api-hermes.pathao.com/aladdin/api/v1/issue-token' \
      --header 'Content-Type: application/json' \
      --data-raw '{
        "client_id": "<PATHAO_CLIENT_ID>",
        "client_secret": "<PATHAO_CLIENT_SECRET>",
        "grant_type": "password",
        "username": "<PATHAO_USERNAME>",
        "password": "<PATHAO_PASSWORD>"
      }'
    
  • Store Management: GET /aladdin/api/v1/stores
    • Active Store: <PATHAO_STORE_ID> ("", Central Hub, Dhaka)
  • Parcel Booking: POST /aladdin/api/v1/orders
    • Required Fields: store_id, recipient_name, recipient_phone (11 digits), recipient_address (10-220 chars), delivery_type (48), item_type (2), item_weight (0.5 to 10 kg), amount_to_collect (integer).
    • Spatial Hierarchy: recipient_city, recipient_zone, recipient_area are auto-resolved from our intelligent catalog matcher; if unresolvable, they are safely omitted so Pathao's server-side geocoder infers them directly.
  • Order Tracking: GET /aladdin/api/v1/orders/{consignment_id}/info
  • Price Plan API: POST /aladdin/api/v1/merchant/price-plan

3.2. Steadfast Courier Integration

  • Base Portal: https://portal.packzy.com/api/v1
  • Headers: Api-Key: <STEADFAST_API_KEY>, Secret-Key: <STEADFAST_SECRET_KEY>
  • Account Balance: GET /get_balance
  • Fraud Risk Database: GET /fraud_check/{phone}
  • Order Dispatch: POST /create_order
  • Status Tracking: GET /status_by_trackingcode/{tracking_code}

3.3. RedX Delivery Integration

  • Base Portal: https://openapi.redx.com.bd/v1.0.0-beta
  • Headers: API-ACCESS-TOKEN: Bearer {token}
  • Delivery Areas (2,849 Hubs): GET /areas
  • Parcel Creation: POST /parcel
  • Parcel Tracking: GET /parcel/track/{tracking_id}

3.4. Paperfly Integration

  • Base Portal: https://api.paperfly.com.bd
  • Headers: paperflykey: <PAPERFLY_KEY>
  • Authentication: HTTP Basic Auth (<PAPERFLY_USERNAME>:<PAPERFLY_PASSWORD>)
  • Parcel Booking: POST /merchant/api/service/new_order_v2.php
  • Tracking: POST /API-Order-Tracking with ReferenceNumber

4. The 13 Enterprise Model Context Protocol (MCP) Tools

Aura Courier MCP exports 13 tools conforming to the MCP Specification (2025-03-26 / 2024-11-05):

1. list_couriers

  • Purpose: Inspect carrier operational health and active credentials.
  • Input Schema: {}
  • Response: Array of providers with is_configured: true/false.

2. create_parcel

  • Purpose: Dispatch a real parcel through Steadfast, Pathao, RedX, Paperfly, or auto smart routing.
  • Input Schema:
    {
      "courier": "auto | steadfast | pathao | redx | paperfly",
      "invoice": "INV-2026-001",
      "recipient_name": "Rahim Ahmed",
      "recipient_phone": "01711223344",
      "recipient_address": "House 12, Road 4, Sector 3, Uttara, Dhaka",
      "cod_amount": 1500,
      "note": "Handle with care",
      "item_weight": 0.5
    }
    

3. track_parcel

  • Purpose: Consolidated shipment tracking across all carriers.
  • Input Schema: {"tracking_code": "SF-12345", "courier": "steadfast"}

4. get_balance

  • Purpose: Merchant COD vault balance & payout status.
  • Input Schema: {"courier": "steadfast"}

5. check_fraud_risk

  • Purpose: Nationwide e-commerce fraud and return-risk evaluation.
  • Features:
    • Connects to real nationwide logistics history (millions of consignments).
    • Evaluates delivery success rate, cancellation counts, and customer reliability.
    • Zero fabricated strings or simulated random metrics.
  • Input Schema: {"phone": "01711223344"}

6. validate_and_geocode_address

  • Purpose: Address verification via Google Maps Platform Geocoding API.
  • Returns: Formatted address, Thana, District, Division, lat/lng coordinates, and deliverability confidence score (0-100).
  • Input Schema: {"address": "Road 11, Banani, Dhaka", "district": "Dhaka"}

7. calculate_delivery_zone_and_fee

  • Purpose: Live road routing via Google Maps Platform Routes API (v2:computeRoutes).
  • Zones:
    • inside_dhaka (≤22 km): ৳80 | 24–48 hours
    • sub_dhaka (22–45 km or Savar/Gazipur/Keraniganj/Narayanganj): ৳100 | 48–72 hours
    • outside_dhaka (>45 km / nationwide): ৳150 | 72–96 hours
  • Input Schema: {"recipient_address": "Chittagong GEC Circle", "weight_kg": 1.0}

8. compare_courier_rates (v2.4 New)

  • Purpose: Side-by-side tariff, SLA, and COD fee comparison across all 4 carriers for any destination.
  • Input Schema:
    {
      "recipient_address": "Agrabad C/A, Chittagong",
      "weight_kg": 1.5,
      "cod_amount": 2500,
      "priority": "cheapest | fastest | balanced"
    }
    
  • Returns: Best recommended courier, savings rationale, and 4 detailed carrier quotes.

9. resolve_ndr_issue

  • Purpose: Non-Delivery Report (NDR) triage and automated dispute draft generation.
  • Issues Handled: fake_attempt, customer_phone_off, reschedule_requested, wrong_address, customer_refused.
  • Output: customer_whatsapp_message, carrier_instruction, and resolution_status: "DRAFT_GENERATED".

10. cancel_parcel

  • Purpose: Request parcel cancellation with strict tenant isolation (courier, consignment_id, reason?).

11. update_parcel

  • Purpose: Update delivery instructions, phone, address, or COD amount for an active parcel (courier, consignment_id, recipient_phone?, recipient_address?, cod_amount?, note?).

12. bulk_create_parcels

  • Purpose: Validate (dry_run: true) or book up to 100 parcels in a batch with isolated per-item error handling and durable idempotency.

13. get_webhook_events

  • Purpose: Retrieve normalized tenant-scoped carrier webhook updates (consignment_id?, since?).

5. Bidirectional Webhooks Hub

5.1. Steadfast Webhook Receiver

  • Callback URL: https://courier.auraajenticai.cloud/webhooks/steadfast
  • Auth: Authorization: Bearer <STEADFAST_API_KEY> (configured in Steadfast portal)
  • Supported Notification Types:
    1. delivery_status: Real-time status shifts (pending, delivered, partial_delivered, cancelled, unknown).
    2. tracking_update: Package milestone scans and sorting center transitions.
  • Steadfast Expected Response:
    HTTP 200 OK
    {
      "status": "success",
      "message": "Webhook received successfully."
    }
    

5.2. Pathao Webhook Receiver

  • Callback URL: https://courier.auraajenticai.cloud/webhooks/pathao
  • Supported Events: Order placement, rider pickup, out-for-delivery, and RTO events.

6. Real-Time Verification & Test Suite

6.1. Inspect MCP Health & Tools

curl -s https://courier.auraajenticai.cloud/health | jq

Expected Output:

{
  "ok": true,
  "version": "2.7.5"
}

6.2. Test Steadfast Webhook Simulation

curl -X POST https://courier.auraajenticai.cloud/webhooks/steadfast \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <STEADFAST_API_KEY>" \
  -d '{
    "notification_type": "delivery_status",
    "consignment_id": 981245,
    "invoice": "INV-67890",
    "cod_amount": 1500.0,
    "status": "delivered",
    "delivery_charge": 100.0,
    "tracking_message": "Package delivered to customer.",
    "updated_at": "2026-09-11 03:30:00"
  }'

Expected Response: {"status":"success","message":"Webhook received successfully."}

6.3. Test MCP Initialize via Streamable-HTTP

curl -i -X POST https://courier.auraajenticai.cloud/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {},
      "clientInfo": { "name": "terminal-test", "version": "1.0" }
    }
  }'

7. Connecting to AI Agents & IDEs

Claude Desktop / Cursor / Antigravity MCP Config

Add this configuration block to your client settings (claude_desktop_config.json or settings.json):

{
  "mcpServers": {
    "aura-courier": {
      "command": "npx",
      "args": ["-y", "aura-courier-mcp@2.7.5"],
      "env": {
        "PORT": "8080",
        "GOOGLE_MAPS_API_KEY": "<GOOGLE_MAPS_API_KEY>",
        "STEADFAST_API_KEY": "<STEADFAST_API_KEY>",
        "STEADFAST_SECRET_KEY": "<STEADFAST_SECRET_KEY>",
        "STEADFAST_BASE_URL": "https://portal.packzy.com/api/v1",
        "PATHAO_CLIENT_ID": "<PATHAO_CLIENT_ID>",
        "PATHAO_CLIENT_SECRET": "<PATHAO_CLIENT_SECRET>",
        "PATHAO_USERNAME": "<PATHAO_USERNAME>",
        "PATHAO_PASSWORD": "<PATHAO_PASSWORD>",
        "PATHAO_STORE_ID": "<PATHAO_STORE_ID>",
        "PATHAO_BASE_URL": "https://api-hermes.pathao.com",
        "REDX_API_TOKEN": "<REDX_API_TOKEN>",
        "REDX_PICKUP_STORE_ID": "<REDX_STORE_ID>",
        "REDX_BASE_URL": "https://openapi.redx.com.bd/v1.0.0-beta",
        "PAPERFLY_API_KEY": "<PAPERFLY_KEY>",
        "PAPERFLY_USERNAME": "<PAPERFLY_USERNAME>",
        "PAPERFLY_PASSWORD": "<PAPERFLY_PASSWORD>",
        "PAPERFLY_STORE_NAME": "<MERCHANT>",
        "PAPERFLY_BASE_URL": "https://api.paperfly.com.bd"
      }
    }
  }
}

Or connect directly via Streamable-HTTP URL:

  • Server URL: https://courier.auraajenticai.cloud/mcp
  • Client Protocol: MCP Streamable-HTTP (2024-11-05)

Google Antigravity Plugin (One-Click Marketplace Activation)

For Google Antigravity agents, activate directly via the Antigravity Marketplace Card:

<plugin-card catalog-id="antigravity-plugins-partners/plugin/aura-courier"></plugin-card>

Or declare in your Antigravity plugins.json:

{
  "plugins": {
    "aura-courier": {
      "source": "https://github.com/auraajenticai/aura-courier-mcp"
    }
  }
}

Bundles the complete courier-ops skill (13 tools), rules/COURIER_RULES.md (smart auto-routing cascade & zero-mock policies), and mcp_config.json.


Service Attribution ID: gmp_git_agentskills_v1
APIs Utilized:

  1. Geocoding API: Street and sublocality resolution for Bangladesh administrative areas.
  2. Routes API (v2:computeRoutes): Precise road distance metrics and zone classification.
  3. Maps Embed API: Interactive visual maps with $0 operational cost.

9. Version History & Glama TDQS 5.0 Audit Log

  • v2.7.5 (Nov 27, 2026):
    • Zero-Defect Security, SQL Schema & Registry Parity Release: Fixed courier_parcels SQL column alignment & strict AND tenant = $... isolation across update_parcel, cancel_parcel, and 90-day PII retention; hardened rate_limit.ts against X-Forwarded-For/CF-Connecting-IP spoofing and added OAuth endpoint rate limits; replaced legacy browser demo keys with safe server-side /api/public/fraud-demo; enforced GET /mcp SSE session auth & query-token URL redaction; upgraded Dockerfile to multi-stage non-root (USER node); published 2.7.5 to npmjs.org.
  • v2.7.2 (Nov 27, 2026):
    • Enterprise Security Hardening: Fail-closed startup secret validation, timing-safe webhook verification + 409 replay defense, auth-first BYOK + official HTTPS carrier host allowlist (maxRedirects: 0), public tracking PII/COD redaction, concurrent + PostgreSQL durable invoice idempotency, and ambiguous-outcome cascade halt (0 npm vulnerabilities).
  • v2.7.1 (Nov 24, 2026):
    • Global AI Agent Partner Directory Certification Ready: Added MCP 2025-03-26 tool annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) on all 13 tools, claude.com + global AI/automation OAuth partner redirects, official Antigravity $schema + serverUrl + 13-tool SKILL.md, Official MCP Registry remotes in server.json, live /terms Terms of Service, and npm 2.7.1 sync.
  • v2.7.0 (Nov 24, 2026):
    • Standard MCP OAuth 2.1 + PKCE (S256) + RFC 9728 / 8414 / 7591 DCR: Native remote OAuth connectivity for Google Gemini, Antigravity Marketplace, ChatGPT, and Claude Web with 1-click Aura Cloud SSO, Google Sign-In, Developer API Key Dual-Auth, and non-rotating refresh tokens.
    • 13 Live Logistics & Spatial Tools + Full Glama / Antigravity Plugin Parity: Synchronized all manifests (package.json, plugin.json, server.json, validate_plugin.js) and expanded automated tests (30+ passing).
  • v2.6.1 (Nov 13, 2026):
    • Single-Source-of-Truth Release Parity (src/version.ts): Unified version synchronization across package.json, server.json, plugin.json, /health, MCP Server metadata, GitHub Releases, Gitea, Glama Registry, and live web UI (v2.6.1).
    • TypeScript Strict pnpm Compatibility & Silicon Valley UI: Explicit Express typing resolving Glama Dockerfile TS2742, inline SVG carrier/tool iconography, RedX monogram badge, and interactive #hubmap canvas animation.
  • v2.6.0 (Nov 10, 2026):
    • Bilingual User Guide & Business Benefits Hub (GET /guide): Interactive Bengali & English documentation (https://courier.auraajenticai.cloud/guide) covering 3-in-1 WooCommerce/Shopify integration, 6-Pillar WhatsApp/Messenger AI Bot harmony, Multi-Tenant Isolation, and MCP AI Agent setup.
    • Bilingual Real-Time Fraud Risk Output (🇧🇩 বাংলা | 🇬🇧 English): Upgraded FraudRiskEngine.evaluateRisk and In-Dashboard Quick-Ship widget (/api/courier/quick-ship) with bilingual recommendations and 1-click language switching.
    • Repository Governance & Glama Discovery Optimization: Added SECURITY.md, CONTRIBUTING.md, CHANGELOG.md, and official Glama MCP card badge.
  • v2.5.1 (Nov 10, 2026):
    • Zero-Knowledge AES-256 Cryptographic Vault & Zero Admin Visibility: Explicitly documented international cryptographic vault isolation in /privacy, guaranteeing that client Courier MCP API keys cannot be viewed or read by administrators.
    • Direct Dashboard Login & 3-in-1 E-Commerce Store Bridge: Streamlined landing navigation (Login ↗) and synchronized MCP server metadata across all endpoints (v2.5.1).
  • v2.5.0 (Nov 9, 2026):
    • Zero Hardcoded Credentials: Purged all merchant secrets from repository code, enforcing strict runtime environment variable isolation.
    • Glama TDQS 5.0 Compliance: Upgraded all 9 MCP tool definitions with explicit side-effects disclosure (state-mutating vs read-only), when-to-use vs when-not-to-use scenarios, and comprehensive parameter constraints.
    • Service Telemetry Update: Updated /health endpoint to reflect v2.5.0 and automated release tag synchronization.
  • v2.4.2 (Nov 5, 2026): Official Google Antigravity Plugin bundle and partner advantage packaging.
  • v2.4.0 (Oct 22, 2026): Multi-carrier cascading auto-routing, rate comparison, and NDR dispute suite.

Copyright © 2026 Aura Agentic AI khondokartowsif171@gmail.com.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.