QGISMCP connects QGIS to Claude AI through the Model Context Protocol (MCP), enabling Claude to directly interact with and control QGIS. This integration allows for prompt-assisted project creation, layer loading, code execution, and more.
The system consists of two main components:
uv package manager:
Mac:
shell
brew install uv
shell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Clone the repository:
git clone [email protected]:jjsantos01/qgis_mcp.git
Copy the folder qgis_mcp_plugin
to your QGIS profile plugins folder:
Settings
-> User profiles
-> Open active profile folder
.Python/plugins
and paste the qgis_mcp_plugin
folder.Plugins
-> Installing and Managing Plugins
, select the All
tab, search for "QGIS MCP", and enable it.Edit the claude_desktop_config.json
file:
Claude
> Settings
> Developer
> Edit Config
> claude_desktop_config.json
.{
"mcpServers": {
"qgis": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/qgis_mcp/src/qgis_mcp",
"run",
"qgis_mcp_server.py"
]
}
}
}
plugins
-> QGIS MCP
-> QGIS MCP
.Once the server is running, you will see a hammer icon with tools for the QGIS MCP.
ping
: Check server connectivity.get_qgis_info
: Get QGIS installation information.load_project
: Load a QGIS project from the specified path.create_new_project
: Create and save a new project.get_project_info
: Get current project information.add_vector_layer
: Add a vector layer to the project.add_raster_layer
: Add a raster layer to the project.get_layers
: Retrieve all layers in the current project.remove_layer
: Remove a layer by its ID.zoom_to_layer
: Zoom to the extent of a specified layer.get_layer_features
: Retrieve features from a vector layer.execute_processing
: Execute a processing algorithm.save_project
: Save the current project.render_map
: Render the current map view to an image file.execute_code
: Execute arbitrary PyQGIS code.You have access to the tools to work with QGIS. You will do the following:
1. Ping to check the connection. If it works, continue with the following steps.
2. Create a new project and save it at: "C:/Users/USER/GitHub/qgis_mcp/data/cdmx.qgz"
3. Load the vector layer: "C:/Users/USER/GitHub/qgis_mcp/data/cdmx/mgpc_2019.shp" and name it "Colonias".
4. Load the raster layer: "C:/Users/USER/GitHub/qgis_mcp/data/09014.tif" and name it "BJ"
5. Zoom to the "BJ" layer.
6. Execute the centroid algorithm on the "Colonias" layer. Skip the geometry check. Save the output to "colonias_centroids.geojson".
7. Execute code to create a choropleth map using the "POB2010" field in the "Colonias" layer. Use the quantile classification method with 5 classes and the Spectral color ramp.
8. Render the map to "C:/Users/USER/GitHub/qgis_mcp/data/cdmx.png"
9. Save the project.
Model Context Protocol (MCP) that allows LLMs to use QGIS Desktop.
No releases published