GPT Maps
MCP server that enables LLMs to create and control interactive MapLibre maps by placing markers, drawing paths, and rendering polygons directly in Claude Desktop.
README
README.md
GPT Maps
AI-powered interactive map visualization built as an MCP Server + MCP App for Claude Desktop.
GPT Maps allows an LLM to control an interactive MapLibre map through custom MCP tools. Instead of only returning textual geographic information, the model can visualize locations, connect places with paths, and display geographic boundaries directly on the map.
Features
- π Markers β place locations on the map
- π£οΈ Paths β connect multiple geographic points
- πΊοΈ Polygons β render geographic boundaries
- π Country-aware camera positioning β intelligently adjusts the map view based on the countries associated with locations
- π Nominatim integration β resolves geographic boundaries using OpenStreetMap data
- π§© MCP integration β exposes map operations as tools that an LLM can call
- π₯οΈ Claude Desktop integration β renders the map inside a sandboxed MCP App
- π¦ MCPB packaging β distributable as a Claude Desktop extension
- π Scene-based rendering β represents map state using shared scene objects
- π‘οΈ CSP-aware sandboxing β supports external MapLibre resources inside the MCP App sandbox
Example
A user can ask:
Show Delhi, Mumbai and Bangalore and connect them with a path.
The LLM can call the MCP tools to create the required scene:
User
β
Claude
β
MCP Tool Calls
βββ createMarker
βββ createMarker
βββ createMarker
βββ createPath
β
Scene
β
SceneSerializer
β
MCP Resource
β
React + MapLibre
β
Interactive Map
The result is rendered directly inside the Claude Desktop interface.
Architecture
GPT Maps is structured as a TypeScript monorepo with separate shared, server, and web packages.
GPT Maps
β
βββ packages/
β β
β βββ shared/
β β βββ objects/
β β β βββ Marker
β β β βββ Path
β β β βββ Polygon
β β β
β β βββ scene/
β β βββ SceneBuilder
β β
β βββ server/
β β βββ tools/
β β β βββ createMarker
β β β βββ createPath
β β β βββ createPolygon
β β β βββ renderScene
β β β
β β βββ services/
β β β βββ BoundaryService
β β β
β β βββ SceneSerializer
β β
β βββ web/
β βββ renderer/
β β βββ MapRenderer
β βββ SceneDeserializer
β βββ MCP App
β
βββ mcpb/
βββ Claude Desktop package
Data flow
LLM
β
β MCP tool calls
βΌ
MCP Server
β
βββ createMarker
βββ createPath
βββ createPolygon
βββ renderScene
β
βΌ
Scene Model
β
βΌ
SceneSerializer
β
βΌ
MCP Resource
β
βΌ
React MCP App
β
βΌ
MapLibre GL
β
βΌ
Interactive Map
MCP Tools
createMarker
Creates a geographic marker.
Supports an optional country hint used for intelligent camera positioning.
Example:
createMarker(
latitude,
longitude,
label,
country
)
For locations where a country cannot meaningfully be associated with the point, the model can use:
VAGUE
createPath
Creates a path connecting multiple geographic points.
createPath(
points[]
)
Paths use the same underlying geographic point model as markers.
createPolygon
Creates a geographic polygon from a named region.
The server uses the Nominatim Search API with GeoJSON polygon output to retrieve the boundary.
Region
β
Nominatim
β
GeoJSON
β
Point conversion
β
Polygon
β
MapLibre
Both Polygon and MultiPolygon GeoJSON geometries are handled.
renderScene
Serializes the current scene and sends it to the MCP App for rendering.
The scene contains objects such as:
Scene
βββ Markers
βββ Paths
βββ Polygons
Country-Aware Camera
GPT Maps uses country information associated with markers to improve the initial map viewport.
For example:
User:
Show Delhi
The marker can carry:
country = "India"
The server resolves the country's bounding box through Nominatim.
The renderer then combines:
Marker bounds
+
Country bounds
β
Combined LngLatBounds
β
MapLibre fitBounds()
This prevents a single marker from producing an excessively zoomed-in view.
If:
the country is unavailable,
the value is VAGUE, or
Nominatim cannot resolve the country,
the renderer safely falls back to the geographic bounds of the scene objects.
Country requests are also deduplicated within each scene so multiple markers from the same country do not trigger repeated lookups.
Map Rendering
The frontend uses MapLibre GL for rendering.
The renderer maintains the map as a visual representation of the current scene.
Before rendering a new independent scene, existing map objects are cleared:
New renderScene()
β
clearMap()
β
Remove previous markers
Remove previous paths
Remove previous polygons
β
Render new scene
This prevents objects from previous independent prompts from accumulating on the same map.
MCP App Sandbox
The MCP App runs inside a sandboxed iframe controlled by the MCP host.
A standard Vite build normally produces:
index.html
assets/
βββ index.js
βββ index.css
However, those relative asset URLs are not directly accessible from the MCP App sandbox.
GPT Maps therefore produces a self-contained HTML resource with JavaScript and CSS bundled into the HTML document.
The resulting MCP resource contains:
<script>
...
</script>
<style>
...
</style>
with no required:
./assets/
/assets/
references.
This allows the MCP host to load the entire application from a single HTML resource.
Content Security Policy
MapLibre requires external network access for map resources.
The MCP App therefore declares the required external domain through MCP resource CSP metadata.
For example:
connectDomains:
https://demotiles.maplibre.org
The CSP metadata is included in the actual resources/read response so the MCP host can apply the required policy when loading the application.
Technology Stack
Backend
TypeScript
Node.js
MCP SDK
Nominatim / OpenStreetMap
GeoJSON
Frontend
React
TypeScript
MapLibre GL
HTML/CSS
Architecture
TypeScript monorepo
Shared domain models
Scene Builder
Serialization / deserialization pipeline
MCP resources and tools
Distribution
MCPB
Claude Desktop
Project Structure
packages/
βββ shared/
β βββ Shared scene/domain models
β
βββ server/
β βββ MCP server
β βββ MCP tools
β βββ BoundaryService
β βββ SceneSerializer
β
βββ web/
βββ React MCP App
βββ MapRenderer
βββ SceneDeserializer
Running Locally
Requirements
Node.js
npm
Claude Desktop
MCPB CLI (for packaging)
Install
npm install
Build
npm run build
Package
The project can be packaged as an MCPB extension using the official MCPB CLI.
mcpb pack
The resulting package can then be installed into Claude Desktop.
MCPB
GPT Maps is distributed as a Claude Desktop MCPB extension.
The package contains:
map-renderer.mcpb
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.