maplibre-mcp

MCP server for MapLibre

Let AI agents check, render and show MapLibre styles

An AI agent can write a MapLibre style, but it can't see the map. With maplibre-mcp it renders the style, looks at the image and fixes what it sees, and you get a link to a live map that redraws as it edits. It runs on your computer and needs no API key.

$claude mcp add maplibre -- npx -y maplibre-mcp

Needs Node.js 22 or newer. Where each client keeps its settings

How it works

Coding agents like Claude Code, Codex and Cursor can edit a MapLibre style, but they can't see the map, and they can mix up MapLibre and Mapbox. MCP, the Model Context Protocol, lets an agent call tools, and maplibre-mcp gives it tools to check styles and look at maps. This is a real session, step by step.

Step 1 of 8

You ask for a change

The request, typed into Claude Code.

style.json is a copy of OpenFreeMap's Liberty style, https://tiles.openfreemap.org/styles/liberty. Make the motorways red in style.json. Then check that the style is still valid, and show me a before and after around Copenhagen.

What it does

The agent gets tools for three jobs, and decides by itself when to use them.

Check

Validate a style against the MapLibre Style Specification, look up any property or expression with the GL JS and Native versions that support it, and any GL JS method or option, find layers that use a source layer or field the data does not have, and read the values the tiles really hold.

validate_style · describe_style_spec · describe_gl_js_api · describe_sources · inspect_tile · debug_layers

validate_style

error: layers[0].paint.line-colour: unknown property "line-colour"

describe_style_spec {"name": "fill-colour"}

"fill-colour" is not in the MapLibre Style Specification. Did you mean: fill-color?

describe_sources

Layer "motorways" reads the field "kind", which "omt" does not list for "transportation".

inspect_tile {"layer": "transportation"}

class: "primary" (28), "secondary" (19), "motorway" (10), "rail" (5), ...

See

Render a style with MapLibre GL JS, MapLibre Native or a Martin server, and compare two versions of a style, or two renderers, with the differences in red.

render_style · compare_styles · compare_renderers

Copenhagen in 3D, drawn by MapLibre GL JS and by MapLibre Native, with a third panel marking the few pixels that differ
compare_renderers: GL JS and Native agree, apart from where a few labels land.

Show

Give you a link to a live map of the style that follows the file as the agent edits it, or show you an interactive map with GeoJSON layers and markers right in the chat, in clients that support MCP Apps.

preview_style · render_page · show_map

The kind of map show_map puts in the chat. This one is live.