QGIS MCP
The QGIS MCP server connects AI agents like Claude to QGIS, enabling direct programmatic control through 100+ tools:
Project Management: Load, create, save, and inspect QGIS projects; manage CRS, variables, and project information.
Layer Management: Add vector (Shapefile, GeoJSON, GeoPackage), raster (GeoTIFF), web (XYZ/WMS/WFS), or in-memory layers; remove, find, duplicate, reorder, and set layer visibility.
Feature Editing: Query, add, update, and delete features; filter with QGIS expressions; select/deselect features; compute field statistics.
Styling & Labeling: Apply single, categorized, or graduated symbology; load/save QML style files; configure labeling (field, font, color).
Map Canvas Control: Get/set canvas extent, scale, and rotation; zoom to layers; take screenshots; render map to image/file.
Processing & Analysis: Execute any QGIS Processing algorithm; list, search, and get help for algorithms.
Print Layouts & Atlas: Create layouts; add map, label, legend, scalebar, picture, and table items; export to PDF/PNG/JPG/SVG; configure and export atlases.
SQL & Expressions: Execute cross-layer SQL queries; evaluate and validate QGIS expressions; identify features.
Layer Tree & Groups: Get full tree structure; create groups; move layers between groups; manage layer order.
Field Management: Add, delete, and rename fields; add table joins between layers.
CRS & Coordinates: Get/set layer or project CRS; transform single points, multiple points, or bounding boxes between CRS systems.
Bookmarks & Map Themes: Create, apply, and remove spatial bookmarks and map visibility/theme presets.
Plugin Management: List, inspect, and reload QGIS plugins.
System & Diagnostics: Ping, run diagnostics, get QGIS info, read message logs, get/set QGIS settings and project variables, execute arbitrary PyQGIS code.
Batch Operations: Execute multiple commands in a single request to reduce overhead (with restrictions on destructive commands).
Enables direct control over QGIS to manage map layers, edit features, execute processing algorithms, render map outputs, and manage project settings and layouts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@QGIS MCPLoad the cities layer and style it by population with 5 classes."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
QGIS MCP
Connect QGIS to Claude AI through the Model Context Protocol (MCP), enabling Claude to directly control QGIS — manage layers, edit features, run processing algorithms, render maps, and more.
102 MCP tools covering layer management, feature editing, processing, rendering, styling, layout & atlas authoring, cross-layer SQL, plugin development, and system management. Compatible with QGIS 3.28–4.x. Works with Claude Code, Codex CLI, Gemini CLI, opencode, Claude Desktop, Cursor, VS Code, Windsurf, Zed, and more.
Architecture
Claude ←→ MCP Server (FastMCP) ←→ TCP socket ←→ QGIS Plugin (QTimer) ←→ PyQGIS APIQGIS Plugin (
qgis_mcp_plugin/) — Runs inside QGIS. Non-blocking TCP socket server that processes JSON commands within QGIS's event loop.MCP Server (
src/qgis_mcp/server.py) — Runs outside QGIS. Exposes QGIS operations as MCP tools via FastMCP.
Related MCP server: LocuSync Server
Installation
No clone needed. Requires QGIS 3.28+ and uv.
1. Install the QGIS plugin
In QGIS: Plugins > Manage and Install Plugins > search QGIS MCP > Install.
Restart QGIS and click Start Server in the QGIS MCP dock widget.
2. Connect your coding agent
claude mcp add -s user qgis -- uvx --from https://github.com/nkarasiak/qgis-mcp/archive/refs/heads/main.zip qgis-mcp-serverScope reference:
Flag | Stored in | Visible to |
|
| You, this project |
|
| Whole team, this project |
|
| You, every project |
codex mcp add qgis -- uvx --from https://github.com/nkarasiak/qgis-mcp/archive/refs/heads/main.zip qgis-mcp-serverOr edit ~/.codex/config.toml directly:
[mcp_servers.qgis]
command = "uvx"
args = ["--from", "https://github.com/nkarasiak/qgis-mcp/archive/refs/heads/main.zip", "qgis-mcp-server"]Add to ~/.gemini/settings.json:
{
"mcpServers": {
"qgis": {
"command": "uvx",
"args": ["--from", "https://github.com/nkarasiak/qgis-mcp/archive/refs/heads/main.zip", "qgis-mcp-server"]
}
}
}Add to opencode.json at your project root:
{
"mcp": {
"qgis": {
"type": "local",
"command": ["uvx", "--from", "https://github.com/nkarasiak/qgis-mcp/archive/refs/heads/main.zip", "qgis-mcp-server"],
"enabled": true
}
}
}Add to your client's MCP config file:
{
"mcpServers": {
"qgis": {
"command": "uvx",
"args": [
"--from", "https://github.com/nkarasiak/qgis-mcp/archive/refs/heads/main.zip",
"qgis-mcp-server"
]
}
}
}Usage
Start the plugin — In QGIS, click the MCP toolbar button (or
Plugins>QGIS MCP) and click "Start Server"Talk to Claude — The MCP tools will appear automatically. Ask Claude to work with your QGIS project.
Example prompt
You have access to QGIS tools. Do the following:
1. Ping to check the connection
2. Create a new project and save it at "/tmp/my_project.qgz"
3. Load the vector layer "world_map.gpkg" available in Qgis ("resources/data/world_map.gpkg")
4. Filter "USA" from the field "adm0_a3"
6. Render the map and show me the result
7. Save the projectUpdating
The plugin (inside QGIS) and the MCP server (outside QGIS) must stay in sync — a newer server sending a command the older plugin doesn't know will return an error. Run diagnose after any update to verify both sides match.
Component | Remote install | Local install ( |
QGIS plugin |
| Same — Plugin Manager picks up the new version from QGIS Hub |
MCP server | uvx caches the downloaded archive — force an update with |
|
To auto-update instead, add --refresh-package qgis-mcp before --from in the configs above: uvx then re-resolves this package from GitHub on every launch. Warning: this requires network at launch — the MCP server fails to start when offline — and adds ~1–3s to startup. The plain configs above use the cached version and work offline.
After updating the plugin, click Stop / Start in the QGIS MCP dock widget (or reload via Plugins > QGIS MCP > Reload Plugin) to load the new code without restarting QGIS.
Tools (102)
Category | Tools |
Project |
|
Layers |
|
Features |
|
Styling |
|
Rendering |
|
Processing |
|
Layouts |
|
Atlas |
|
Query |
|
Layer tree |
|
Plugins |
|
System |
|
All tools are async with human-readable titles and annotations (readOnly, destructive, idempotent). Destructive tools ask for confirmation via MCP elicitation when supported; clients without elicitation proceed normally (fail-open) since tools are already gated by ToolAnnotations. Long-running tools report progress via MCP logging.
Compound tool mode
Set QGIS_MCP_TOOL_MODE=compound to reduce the granular tools to ~23 grouped tools, cutting schema overhead per LLM turn. Each compound tool takes an action parameter:
QGIS_MCP_TOOL_MODE=compound uv run --no-sync src/qgis_mcp/server.pyGroups: system, project, layer, features, selection, style, canvas, render, processing, code, batch, layer_tree, plugins, variables, settings, expression, transform, message_log, layer_property.
Configuration
Environment variable | Default | Description |
|
| Host for socket connection |
|
| Port for socket connection |
|
| MCP transport: |
|
| Log file path (empty to disable) |
|
| File log level |
|
|
|
Contributing
git clone https://github.com/nkarasiak/qgis-mcp.git
cd qgis-mcp
python install.py # symlinks plugin + configures your MCP clientinstall.py options: --clients claude-desktop,cursor, --remote (uvx instead of uv run), --profile myprofile, --uninstall.
Windows (Microsoft Store / MSIX Claude Desktop):
install.pyuses--directoryinstead ofcwdin generated configs. This is required for Store-installed Claude Desktop, which runs MCP servers in an MSIX sandbox that silently dropscwd. If you configure manually, useuv --directory "/path/to/qgis-mcp" run --no-sync src/qgis_mcp/server.py— this works on both MSIX and standalone installs. You can identify a Store install when the config file is under%LOCALAPPDATA%\Packages\Claude_<id>\LocalCache\Roaming\Claude\instead of%APPDATA%\Claude\.
# Unit tests (no QGIS needed — mocked socket)
uv run --no-sync pytest tests/test_mcp_tools.py -v
# Integration tests (requires QGIS plugin running)
uv run --no-sync pytest tests/test_qgis_live.py -vLicense
This project is licensed under the GNU GPL v2 or later.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nkarasiak/qgis-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server