Skip to main content

MCP Server Quickstart

This guide covers everything you need to connect Claude or Cursor to Terminal49’s container tracking data via MCP.
Just want to get started fast? See MCP Overview for a 5-minute setup.

Prerequisites

Before you begin, make sure you have:

Terminal49 Account

A Terminal49 account with API access

API Token

A T49_API_TOKEN from the dashboard

Node.js 18+

Required if running the MCP server locally

MCP Client

Claude Desktop or Cursor IDE
Technical Details:
  • MCP SDK: @modelcontextprotocol/sdk ^1.22.0
  • TypeScript SDK: @terminal49/sdk
  • Runtime: Node.js 18+

Transports

TransportEndpointBest For
HTTP (streamable)POST /api/mcp or POST /mcpServerless, short-lived requests
SSE (stateful)GET /sse?sessionId=<id> then POST /sse?sessionId=<id>Long-running sessions, streaming
Authentication: Pass Authorization: Bearer <T49_API_TOKEN> header. Server falls back to T49_API_TOKEN environment variable.
Claude Desktop and Cursor use the HTTP transport. Use SSE only if you’re building a custom client that needs persistent connections.

Configure Your MCP Client

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
  "mcpServers": {
    "terminal49": {
      "url": "https://mcp.terminal49.com/mcp",
      "headers": {
        "Authorization": "Bearer <T49_API_TOKEN>"
      }
    }
  }
}

Cursor IDE

Add to your Cursor settings:
{
  "mcp": {
    "servers": {
      "terminal49": {
        "url": "https://mcp.terminal49.com/mcp",
        "headers": {
          "Authorization": "Bearer <T49_API_TOKEN>"
        }
      }
    }
  }
}

Local stdio (Development)

For local development without a hosted server:
{
  "mcpServers": {
    "terminal49": {
      "command": "node",
      "args": ["/path/to/API/packages/mcp/dist/index.js"],
      "env": {
        "T49_API_TOKEN": "your_token_here"
      }
    }
  }
}
Build the MCP server first: cd packages/mcp && npm install && npm run build

Test Your Setup

Once configured, verify everything works:
1

Restart your MCP client

Close and reopen Claude Desktop or Cursor to load the new config.
2

Ask Claude to list tools

“List the tools available in the Terminal49 MCP server.”
Claude should respond with a list of 7 tools including search_container, track_container, etc.
3

Search for a test container

“Using the Terminal49 MCP server, search for container TCLU1234567 and summarize its status.”
If configured correctly, Claude will call search_container and return container details.
4

Try a multi-step query

“Using Terminal49, find container CAIU1234567, check its demurrage risk, and tell me if I need to pick it up urgently.”
Claude should chain multiple tools together to answer.
Need test container numbers? See Test Numbers for containers you can use during development.

Troubleshooting

SymptomLikely CauseHow to Fix
”Cannot connect to MCP server”Wrong URL or config pathConfirm URL is https://mcp.terminal49.com/mcp and config file path matches your OS
401 UnauthorizedMissing or invalid tokenCreate a new API token in dashboard; ensure Authorization: Bearer <token> header is set
429 Too Many RequestsRate limit exceededSee Rate Limiting; use webhooks instead of polling
Tools list is emptyConfig not loadedRestart Claude/Cursor; check MCP inspector for errors
”Tool not found”Typo in tool nameUse exact names: search_container, get_container, etc.
Slow responsesLarge data requestsUse include parameter to load only what you need
If using the hosted server, check your Terminal49 dashboard for API logs.If running locally:
cd packages/mcp
T49_API_TOKEN=your_token npm run mcp:stdio 2>&1 | head -20

MCP Capabilities

Tools (7)

ToolDescriptionParameters
search_containerFind containers by number, BL, booking, or refquery: string
track_containerStart tracking a containercontainerNumber, scac?, bookingNumber?, refNumbers?
get_containerGet container with optional includesid: uuid, include?: ['shipment', 'pod_terminal', 'transport_events']
get_shipment_detailsGet shipment and containersid: uuid, include_containers?: boolean
get_container_transport_eventsGet event timelineid: uuid
get_supported_shipping_linesList carriers with SCAC codessearch?: string
get_container_routeGet multi-leg routing (paid feature)id: uuid

Prompts (3)

PromptDescriptionArguments
track-shipmentQuick tracking workflowcontainer_number, carrier?
check-demurrageDemurrage risk analysiscontainer_id
analyze-delaysJourney delay analysiscontainer_id

Resources (2)

URIDescription
terminal49://container/{id}Container data as resource
terminal49://docs/milestone-glossaryEvent/milestone reference
For detailed examples and response formats, see MCP Overview → Tools Reference.

SDK Usage

The TypeScript SDK provides the same capabilities as MCP tools, plus additional APIs not yet exposed via MCP.
npm install @terminal49/sdk
import { Terminal49Client } from '@terminal49/sdk';

const client = new Terminal49Client({
  apiToken: process.env.T49_API_TOKEN!,
  defaultFormat: 'mapped'
});

// Get container with shipment and terminal
const container = await client.containers.get(
  'container-uuid',
  ['shipment', 'pod_terminal']
);

// Search for containers
const results = await client.search('CAIU1234567');

// List shipments with filters (not available via MCP)
const shipments = await client.shipments.list({
  status: 'in_transit',
  carrier: 'MAEU'
});

Response Formats

FormatDescription
rawJSON:API response with data, attributes, relationships
mappedSimplified, camelCase objects with IDs resolved
both{ raw, mapped } for debugging
Raw format:
{
  "data": {
    "type": "container",
    "id": "abc-123",
    "attributes": {
      "container_number": "CAIU1234567",
      "available_for_pickup": true
    }
  }
}
Mapped format:
{
  "id": "abc-123",
  "containerNumber": "CAIU1234567",
  "availableForPickup": true
}

Deployment

Vercel (Production)

The vercel.json configures the MCP server:
{
  "buildCommand": "npm install && npm run build --workspace @terminal49/sdk && npm run build --workspace @terminal49/mcp",
  "functions": {
    "api/mcp.ts": { "maxDuration": 30, "memory": 1024 },
    "api/sse.ts": { "maxDuration": 60, "memory": 1024 }
  },
  "rewrites": [
    { "source": "/mcp", "destination": "/api/mcp" },
    { "source": "/sse", "destination": "/api/sse" }
  ]
}

Environment Variables

VariableRequiredDescription
T49_API_TOKENYesTerminal49 API token
T49_API_BASE_URLNoOverride API URL (default: https://api.terminal49.com/v2)

Testing Locally

# Build the MCP server
cd packages/mcp
npm install
npm run build

# Test tools/list
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | T49_API_TOKEN=your_token npm run mcp:stdio

# Test search_container
echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"search_container","arguments":{"query":"CAIU1234567"}},"id":2}' | T49_API_TOKEN=your_token npm run mcp:stdio

# Test the hosted endpoint
curl -X POST https://mcp.terminal49.com/mcp \
  -H "Authorization: Bearer $T49_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'