# mapsql-mcp

> mapsql-mcp is an open-source MCP server for maps and travel. Ask PostGIS or Oracle Spatial questions in plain English and get maps back in chat. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** Self-hosted, CLI
- **Repository:** https://github.com/mveyseldelibas/mapsql-mcp
- **MCP Registry name:** io.github.mveyseldelibas/mapsql-mcp
- **Categories:** [maps and travel](https://ai-powered.com/categories/maps-and-travel), [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-11-23

## About

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.

## Features

- **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

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add mapsql-mcp --env DATABASE_URL='<DATABASE_URL>' -- uvx mapsql-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "mapsql-mcp": {
      "command": "uvx",
      "args": [
        "mapsql-mcp"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mapsql-mcp": {
      "command": "uvx",
      "args": [
        "mapsql-mcp"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```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.

### VS Code (~/.copilot/mcp-config.json)

```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.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add mapsql-mcp --env DATABASE_URL='<DATABASE_URL>' -- uvx mapsql-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.mapsql-mcp]
command = "uvx"
args = ["mapsql-mcp"]
env = { DATABASE_URL = "<DATABASE_URL>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```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

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```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 (~/.config/devin/mcp_config.json)

```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 (cline_mcp_settings.json)

```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 (Zed settings.json)

```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 (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "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.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```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 (~/.kiro/settings/mcp.json)

```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.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mapsql-mcp": {
      "command": "uvx",
      "args": [
        "mapsql-mcp"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>"
      }
    }
  }
}
```

## Tools

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_sql` (name suggests: changes): Runs a read-only SQL query.

## 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.

## Alternatives

- [Atli](https://ai-powered.com/mcp/atli): Atli is a free MCP server for maps and travel.
- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [Datatomcp](https://ai-powered.com/mcp/datatomcp-2): Datatomcp is a freemium MCP server for analytics and data.
- [Gulliver](https://ai-powered.com/mcp/gulliver): Gulliver is an open-source MCP server for databases.
- [CAD2GIS](https://ai-powered.com/mcp/cad2gis): CAD2GIS is an open-source MCP server for engineering simulation.
- [GaussDB Read-Only MCP](https://ai-powered.com/mcp/gaussdb-read-only-mcp): GaussDB Read-Only MCP is an open-source MCP server for databases.
- [Zektor](https://ai-powered.com/mcp/zektor): Zektor is a freemium MCP server for databases.
- [Japan Weather Warnings MCP](https://ai-powered.com/mcp/japan-weather-warnings-mcp): Japan Weather Warnings MCP is a freemium MCP server for maps and travel.

---
Source: https://ai-powered.com/mcp/mapsql-mcp
