mapsql-mcp
Ask PostGIS or Oracle Spatial questions in plain English and get maps back in chat
mapsql-mcp is an open-source MCP server for maps and travel. It runs locally on your machine and is started by your AI client.
- Pricing
- Open source
- Platforms
- Self-hosted, CLI
- Runs
- Locally
- What it can do
- Can change data (1 tool)
- Access
- Needs a secret key or token
Similar MCP servers
Install
Add with the CLI
Run in a terminal
claude mcp add mapsql-mcp --env DATABASE_URL='<DATABASE_URL>' -- uvx mapsql-mcpAdd --scope user to use it in every project, or --scope project to share it in .mcp.json.
Or share it with your project
Add to .mcp.json
{
"mcpServers": {
"mapsql-mcp": {
"command": "uvx",
"args": [
"mapsql-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}Add to claude_desktop_config.json
{
"mcpServers": {
"mapsql-mcp": {
"command": "uvx",
"args": [
"mapsql-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}Settings → Developer → Edit Config, then quit and reopen Claude Desktop.
Add to ~/.cursor/mcp.json
{
"mcpServers": {
"mapsql-mcp": {
"command": "uvx",
"args": [
"mapsql-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}Use .cursor/mcp.json in a project to share it with the project.
Add to ~/.copilot/mcp-config.json
{
"mcpServers": {
"mapsql-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"mapsql-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}Or put the same entry in .mcp.json at your workspace root to share it.
Add with the CLI
Run in a terminal
codex mcp add mapsql-mcp --env DATABASE_URL='<DATABASE_URL>' -- uvx mapsql-mcpOr add to config.toml
Add to ~/.codex/config.toml
[mcp_servers.mapsql-mcp]
command = "uvx"
args = ["mapsql-mcp"]
env = { DATABASE_URL = "<DATABASE_URL>" }Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mapsql-mcp": {
"command": "uvx",
"args": [
"mapsql-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>"
}
}
}
}Gemini CLI and Antigravity
Gemini CLI
Add to ~/.gemini/settings.json
{ "mcpServers": { "mapsql-mcp": { "command": "uvx", "args": [ "mapsql-mcp" ], "env": { "DATABASE_URL": "<DATABASE_URL>" } } } }Or run: gemini mcp add -s user -e DATABASE_URL='<DATABASE_URL>' mapsql-mcp uvx -- mapsql-mcp
Antigravity
Add to ~/.gemini/config/mcp_config.json
{ "mcpServers": { "mapsql-mcp": { "command": "uvx", "args": [ "mapsql-mcp" ], "env": { "DATABASE_URL": "<DATABASE_URL>" } } } }Use .agents/mcp_config.json to add it to one workspace only.
Devin Desktop (formerly Windsurf)
Add to ~/.config/devin/mcp_config.json
{ "mcpServers": { "mapsql-mcp": { "command": "uvx", "args": [ "mapsql-mcp" ], "env": { "DATABASE_URL": "<DATABASE_URL>" } } } }On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.
Cline
Add to cline_mcp_settings.json
{ "mcpServers": { "mapsql-mcp": { "command": "uvx", "args": [ "mapsql-mcp" ], "env": { "DATABASE_URL": "<DATABASE_URL>" } } } }Open it from the MCP Servers icon → Configure → Configure MCP Servers.
Zed
Add to Zed settings.json
{ "context_servers": { "mapsql-mcp": { "command": "uvx", "args": [ "mapsql-mcp" ], "env": { "DATABASE_URL": "<DATABASE_URL>" } } } }Open it with zed: open settings file. Merge context_servers into the settings you already have.
JetBrains AI Assistant and Junie
AI Assistant
Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add
{ "mcpServers": { "mapsql-mcp": { "command": "uvx", "args": [ "mapsql-mcp" ], "env": { "DATABASE_URL": "<DATABASE_URL>" } } } }The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.
Junie
Add to ~/.junie/mcp/mcp.json
{ "mcpServers": { "mapsql-mcp": { "command": "uvx", "args": [ "mapsql-mcp" ], "env": { "DATABASE_URL": "<DATABASE_URL>" } } } }Use .junie/mcp/mcp.json to share it with a project.
Kiro
Add to ~/.kiro/settings/mcp.json
{ "mcpServers": { "mapsql-mcp": { "command": "uvx", "args": [ "mapsql-mcp" ], "env": { "DATABASE_URL": "<DATABASE_URL>" } } } }Use .kiro/settings/mcp.json to add it to one workspace only.
Using several servers? Build one config file with the MCP config generator.
Configuration
DATABASE_URLConnection string, e.g. postgresql://readonly:secret@host:5432/gis. Use a read-only user.Required
About mapsql-mcp
General database servers leave the model to hand-write spatial SQL, where SRIDs, geography casts and distance units are easy to get subtly wrong. mapsql-mcp replaces that guesswork with 14 spatial tools that behave the same on PostGIS and on Oracle Spatial (SDO_GEOMETRY), such as within_distance, nearest, buffer, spatial_filter, spatial_join, aggregate and bbox_of. Plain run_sql is still available.
Queries are parsed before they run, executed in a read-only transaction with a timeout and row cap, and credentials are kept from the model. Results can come back as a map: render_map returns a PNG with an OpenStreetMap basemap, choropleths and labels, and can also write an interactive Leaflet HTML file. The server instructions tell the assistant to ask rather than guess on vague requests such as "pharmacies nearby".
The README is explicit about limits. The HTTP transport has no authentication, and the AI provider receives whatever rows the tools return, so databases whose content must stay in-house should not be connected. A bundled demo uses Natural Earth data and an OpenStreetMap extract of central Ankara.
Tools this server provides (9)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 1 of 9 tools changes data; 8 names don't say.
From the server's own tool labels and tool names; not verified by us.
- within_distance
- Finds features within a geodesic distance of a point.
- nearest
- Finds the nearest features to a point.
- buffer
- Builds a buffer around features.
- spatial_filter
- Filters features spatially.
- spatial_join
- Joins layers by spatial relationship.
- aggregate
- Aggregates spatial data.
- bbox_of
- Returns a bounding box.
- render_map
- Renders results as a PNG map and optional Leaflet HTML.
- run_sqlName suggests: changes
- Runs a read-only SQL query.
What it does
- Spatial tool set
- 14 tools handle SRIDs, metric units and indexes on both PostGIS and Oracle Spatial.
- Read-only by design
- Queries are parsed, run in a READ ONLY transaction with timeout and row cap.
- Maps in chat
- render_map returns a PNG and can write an interactive Leaflet file.
- Ask before guessing
- The server instructions have the assistant ask when a request is ambiguous.
- Layer scoping
- `--schemas` and `--layers` limit what is exposed to the assistant.
- Demo database
- A bundled Natural Earth and Ankara dataset builds offline in a couple of minutes.
Good for
- Find points of interest within a distance of a location and map them
- Colour neighbourhoods by a count such as cafes
- List the nearest facilities to a point with distances
- Explore the layers in an unfamiliar spatial database
Pricing
Open source
mapsql-mcp FAQ
Which databases does mapsql-mcp support?
PostGIS and Oracle Spatial; the backend is picked from the connection string.
Is mapsql-mcp safe to point at production data?
The README advises a read-only database user, and notes the assistant's provider receives the rows returned.
What does mapsql-mcp need to run?
Python 3.10 or later and a PostGIS or Oracle Spatial database.
Does the HTTP transport require a login?
No. It has no authentication, so keep it on loopback or behind your own proxy.
Is mapsql-mcp free?
Yes. mapsql-mcp is open source, so you can use and self-host it for free.
How do I add mapsql-mcp to Claude Code?
Run this command in your terminal: claude mcp add mapsql-mcp --env DATABASE_URL='<DATABASE_URL>' -- uvx mapsql-mcp
What are the best alternatives to mapsql-mcp?
The closest alternatives to mapsql-mcp are Atli, Midplane, Datatomcp, Gulliver and CAD2GIS.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.