QGIS MCP
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.
51 MCP tools covering layer management, feature editing, processing, rendering, styling, plugin development, and system management. Compatible with QGIS 3.28–4.x. Includes a one-command installer for 6+ MCP clients.
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.
Prerequisites
QGIS 3.28 or newer
Python 3.12+
uv package manager — install uv
Installation
1. Clone the repository
git clone https://github.com/nkarasiak/qgis-mcp.git
cd qgis-mcp2. Install with the one-command installer (recommended)
python install.pyThis will:
Symlink the QGIS plugin into your QGIS profile
Configure your MCP client(s) — supports Claude Desktop, Claude Code, Cursor, VS Code Copilot, Windsurf, and Zed
Options: --non-interactive --clients claude-desktop,cursor for CI, --remote for uvx-based installs, --profile myprofile for non-default QGIS profiles, --uninstall to remove.
Restart QGIS, then enable the plugin: Plugins > Manage and Install Plugins > search "QGIS MCP" > check the box.
Install the QGIS plugin manually
Copy (or symlink) the qgis_mcp_plugin/ folder into your QGIS plugins directory:
Find your plugins folder: In QGIS, go to Settings > User Profiles > Open Active Profile Folder, then navigate to python/plugins/.
OS | Typical path |
Linux |
|
macOS |
|
Windows |
|
# Example on Linux (symlink recommended for development)
ln -s /path/to/qgis-mcp/qgis_mcp_plugin ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/qgis_mcp_pluginRestart QGIS, then enable the plugin: Plugins > Manage and Install Plugins > search "QGIS MCP" > check the box.
Connect your MCP client manually
Claude Code — project-level config (recommended)
Create a .mcp.json file at the root of your clone:
{
"mcpServers": {
"qgis": {
"command": "uv",
"args": ["run", "src/qgis_mcp/server.py"],
"cwd": "/path/to/qgis-mcp"
}
}
}Claude Code automatically detects .mcp.json when you open the project — no manual claude mcp add needed.
Claude Code — one-liner (remote install)
claude mcp add --transport stdio qgis-mcp -- uvx --from git+https://github.com/nkarasiak/qgis-mcp qgis-mcp-serverClaude Desktop
Go to Claude > Settings > Developer > Edit Config and add:
{
"mcpServers": {
"qgis": {
"command": "uv",
"args": ["run", "src/qgis_mcp/server.py"],
"cwd": "/path/to/qgis-mcp"
}
}
}Or for a remote install without cloning:
{
"mcpServers": {
"qgis": {
"command": "uvx",
"args": [
"--from", "git+https://github.com/nkarasiak/qgis-mcp",
"qgis-mcp-server"
]
}
}
}Cursor / other MCP clients
Use the same JSON configuration above in your client's MCP settings file.
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 "/data/cities.shp" and name it "Cities"
4. Get field statistics for the "population" field
5. Create a graduated symbology on the "population" field with 5 classes
6. Render the map and show me the result
7. Save the projectTools (51)
Category | Tools |
Project |
|
Layers |
|
Features |
|
Styling |
|
Rendering |
|
Processing |
|
Layouts |
|
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 51 granular tools to ~19 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 |
|
|
|
Development
# Run unit tests (no QGIS needed — mocked socket)
uv run --no-sync pytest tests/test_mcp_tools.py -v
# Run 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.
This server cannot be installed
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