Developer documentation

For developers and technical users. Last updated 27 October 2026.

Overview

Canvx is a map you write on. Each account holds marks: points, textboxes, lines, areas, boxes, circles and freehand strokes. Each mark carries a note, sources, a category, layers, and links to other marks. Everything a person can see in the app is in the data and comes back out through the API and the exports.

Addresses

AddressWhat it servesWho gets in
This site's addressThe web app and the APIYour Canvx account (cookie), or an API token
http://localhost:8788A local copy of the APICookie or token

The web app calls the API under /api, which the server strips, so /api/features and /features are the same route. Examples here leave out the prefix and use two shell variables:

export AV=https://canvx.com/api                  # the API, for scripts and agents
export TOKEN=canvx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx         # from Settings → Automation

Authentication and tokens

API tokens (scripts and AI clients)

A token can read and propose, nothing else. On the Free plan it can read only: proposing marks (POST /features, the MCP propose_mark tool) needs Pro or Enterprise, and is refused with a 403 on Free. It can make any GET a signed-in person can (marks, links, layers, categories, the notepad, exports) and POST /features (propose a mark). Every other write answers 403: editing, deleting, approving, linking, the AI console, analysis, imported imagery and token management. The server enforces this, not the MCP server, so it holds for any client.

Browser sessions

The web app signs in with POST /auth/login and keeps a session cookie (fn_session: HttpOnly, SameSite=Lax, Secure, 30 days). New accounts on the live site also confirm their email and use two-step sign-in: the login answers {"twoFactor": {"challenge", "method", "to"}}, and POST /auth/login/code with the emailed code completes it. Sessions are for people. Use a token in scripts.

Data model

Marks

The fields GET /features returns for each mark:

FieldTypeMeaning
iduuid
titlestring, ≤ 300Also the name other notes link to.
bodystringThe note: plain text, up to 50,000 characters (20,000 from a token). [[Title]] links to another mark; [[Title|label]] also labels the connector.
colorslotThe category: one of 12 slots, pink red orange yellow green blue purple white teal magenta lime slate. Each account names and colours its own (GET /colors).
draw_modeenumpoint line area freehand rectangle circle. A textbox is a point with icon text; a box is a rectangle.
icon, sizeenum, numberpin dot star flag triangle square diamond cross text; size 0.6 to 2.4 (1 is the default).
show_label, prioritybooleanTitle shown on the map; priority marks pulse.
expires_atISO time or nullPast it the mark is "expired" (kept, or deleted if the account chose that).
end_marker, line_styleenumLines: none arrow arrow-both; solid dashed dotted.
fill_style, fill_opacityenum, numberAreas: solid striped dotted crosshatch.
geojsonGeoJSON geometryPoint, LineString, Polygon or their Multi forms. A circle is a 64-sided polygon.
lon, latnumberThe centroid, computed by PostGIS.
length_m, area_m2numberMeasured on the ellipsoid.
group_idsuuid[]The layers the mark is on (any number of the account's four).
collection_iduuid or nullIts set, if any.
sourcesarray{url, title, siteName, excerpt}; the server reads each page once to fill these in.
source, agent_nameuser or agentWho made it; for an agent, the token's name. A request cannot set either.
approvedbooleanFalse for a pending agent proposal.
external_idstring or nullAn agent's own key for the mark (see Creating marks).
created_at, updated_atISO time

Links

Links join two marks of the same account and point one way, from src to dst, with an optional label. They come from two places (origin):

Links only join approved marks, and [[links]] in an agent's note stay inert until a person approves the mark.

Categories, layers, sets and the notepad

REST API

JSON in and out. An error is {"error": "what went wrong and what to do"} with one of these statuses:

StatusMeans
400Invalid input; the message says which field.
401No session, or the token is wrong or revoked.
403Not allowed for this caller: a token on a write it may not make, or a new account that has not finished setting up.
404Not found. Another account's ids are also "not found".
409The mark limit: {"code": "limit", "used", "limit"}.
413 / 429 / 503Request over 3 MB / too many requests / database or service unavailable; retry later.

Routes a token can use

RouteParametersReturns
GET /featuresbbox=w,s,e,n, collection=uuid, limit (1 to 5,000, default 2,000){features: Mark[], capped}, last edited first. Includes pending proposals.
GET /features/:idThe mark, with links and backlinks: {id, title, color, style, label, origin}.
GET /features/indexEvery mark, short form: {id, title, color, icon, draw_mode, source, approved, lon, lat, created_at}, oldest first.
GET /searchq (2+ characters)Up to 20 marks whose title matches (closest first), then marks whose note holds the text (in_note: true).
GET /features/nearlat, lon, km (up to 5,000)Up to 100 approved marks, nearest first, with distance_km to the nearest edge.
GET /features/withinbbox=w,s,e,n or polygon=[[lon,lat],…] (3 to 1,000 corners, URL-encoded JSON)Up to 100 approved marks touching the area.
GET /links{src_id, dst_id, style, label, origin, src_lon, src_lat, dst_lon, dst_lat, src_color}.
GET /colors{slot: {label, hex, pos}} for all 12 slots.
GET /groupsThe four layers: {id, name, count}.
GET /collections{id, name, description, color, visibility, updated_at, feature_count}.
GET /notesThe notepad: {"": "…", "red": "…"}.
GET /exportformat=geojson|kml|gpx, collection, groups=uuid,uuidA file download; see Exporting data.
POST /featuresJSON body201 and the new mark; see Creating marks.
GET /health{"ok": true}; no token needed.

/features/near and /features/within return a lighter mark shape built for questions like "what do I know near here": the note (first 2,000 characters), source URLs, the extent (west south east north), area_km2, length_km, and a line's start_lon/lat and end_lon/lat.

# What do I have within 500 km of the Strait of Hormuz?
curl -s "$AV/features/near?lat=26.57&lon=56.25&km=500" -H "Authorization: Bearer $TOKEN"

# Everything in a box over Taiwan, then the whole map as GeoJSON
curl -s "$AV/features/within?bbox=119.3,21.8,122.1,25.4" -H "Authorization: Bearer $TOKEN"
curl -s "$AV/export?format=geojson" -H "Authorization: Bearer $TOKEN" -o map.geojson

Routes for signed-in browsers only

Editing and deleting marks (PATCH/DELETE /features/:id), approving (POST /features/:id/approve), bulk actions, links (PUT/DELETE /features/:id/links/:dst), categories, layers, sets, the notepad, POST /analysis, the AI console (/assistant), imported imagery (/imagery), tokens (/tokens) and account settings. A token gets 403 on every one of them.

Creating marks

POST /features with a GeoJSON geometry and the fields you want; everything else takes its default.

FieldRules
geometry (required)GeoJSON Point, LineString, Polygon or their Multi forms, [lon, lat], up to 50,000 vertices. A latitude past ±90 is refused as "coordinates may be reversed". Longitudes past ±180 are accepted for a shape that crosses the 180° line, and it is stored the short way round.
title, body≤ 300 characters; the note, cut at 20,000 characters from a token.
colorA slot name; default pink.
drawMode, icon, sizeAs in the data model. Send drawMode to match the geometry (line for a LineString, area, rectangle or circle for a Polygon) so the editor treats it as that shape.
endMarker, lineStyle, fillStyleAs in the data model. An unknown value is ignored rather than refused.
sourcesUp to 20 http(s) URLs; anything else is dropped.
externalIdYour stable key for the thing (an article URL, a database id), up to 300 characters. Sending the same key again updates that mark's content and shape instead of adding a duplicate, and never changes whether it is approved.
collectionIdA set of this account; otherwise unfiled.
curl -s -X POST "$AV/features" -H "Authorization: Bearer $TOKEN" -H "content-type: application/json" -d '{
  "title": "Port of Kaohsiung",
  "body": "Taiwan'\''s largest container port. Ships chips to [[Port of Long Beach|containers]].",
  "geometry": { "type": "Point", "coordinates": [120.28, 22.61] },
  "color": "blue",
  "sources": ["https://www.twport.com.tw/"],
  "externalId": "port-kaohsiung"
}'

From a token the mark arrives pending (approved: false): drawn faintly, badged automated, and waiting in the mark list's Agent marks filter for a person to approve it. An account can choose Settings → Automation → Add automatically to skip the review. Pending marks do not count toward the limit; approved ones do (409 when it is full).

AI clients (MCP)

The Canvx MCP server lets any Model Context Protocol client read your map and propose marks. It is a small Node.js program in packages/mcp of the source. It speaks MCP over stdio to the client, calls the REST API with your token, and so can do exactly what a token can: read, and propose.

Build it

Node.js 20 or later. From the repository root:

npm install
npm run mcp:build        # writes packages/mcp/build/index.js

It reads two environment variables:

VariableValue
CANVX_TOKENRequired. An API token (Authentication).
CANVX_API_URLThe agent address, or http://localhost:8788 (the default) for a local API.

Tools

ToolDoes
list_categoriesThe account's categories, by label, in its order.
search_marksMarks by title or note text, so the client can avoid duplicates.
marks_nearApproved marks within radiusKm of a point, nearest first, with notes and sources.
marks_in_areaApproved marks inside a bbox or polygon.
propose_markA pending mark with a note: a point (lat/lon, or degrees and decimal minutes as latDmm/lonDmm), a circle (plus radiusKm), a box (bbox), an area (polygon) or a line (line, with arrows and lineStyle). Takes category, sources and externalId. It refuses a mark with no position and tells the model to ask rather than guess.

Every tool reports a mark's kind. Shapes come back with their extent and areaKm2, a circle with its centre and radiusKm, and a line with its ends and lengthKm.

Claude Code

Add the server with claude mcp add. Options go before the name; everything after -- is the command that starts the server:

claude mcp add --scope user \
  --env CANVX_TOKEN=canvx_xxxxxxxx \
  --env CANVX_API_URL=https://canvx.com/api \
  --transport stdio canvx -- node /path/to/canvx/packages/mcp/build/index.js

In Windows PowerShell, lines continue with a backtick:

claude mcp add --scope user `
  --env CANVX_TOKEN=canvx_xxxxxxxx `
  --env CANVX_API_URL=https://canvx.com/api `
  --transport stdio canvx -- node C:\path\to\canvx\packages\mcp\build\index.js

Check it with claude mcp list (it should say Connected), or /mcp inside Claude Code. Then ask in plain words: "What do I have near the Strait of Hormuz?", or "Propose marks for the three largest container ports in Taiwan." Proposals wait in the app for your approval.

To share the setup with a team without sharing a token, put it in the project's .mcp.json and let each person set their own variables:

{
  "mcpServers": {
    "canvx": {
      "type": "stdio",
      "command": "node",
      "args": ["${CLAUDE_PROJECT_DIR:-.}/packages/mcp/build/index.js"],
      "env": {
        "CANVX_TOKEN": "${CANVX_TOKEN}",
        "CANVX_API_URL": "${CANVX_API_URL:-http://localhost:8788}"
      }
    }
  }
}

Claude Code asks each person to approve a project's servers the first time. Its MCP documentation covers scopes and the other options.

Claude Desktop

Edit claude_desktop_config.json (Windows: %APPDATA%\Claude\; macOS: ~/Library/Application Support/Claude/), then restart Claude Desktop:

{
  "mcpServers": {
    "canvx": {
      "command": "node",
      "args": ["C:\\path\\to\\canvx\\packages\\mcp\\build\\index.js"],
      "env": { "CANVX_TOKEN": "canvx_…", "CANVX_API_URL": "https://canvx.com/api" }
    }
  }
}

Other clients and testing

Any client that starts stdio MCP servers can run node packages/mcp/build/index.js with the two variables. The MCP Inspector calls the tools from a terminal:

npx -y @modelcontextprotocol/inspector --cli node packages/mcp/build/index.js \
  -e CANVX_TOKEN=canvx_… -e CANVX_API_URL=$AV \
  --method tools/call --tool-name search_marks --tool-arg query=port

--method tools/list lists the five tools; leave out --cli for the browser version.

There is no hosted connector you add by URL yet, so each client runs the server on its own computer.

Loading a dataset without an AI client

The same code path reads a JSON file (format: samples/rare-earth-chokepoint.json). Each entry takes the same fields as propose_mark. Running it again updates the same marks.

CANVX_TOKEN=canvx_… CANVX_API_URL=$AV npm run ingest -- samples/rare-earth-chokepoint.json

Exporting data

In the app: Export → Export data in the top bar. From the API: GET /export?format=…, optionally narrowed to a set (collection) or to marks on any of some layers (groups). Only approved marks are exported.

FormatWhat you get
GeoJSONAn RFC 7946 FeatureCollection (WGS84, no crs member). Each feature has the mark's id, its geometry and properties: title, body, color, drawMode, lengthMeters, areaSquareMeters, collection, sources, createdAt, updatedAt.
KMLOne Placemark per mark for Google Earth, with a style per category colour and the note and sources as plain, escaped text in the description.
GPXPoints as waypoints (with the first 500 characters of the note), lines as tracks, and areas as a track around their outline. For GPS units and route tools.

The files open in QGIS, Google Earth, ArcGIS Online, Felt, geojson.io, Mapbox Studio and other GIS tools, with notes, colours and sources kept. The app's Export data section also saves screenshots (PNG) and AI-written reports in one standard layout (PDF; Word and Markdown on Pro).

Sample files

The same three marks (a pin with a note and a source, a line, and an area) exported in each format, exactly as Canvx writes them. Download one to try it in your own tools, or open an excerpt.

GeoJSON: the pin
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": "6f1c2c1e-6b0e-4b3a-9d55-1a2b3c4d5e01",
      "geometry": {
        "type": "Point",
        "coordinates": [
          4.1427,
          51.9496
        ]
      },
      "properties": {
        "title": "Port of Rotterdam",
        "body": "Europe's largest seaport. Most container traffic uses the Maasvlakte terminals at the river mouth.",
        "color": "blue",
        "drawMode": "point",
        "lengthMeters": null,
        "areaSquareMeters": null,
        "collection": "Sample map",
        "sources": [
          "https://www.portofrotterdam.com/en"
        ],
        "createdAt": "2026-11-26T18:00:00.000Z",
        "updatedAt": "2026-11-26T18:00:00.000Z"
      }
    }
  ]
}

The file's other two features are the line (LineString, with lengthMeters) and the area (Polygon, with areaSquareMeters).

KML: the pin and its style
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
  <Document>
    <name>Sample map</name>
    <Style id="fn-blue">
      <IconStyle><color>ffd98c1a</color><scale>1.1</scale></IconStyle>
      <LineStyle><color>ffd98c1a</color><width>3</width></LineStyle>
      <PolyStyle><color>66d98c1a</color></PolyStyle>
    </Style>
    <Placemark id="6f1c2c1e-6b0e-4b3a-9d55-1a2b3c4d5e01">
      <name>Port of Rotterdam</name>
      <description>Europe&apos;s largest seaport. Most container traffic uses the Maasvlakte terminals at the river mouth.

Sources:
Port of Rotterdam Authority: https://www.portofrotterdam.com/en</description>
      <styleUrl>#fn-blue</styleUrl>
      <TimeStamp><when>2026-11-26T18:00:00.000Z</when></TimeStamp>
      <Point><coordinates>4.1427,51.9496,0</coordinates></Point>
    </Placemark>
  </Document>
</kml>

The full file has a style for every colour, and a Placemark each for the line and the area.

GPX: the pin as a waypoint, the line as a track
<?xml version="1.0" encoding="UTF-8"?>
<gpx version="1.1" creator="Canvx" xmlns="http://www.topografix.com/GPX/1/1" xmlns:osmand="https://osmand.net">
  <metadata><name>Sample map</name><time>2026-11-27T00:32:13.874Z</time></metadata>
  <wpt lat="51.9496" lon="4.1427"><time>2026-11-26T18:00:00.000Z</time>
    <name>Port of Rotterdam</name>
    <desc>Europe&apos;s largest seaport. Most container traffic uses the Maasvlakte terminals at the river mouth.</desc>
    <link href="https://www.portofrotterdam.com/en"><text>Port of Rotterdam Authority</text>
    </link><extensions><osmand:color>#1a8cd9</osmand:color></extensions></wpt>
  <trk><name>Rotterdam to Antwerp</name>
    <desc>The inland shipping route between the two ports.</desc><extensions>
    <osmand:color>#1a8cd9</osmand:color></extensions><trkseg><trkpt lat="51.9496" lon="4.1427">
    </trkpt><trkpt lat="51.6889" lon="4.2896"></trkpt><trkpt lat="51.4428" lon="4.2377"></trkpt>
    <trkpt lat="51.2602" lon="4.3997"></trkpt></trkseg></trk>
</gpx>

The area follows as a second track, around its outline.

Sharing and embedding

Share in the top bar copies the approved marks in view into a public page: their titles, notes, sources, links and colours, frozen as they are. Later edits stay private until the owner presses Update, which keeps the same link; Delete ends it.

AddressWhat it is
https://maps.canvx.com/<slug>The shared map: an interactive, read-only page with each mark's note and sources. Link previews read its Open Graph tags.
…/<slug>/embedThe same map for an <iframe>: a slim title bar, "Made with Canvx", and two-finger or Ctrl-scroll zoom so it never hijacks the host page's scrolling.
…/<slug>/card.jpgThe 1200 × 630 card image (og:image, twitter:card summary_large_image).
https://maps.canvx.com/oembed?url=…oEmbed: a rich response with the iframe, for sites that turn links into embeds by themselves. Takes maxwidth and maxheight.

The embed code the app copies:

<iframe src="https://maps.canvx.com/<slug>/embed" width="640" height="420"
  style="border:0;border-radius:12px" loading="lazy" allowfullscreen
  title="Your map (Canvx)"></iframe>

On X a share appears as a large image card, and the link opens the live page: X runs interactive maps inside posts only for players it has approved. Slugs are 10 random characters. Shared pages carry noindex, so they stay out of search results while link previews still work.

Spatial analysis

POST /analysis (signed-in browsers; it is a POST, so tokens cannot call it) powers reports, briefings and the AI console. One implementation feeds all three, so they always agree. Body: {"ids"?: uuid[] (up to 2,000; all marks if absent), "weight"?: "none"|"links"|"priority", "radiusKm"?: number, "attribute"?: "links"|"priority"}.

It returns:

Each finding states its confidence, and notes say when a test does not apply.

Limits

WhatLimit
Marks per account500 approved on Free, 2,500 on Pro; pending proposals and the example map do not count
Note50,000 characters (20,000 from a token); title 300
Sources per mark20
Vertices per shape50,000
Request body3 MB
/features/near, /features/within100 results; radius up to 5,000 km; polygons up to 1,000 corners
Requests600 a minute per IP address, with lower limits on sign-in and AI routes

Security model