Connects QGIS Desktop to Claude for prompt-assisted project creation, layer loading and code execution
QGISMCP - QGIS Model Context Protocol Integration
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
QGISMCP connects QGIS to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control QGIS. This integration enables prompt assisted project creation, layer loading, code execution and more.
This project is strongly based on the BlenderMCP project by Siddharth Ahuja
Features
- **Two-way communication**: Connect Claude AI to QGIS through a socket-based server.
- **Project manipulation**: Create, load and save projects in QGIS.
- **Layer manipulation**: Add and remove vector or raster layers to a project.
- **Execute processing**: Execute processing algorithms (Processing Toolbox).
- **Code execution**: Run arbitrary Python code in QGIS from Claude. Very powerful, but also be very cautious using this tool.
Components
The system consists of two main components:
1. **QGIS plugin**: A QGIS plugin that creates a socket server within QGIS to receive and execute commands.
2. **MCP Server**: A Python server that implements the Model Context Protocol and connects to the QGIS plugin.
Installation
Prerequisites
- QGIS 3.X (only tested on 3.22)
- Claude desktop
- Python 3.10 or newer
- uv package manager:
If you're on Mac, please install uv as
On Windows Powershell
Otherwise installation instructions are on their website: Install uv
**⚠️ Do not proceed before installing UV**
Download code
Download this repo to your computer. You can clone it with:
QGIS plugin
You need to copy the folder qgis_mcp_plugin and its content on your QGIS profile plugins folder.
You can get your profile folder in QGIS going to menu Settings -> User profiles -> Open active profile folder Then, go to Python/plugins and paste the folder qgis_mcp_plugin.
> On a Windows machine the plugins folder is usually located at: C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
and on MacOS: ~/Library/Application\ Support/QGIS/QGIS3/profiles/default/python/plugins
Then close QGIS and open it again. Go to the menu option Plugins > Installing and Managing Plugins, select the All tab and search for "QGIS MCP", then mark the QGIS MCP checkbox.
Claude for Desktop Integration
Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json to include the following:
> If you can't find the "Developers tab" or the claude_desktop_config.json look at this documentation.
Usage
Starting the Connection
1. In QGIS, go to plugins > QGIS MCP > QGIS MCP
2. Click "Start Server"
Using with Claude
Once the config file has been set on Claude, and the server is running on QGIS, you will see a hammer icon with tools for the QGIS MCP.
Tools
- ping - Simple ping command to check server connectivity
- get_qgis_info - Get QGIS information about the current installation