Developer Tools

Official client libraries and AI integration tools for VesselAPI. Connect AI assistants to live maritime data via the MCP server, or integrate directly using our SDKs for TypeScript, Python, and Go.

MCP Server (AI Integration)

The VesselAPI MCP (Model Context Protocol) server enables AI assistants to query live maritime data directly. It works with Claude Desktop, Cursor, Claude Code, Windsurf, and any other MCP-compatible client.

The server exposes 16 tools covering vessel search, tracking, positions, ETA, classification, ownership, emissions, inspections, casualties, port lookup, port events, area-based vessel queries, and NAVTEX messages.

Installation

npx -y vesselapi-mcp

Configuration

Add the following to your MCP client configuration:

Claude Desktop / Cursor / Claude Code

{
  "mcpServers": {
    "vesselapi": {
      "command": "npx",
      "args": ["-y", "vesselapi-mcp"],
      "env": {
        "VESSELAPI_API_KEY": "your-api-key"
      }
    }
  }
}

Configuration file locations:
Claude Desktop: claude_desktop_config.json
Cursor: .cursor/mcp.json
Claude Code: .claude/settings.json
Windsurf: ~/.codeium/windsurf/mcp_config.json

Available Tools

Tool Description
search_vessels Search vessels by name, callsign, flag, or type
get_vessel Get vessel details by MMSI or IMO
get_vessel_position Get current vessel position
get_vessel_eta Get vessel ETA and destination
get_vessel_classification Get classification records
get_vessel_ownership Get ownership and management info
get_vessel_emissions Get emissions data
get_vessel_inspections Get port state control inspections
get_vessel_casualties Get marine casualty records
search_ports Search ports by name or location
get_port Get port details by UN/LOCODE
get_port_events Get arrivals and departures at a port
get_port_events_by_vessel Get port call history for a vessel
get_vessels_in_area Find vessels in a bounding box
get_vessels_in_radius Find vessels within a radius
get_navtex_messages Get maritime safety messages

SDKs

All SDKs provide 37 methods across 7 service areas: vessels, ports, port events, emissions, search, location queries, and NAVTEX. They share common features including auto-pagination, typed error handling, and automatic retry with exponential backoff.

TypeScript / Node.js

vesselapi

Zero-dependency client for Node.js 18+. Uses native fetch.

Installation

npm install vesselapi

Quick Start

import { VesselAPI } from "vesselapi";

const client = new VesselAPI({ apiKey: "YOUR_API_KEY" });

// Get vessel position
const position = await client.vessels.position(253041000, "mmsi");
console.log(position.latitude, position.longitude);

// Search vessels with auto-pagination
for await (const vessel of client.search.vessels({ name: "EVERGREEN" })) {
  console.log(vessel.name, vessel.mmsi);
}

Python

vessel-api-python

Sync and async clients for Python 3.9+. Built on httpx and pydantic.

Installation

pip install vessel-api-python

Quick Start

from vesselapi import VesselClient

client = VesselClient(api_key="YOUR_API_KEY")

# Get vessel position
position = client.vessels.position(253041000, "mmsi")
print(position.latitude, position.longitude)

# Async usage
from vesselapi import AsyncVesselClient

async_client = AsyncVesselClient(api_key="YOUR_API_KEY")
position = await async_client.vessels.position(253041000, "mmsi")

Go

vesselapi-go

Idiomatic Go client using functional options pattern. Go 1.22+.

Installation

go get github.com/vessel-api/vesselapi-go/v3

Quick Start

package main

import (
    "context"
    "fmt"
    vesselapi "github.com/vessel-api/vesselapi-go/v3"
)

func main() {
    client := vesselapi.NewClient("YOUR_API_KEY")

    // Get vessel position
    pos, err := client.Vessels.Position(context.Background(), 253041000, "mmsi")
    if err != nil {
        panic(err)
    }
    fmt.Printf("%.4f, %.4f\n", pos.Latitude, pos.Longitude)
}

Common SDK Features

Auto-Pagination

Iterate over all results without managing pagination tokens. Each SDK provides language-native iterators (async iterators in TS, generators in Python, Iterator pattern in Go).

Typed Errors

Structured error types with helpers like isNotFound(), isRateLimited(), and isAuthError() for clean error handling.

Automatic Retries

Exponential backoff with jitter on 429 and 5xx errors. Respects Retry-After headers. Configurable max retries.

Environment Variables

Set VESSELAPI_API_KEY to avoid passing the key in code. All SDKs read this automatically.

Ready to Start Building?

Sign up for an API key and start integrating maritime data with your preferred language or AI assistant.

Related Documentation