
maplibre-mcp
io.github.birkskyum由 GitHub 帳號 birkskyum 發布v0.9.2更新於 Oct 24, 2026
An MCP server that lets AI agents check, render and show MapLibre styles
概覽
一個本機 MCP 伺服器,讓 AI 代理驗證、檢查、算繪與預覽 MapLibre 樣式,從而看見並修正它正在編輯的地圖。
- 可以做什麼
- 依 MapLibre 樣式規格驗證樣式,查詢規格與 GL JS API 細節,並對拼錯的名稱提出建議、指出不受支援的方法。讀取資料來源與向量圖磚,列出來源圖層、欄位與範例要素,找出引用了不存在資料的圖層。診斷每個圖層在某地點與縮放層級是否繪製及原因,包括篩選器、繪製屬性與缺少的雪碧圖或字型。依指定相機或範圍將樣式算繪成 PNG,並比較兩個樣式版本或兩個算繪器。提供會隨樣式檔變動的即時地圖連結給使用者,算繪含地圖的整個網頁,並在支援 MCP Apps 的用戶端顯示 GeoJSON 地圖。列出 Martin 伺服器提供的圖磚、雪碧圖、字型與樣式。搜尋 MapLibre 生態中的 SDK、外掛、託管 API 與底圖,並標示是否需要 API 金鑰及署名要求。
- 適用情境
- 當代理撰寫或修改 MapLibre 樣式、需要實際檢視結果而非憑猜測時使用;也適合圖層無法繪製、需要從真實圖磚找出原因的情況。特別適合沒有 shell、在沙箱或聊天應用中無法自行建立算繪器的代理。
- 執行需求
- 以 npx 執行的本機程序,需要 Node.js 22 或更新版本。使用 MapLibre GL JS 算繪依賴已安裝的 Google Chrome,也可在首次算繪時安裝 Chromium;沙箱與 CI 可使用提供的容器映像。選用環境變數 MAPLIBRE_MCP_TOOLSETS 與 MARTIN_URL;martin 工具集需要 Martin 伺服器,Native 算繪需要額外安裝一個套件。無需 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 maplibre-mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
maplibre-mcp
[birkskyum/maplibre-mcp MCP server]
An MCP server that lets an AI agent see the MapLibre map it works on, check it, and show it to you.
[A hiking map of the Alps in 3D, with the Matterhorn against an evening sky]
A hiking style an agent made from one prompt, rendered with render_style from a camera placed above Zermatt.
A coding agent can write a MapLibre style, but it can't see the map. So it hands you untested work, or first spends minutes building a renderer of its own, and it reaches for what it remembers, like an older MapLibre GL JS or Mapbox. With maplibre-mcp the agent 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 the file. It runs on your machine and needs no API key.
Two things it is good for:
- Editing a style by chat while you watch the map change. "Make the water darker", "thin the footpaths in the village". The agent edits the file and checks the render, and your open map follows.
- Finding out why a layer doesn't draw. The agent reads the real tiles, sees which layers draw at a place and why the others don't, and fixes the filter.
An agent with no shell to build its own tools, in a sandbox or a chat app, gets the most from it.
Website · Getting started · Examples · Tools
Install
It needs Node.js 22 or newer.
Claude Desktop, Cursor, Windsurf and most other clients read this JSON. Getting started says where each one keeps it.
Rendering with MapLibre GL JS uses the installed Google Chrome. Without Chrome, the first render fails with the command that installs the Chromium it can use instead.
In a sandbox or in CI, where no browser can be installed, use the container image ghcr.io/birkskyum/maplibre-mcp, which has the server and its Chromium. Containers and sandboxes shows how.
Command line
Agents that work in a shell, and people, can also run the rendering and data tools, and the GL JS API lookup, as commands, without setting up MCP. A style is a file or a URL.
The images go to map.png, compare.png and renderers.png, or to --out. npx -y maplibre-mcp --help lists the options, and Command line has the details. To validate, format or migrate a style, use gl-style-validate, gl-style-format and gl-style-migrate from @maplibre/maplibre-gl-style-spec.
Tools
validate_stylechecks a style against the MapLibre Style Specification, and lists each problem with the path to its property.describe_style_speclooks up a layer type, property, source type or expression, with its documentation and the GL JS and Native versions that support it. For a misspelled name, it suggests the closest real ones.describe_gl_js_apilooks up a class, method, option or event of MapLibre GL JS, with its signature, documentation, default and examples, in the type definitions of the version the server renders with, or of another version. It also says when a method is not in MapLibre, like one from Mapbox GL JS.describe_sourcesreads the TileJSON, PMTiles header or GeoJSON of each source in a style, lists the source layers and fields, and finds layers that use a source layer or field that is not there.inspect_tilereads the vector tile at a place and lists each source layer with its geometry types, the values of its fields and how often they occur, and a few example features, plus the zoom range of the source and the source layers the tile lacks. The source can be a source in a style, a TileJSON URL like a Martin source, a PMTiles archive or a tile URL, with MVT or MLT tiles.debug_layerssays for each layer of a style whether it draws at a place and zoom, and if not, why, like a missing source layer, a filter that matches nothing (next to the values the data has), a fill layer without polygons, paint that comes out as 0 or transparent, or icons missing from the sprite. It also notes text that falls back to local fonts, since the glyph server lacks its font stack.render_stylerenders a style to a PNG, and reports map errors, missing fonts and missing icons. It takes a center, zoom, bearing and pitch, bounds to fit, or a camera position and a point to look at over 3D terrain.preview_stylegives the user a link to a live, interactive map of a style. The map follows the style file as it changes, and an agent with no files to write sends a changed style to the same link.render_pagerenders a web page with a map, for what a style cannot hold, like plugins, controls and the page's code. It reports the page's errors and failed requests, and can run a script in the page first.compare_stylesrenders two versions of a style at the same camera, and returns one image with the style before, after, and their differences in red.compare_renderersdoes the same for one style in two renderers, for example to check that a style looks the same on the web and on mobile.show_mapshows the user an interactive map with GeoJSON layers and markers on an OpenFreeMap basemap, in clients that support MCP Apps.martin_list_sourceslists the tiles, sprites, fonts and styles a Martin server serves, with the URLs to use in a style.search_ecosystemsearches Make with MapLibre for SDKs, plugins, routing, geocoding, styling and tiling libraries, hosted APIs, products and consultancies, filtered by kind and platform, with their links and live demos.find_basemapslists the basemaps in Make with MapLibre with their style URLs or tile sources, whether they need an API key, and the attribution or logo their provider requires on the map.
The data of Make with MapLibre is © Birk Skyum, under CC BY 4.0, and both tools end with its credit.
The tools that take a style accept it as an object (style), a URL (url) or a file (path, relative to where the server runs). The tool reference lists every parameter.
Toolsets
The tools are grouped by the MapLibre project they belong to. 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:
With any renderer on, there are render_style and compare_styles, and with two or more, compare_renderers. Rendering with MapLibre Native needs one more package, and rendering with Martin needs a Martin build with rendering. Rendering covers both.
Remote server
--http serves Streamable HTTP at http://127.0.0.1:3100/mcp instead of stdio, and --host and --port change the address. On a loopback address it only answers requests from localhost. On any other address it does not read or write files, it still fetches the URLs it is given from its own network, and it has no authentication, so put it behind a proxy that has. Remote server has the details.
Development
License
MIT © 2026 Birk Skyum
來源:README.md,提交 af12637
工具
0版本歷史
7- v0.9.2最新Oct 5, 2026
- v0.9.1Oct 5, 2026
- v0.8.1Oct 3, 2026
- v0.8.0Oct 3, 2026
- v0.7.1Sep 30, 2026
- v0.7.0Sep 30, 2026
- v0.6.1Sep 27, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分