Real shortest sea routes between ports: distance, canals/straits, GeoJSON. UN/LOCODE aware.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Shortest sea route between any two points on Earth. A TypeScript / JavaScript library for maritime route planning, port-to-port distance, ETA estimation, and shipping-lane visualisation β powered by the 2025 Eurostat maritime network.
πΊοΈ Try the interactive demo β click two points on a map and see the route, with all options live. (source)
Works from plain JavaScript too β the package ships compiled
.jsplus.d.tsdeclarations. The-tsin the name is for searchability, not a language requirement.
seaRouteAlternatives returns the baseline
plus up to N realistic alternatives.seaRouteMulti for port rotations and itineraries.speedKnots β durationHours.The ~1 600-port dataset lives behind the searoute-ts/ports subpath so the core
stays lean β importing it registers the resolver. You can also resolve codes
yourself:
Unknown codes throw UnknownPortError. See Port codes below for provenance.
Don't want to bundle the ~135 KB dataset? Fetch it at runtime with loadPorts β
the analog of loadNetwork.
The dataset also ships as a raw dist/ports.json, so jsDelivr/unpkg serve it
versioned for free:
(dist/ports.json ships from the release that adds port codes onward β pin any
version at or after it for reproducibility.)
loadPorts registers the fetched dataset (so code strings resolve) and returns
it. It uses the global fetch (Node β₯18 / browsers); pass { fetch } to override.
The network is bundled by default, so seaRoute works offline with zero setup.
If you'd rather not ship the ~1 MB network (e.g. to trim a browser bundle,
or to use an updated network without upgrading the package), fetch it at
runtime and pass it via the existing network option:
Only the fetch is async β seaRoute itself stays synchronous. loadNetwork
uses the global fetch (Node β₯18 and all browsers); pass { fetch } to supply
your own. This is purely opt-in; nothing changes if you don't use it.
| Approach | How | Data version | Works offline | Best for |
|---|---|---|---|---|
| Bundled (default) | seaRoute(a, b) β no network | pinned to your installed package | β | Most users; zero config, deterministic |
| Latest via URL | loadNetwork('β¦/marnet.json') | always the newest hosted | β needs network | Always-current data without upgrading |
| Pinned via CDN | loadNetwork('https://cdn.jsdelivr.net/npm/searoute-ts@2.0.1/β¦') | frozen (immutable) | β needs network | Reproducible builds |
You choose the version by choosing the URL:
@latest / rolling β the GitHub Pages URL above always serves the current
network. Convenient, but it can change under you.
Pinned & immutable β because the package is on npm, jsDelivr and unpkg serve every published version automatically, with immutable per-version URLs:
A pinned URL never changes, so your routes stay reproducible. (These standalone-JSON CDN paths land with the package once the network ships as a separate asset β see issue #10; until then, use the GitHub Pages URL.)
For production, prefer a pinned URL (or just the bundled default) so your distances don't shift when the network is updated.
The bundled network is Eurostat's 100 km marnet_plus. Eurostat also
publishes finer resolutions, which give more accurate coastal routing and
shorter-hop fidelity at the cost of a larger download and slightly slower
first-route graph construction. Two moderate resolutions ship as subpath
exports so you only pay for them if you import them:
Like the bundled default, each variant ships once as a shared
dist/data/marnet-<res>.cjs asset that both the CJS and ESM builds load at
runtime, so importing a variant doesn't duplicate the network across builds.
| Import | Resolution | Segments | JSON size | gzipped | Coastal accuracy |
|---|---|---|---|---|---|
searoute-ts (bundled default) | 100 km | 9,847 | ~1.3 MB | ~0.18 MB | Baseline β good for global routing |
searoute-ts/marnet-50km | 50 km | 15,498 | ~1.9 MB | ~0.27 MB | Modest step up |
searoute-ts/marnet-20km | 20 km | 29,581 | ~3.6 MB | ~0.51 MB | Noticeably finer coastal hops |
via loadNetwork (see below) | 10 km | 48,301 | ~5.9 MB | ~0.84 MB | High β larger download |
via loadNetwork (see below) | 5 km | 72,478 | ~9.0 MB | ~1.24 MB | Highest β largest download |
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/searoute)<a href="https://allmcps.com/mcp/searoute"><img src="https://allmcps.com/api/badge/searoute?style=directory" alt="Searoute on AllMCPs" /></a>