DEV Community

Raj Narayanasamy
Raj Narayanasamy

Posted on

Let AI Shop for You — Build AI-Powered Commerce with the W3Ship MCP Server

What if you could tell Claude: "Buy me a VR headset and book a session for 4 PM" — and it just... did it?

No login. No password. No OAuth dance. Just your wallet address as identity.

That's what W3Ship MCP Server does. It's a Model Context Protocol (MCP) server that gives AI assistants 13 commerce tools — shopping carts, orders, shipment tracking, and session booking — all using cryptographic identity.

Let's set it up in under 5 minutes.


What You'll Build

By the end of this tutorial, you'll have an AI assistant that can:

  • ✅ Create a shopping cart linked to your wallet address
  • ✅ Add items and place orders
  • ✅ Track shipments in real-time
  • ✅ Book session time slots (VR, fitness, dining, etc.)
  • ✅ Look up shipping addresses via cryptographic signature

All through natural language. No API keys to manage.


Prerequisites

  • Node.js 18+
  • Redis (or Docker): docker run -p 6379:6379 redis:latest
  • One of: Claude Desktop, Cursor, VS Code, or Gemini CLI

Step 1: Install & Configure

No npm install needed. The MCP server runs via npx.

Claude Desktop

Open your claude_desktop_config.json and add:

{
  "mcpServers": {
    "w3ship": {
      "command": "npx",
      "args": ["-y", "w3ship-mcp-server"],
      "env": {
        "W3SHIP_PUBLIC_KEY": "YOUR_METAMASK_ADDRESS_WITHOUT_0x",
        "VALKEY_HOST": "localhost",
        "VALKEY_PORT": "6379"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Cursor

Same config in .cursor/mcp.json.

VS Code

{
  "servers": {
    "w3ship": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "w3ship-mcp-server"],
      "env": {
        "W3SHIP_PUBLIC_KEY": "YOUR_METAMASK_ADDRESS_WITHOUT_0x",
        "VALKEY_HOST": "localhost",
        "VALKEY_PORT": "6379"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

That's it. Restart your client and you have 13 commerce tools available.


Step 2: Your First Shopping Trip

Open Claude (or your preferred client) and try:

"I want to shop on W3Ship"

If you set W3SHIP_PUBLIC_KEY, Claude will create a cart automatically. If not, it'll call generate_demo_key to create a test identity.

The Full Flow

You: "Create a cart and add a VR headset"

Claude: [calls create_cart → add_item]
        "Done! Created cart and added VR headset. 
         Want to browse session times too?"

You: "Yeah, what's available downtown today?"

Claude: [calls get_available_slots]
        "Downtown VR has slots at:
         • 2:00 PM - $45 (3 spots)
         • 4:00 PM - $45 (5 spots)"

You: "Hold the 4 PM slot and place my order"

Claude: [calls hold_slot → create_order]
        "Order confirmed! 
         Order: ord_x7k2m9p4
         Tracking: TRK-8392751046
         4 PM slot held for 10 minutes."

You: "Track my shipment"

Claude: [calls track_shipment]
        "Status: Label Created
         Carrier: QuantumLogistics
         You'll get updates as it moves."
Enter fullscreen mode Exit fullscreen mode

Step 3: Understanding the Identity Model

Here's what makes W3Ship different from every other e-commerce API:

No accounts. No passwords. Your wallet address IS your identity.

The MCP server accepts three identity types:

Type Format Example
EVM Address 40 hex chars Your MetaMask address
ECDSA 66 or 130 hex chars Compressed/uncompressed public key
SLH-DSA 64 hex chars Post-quantum identity (Dah.mx app)

When you set W3SHIP_PUBLIC_KEY in your config, every tool automatically uses it. No need to specify your identity in each request — Claude just shops as you.

Why This Matters

Traditional e-commerce APIs require:

  1. Create an account → email verification → password
  2. Generate API keys → store securely → rotate periodically
  3. OAuth flow → token refresh → session management

W3Ship requires:

  1. Paste your MetaMask address into config
  2. Done

For AI agents, this is transformative. An MCP server shouldn't need to manage OAuth tokens or session cookies. Cryptographic identity eliminates that entire layer.


Step 4: The Architecture

┌─────────────────────────────────────────────┐
│  AI Client (Claude / Cursor / VS Code)      │
│  "Book me a fitness session"                │
└──────────────────┬──────────────────────────┘
                   │ stdio (MCP Protocol)
┌──────────────────▼──────────────────────────┐
│  W3Ship MCP Server (your machine)           │
│                                              │
│  Local (Redis/Valkey):                       │
│  ├── Shopping Carts (TMF663)                 │
│  ├── Orders (TMF622)                         │
│  └── Shipments (TMF621)                      │
│                                              │
│  Remote (w3ship.com API):                    │
│  ├── Session Booking (/api/slots)            │
│  └── Identity Lookup (/api/identity)         │
└──────────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

Cart, order, and shipment data stays on your machine in Redis. The MCP server only calls the W3Ship API for identity verification and session booking. No AWS credentials needed.

The server follows TMF Open API standards (TM Forum), making it interoperable with telecom and enterprise commerce systems.


Step 5: All 13 Tools

Here's every tool available to your AI assistant:

Shopping Cart

  • create_cart — Create a cart (auto-uses your configured identity)
  • get_cart — View cart contents
  • add_item — Add products to cart
  • delete_cart — Remove a cart

Orders & Shipping

  • create_order — Convert cart → confirmed order + shipment
  • get_order — Get order details
  • track_shipment — Real-time tracking with status updates

Session Booking

  • get_available_slots — Browse time slots by location/date
  • hold_slot — Reserve a slot (10-min hold)
  • list_bookings — View confirmed bookings

Identity

  • ship_address — Retrieve shipping address via signed request

Setup

  • generate_demo_key — Generate a test key (no wallet needed)
  • get_identity — Check your configured identity

Try It Without a Wallet

Don't have MetaMask? No problem. Just configure the MCP server without W3SHIP_PUBLIC_KEY:

{
  "mcpServers": {
    "w3ship": {
      "command": "npx",
      "args": ["-y", "w3ship-mcp-server"],
      "env": {
        "VALKEY_HOST": "localhost"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Then tell Claude: "Generate a demo key and create a shopping cart for me."

Claude will call generate_demo_key, get a valid test identity, and start shopping — all automatically.


What's Next


Built with TypeScript, MCP SDK, and Redis. MIT licensed.

If you build something with W3Ship, I'd love to see it — drop a comment below or tag @W3Ship on X.

Top comments (0)