Skip to content

Getting started

maplibre-mcp is an MCP server for MapLibre. Your AI client starts it on your machine, and the agent gets tools to validate styles, look up the MapLibre Style Specification, render and compare styles, and show you maps. It needs Node.js 22 or newer, and no API key.

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

This adds it for you in the current project. Add --scope user to have it in all your projects, or --scope project to share it with everyone in the repository through .mcp.json.

codex mcp add maplibre -- npx -y maplibre-mcp
gemini mcp add maplibre npx -- -y maplibre-mcp

This adds it to the current project. Add -s user to have it in all your projects.

grok mcp add maplibre -- npx -y maplibre-mcp

This adds it for your user. Add --scope project to add it to the current project only.

code --add-mcp '{"name": "maplibre", "command": "npx", "args": ["-y", "maplibre-mcp"]}'

Or add it to .vscode/mcp.json in your workspace, or to your user configuration with the MCP: Open User Configuration command:

{
"servers": {
"maplibre": {
"command": "npx",
"args": ["-y", "maplibre-mcp"]
}
}
}

Add to Cursor opens Cursor, which adds it after you confirm. You can also add the JSON below to ~/.cursor/mcp.json, or to .cursor/mcp.json in a project.

Most other clients read this JSON. Claude Desktop keeps it in claude_desktop_config.json, which Settings › Developer › Edit Config opens.

{
"mcpServers": {
"maplibre": {
"command": "npx",
"args": ["-y", "maplibre-mcp"]
}
}
}

The tools come in toolsets, one for each MapLibre project, plus ecosystem, which searches Make with MapLibre. style, gl-js and ecosystem are on by default. Choose others with --toolsets, or with the MAPLIBRE_MCP_TOOLSETS environment variable, and all turns on every toolset:

claude mcp add maplibre -- npx -y maplibre-mcp --toolsets style,gl-js,martin
Toolset What it adds
style Validating, formatting and migrating styles, looking up the style specification, and checking sources
gl-js Rendering with MapLibre GL JS, and showing the user maps with show_map
native Rendering with MapLibre Native, which needs one more package
martin Listing what a Martin server serves, and rendering with it
ecosystem Searching Make with MapLibre for SDKs, plugins, services and products, and finding basemaps with their style URLs

Tools lists every tool with its parameters, Rendering covers what each renderer needs, and Libraries and basemaps how the ecosystem tools work.

Open a project with a MapLibre style, and ask for something like this:

Check that style.json is valid, then render it around Copenhagen at zoom 12.

Make the motorways red in style.json. Check that the style is still valid, and show me a before and after.

I'm building a hiking web app in React. Which MapLibre libraries and free map data should I use for 3D terrain and drawing routes?

The agent picks the tools itself. Examples shows what it does with prompts like these.

Rendering with MapLibre GL JS uses Google Chrome. Without Chrome, the first render fails with the command that installs the Chromium it can use instead.