maplibre-mcp

MCP server for MapLibre

Let AI agents check, render and show MapLibre styles

maplibre-mcp helps AI agents get MapLibre styles right. With it, an agent can check a style, look at the map it made, and show you an interactive map. 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 find layers that use a source layer or field the data does not have.

validate_style · describe_style_spec · describe_sources · format_style · migrate_style

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".

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

Show you an interactive map with GeoJSON layers and markers, right in the chat, in clients that support MCP Apps.

show_map

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