This MCP server connects QGIS to Claude AI through the Model Context Protocol, enabling direct interaction between Claude and QGIS for project creation, layer manipulation, processing execution, and more. The integration allows for AI-assisted GIS workflows with powerful two-way communication.
Before installing the QGIS MCP server, ensure you have:
Install UV package manager:
Mac:
brew install uv
Windows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
For other platforms, see the official installation guide.
⚠️ Important: Do not proceed until UV is properly installed.
Clone the repository to your local machine:
git clone [email protected]:jjsantos01/qgis_mcp.git
Locate your QGIS profile plugins folder:
Settings
→ User profiles
→ Open active profile folder
Python/plugins
C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
~/Library/Application\ Support/QGIS/QGIS3/profiles/default/python/plugins
Copy the qgis_mcp_plugin
folder from the cloned repository to the QGIS plugins folder
Restart QGIS
Enable the plugin:
Plugins
→ Installing and Managing Plugins
All
tabIn Claude, navigate to Claude
→ Settings
→ Developer
→ Edit Config
→ claude_desktop_config.json
Add the QGIS MCP server configuration:
{
"mcpServers": {
"qgis": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/qgis_mcp/src/qgis_mcp",
"run",
"qgis_mcp_server.py"
]
}
}
}
Make sure to replace /ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER
with the actual absolute path to where you cloned the repository.
Plugins
→ QGIS MCP
→ QGIS MCP
Once properly configured, Claude will display a hammer icon with tools for QGIS MCP integration.
Here's a sample prompt to test the functionality:
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.
Make sure to adjust file paths according to your system configuration.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.