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.
Add it to your client
Section titled “Add it to your client”Claude Code
Section titled “Claude Code”claude mcp add maplibre -- npx -y maplibre-mcpThis 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-mcpGemini CLI
Section titled “Gemini CLI”gemini mcp add maplibre npx -- -y maplibre-mcpThis adds it to the current project. Add -s user to have it in all your projects.
grok mcp add maplibre -- npx -y maplibre-mcpThis adds it for your user. Add --scope project to add it to the current project only.
VS Code
Section titled “VS Code”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"] } }}Cursor
Section titled “Cursor”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.
Claude Desktop, Windsurf and others
Section titled “Claude Desktop, Windsurf and others”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"] } }}Choose toolsets
Section titled “Choose toolsets”The tools come in toolsets, one for each MapLibre project. style and gl-js 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 |
Tools lists every tool with its parameters, and Rendering covers what each renderer needs.
Try it
Section titled “Try it”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.
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.