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 - Two-way communication: Connect Claude AI to QGIS through a socket-based server. - Proj
Add this skill
npx mdskills install jjsantos01/qgis-mcpBridges QGIS with Claude AI via MCP, enabling comprehensive GIS project control and manipulation through AI prompts
1# QGISMCP - QGIS Model Context Protocol Integration23QGISMCP connects [QGIS](https://qgis.org/) to [Claude AI](https://claude.ai/chat) through the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro), allowing Claude to directly interact with and control QGIS. This integration enables prompt assisted project creation, layer loading, code execution and more.45This project is strongly based on the [BlenderMCP](https://github.com/ahujasid/blender-mcp/tree/main) project by [Siddharth Ahuja](https://x.com/sidahuj)67## Features89- **Two-way communication**: Connect Claude AI to QGIS through a socket-based server.10- **Project manipulation**: Create, load and save projects in QGIS.11- **Layer manipulation**: Add and remove vector or raster layers to a project.12- **Execute processing**: Execute processing algorithms ([Processing Toolbox](https://docs.qgis.org/3.40/en/docs/user_manual/processing/toolbox.html)).13- **Code execution**: Run arbitrary Python code in QGIS from Claude. Very powerful, but also be very cautious using this tool.1415## Components1617The system consists of two main components:18191. **[QGIS plugin](/qgis_mcp_plugin/)**: A QGIS plugin that creates a socket server within QGIS to receive and execute commands.202. **[MCP Server](/src/qgis_mcp/qgis_mcp_server.py)**: A Python server that implements the Model Context Protocol and connects to the QGIS plugin.2122## Installation2324### Prerequisites2526- QGIS 3.X (only tested on 3.22)27- Claude desktop28- Python 3.10 or newer29- uv package manager:3031If you're on Mac, please install uv as3233```bash34brew install uv35```3637On Windows Powershell3839```bash40powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"41```4243Otherwise installation instructions are on their website: [Install uv](https://docs.astral.sh/uv/getting-started/installation/)4445**⚠️ Do not proceed before installing UV**4647### Download code4849Download this repo to your computer. You can clone it with:5051```bash52git clone git@github.com:jjsantos01/qgis_mcp.git53```5455### QGIS plugin5657You need to copy the folder [qgis_mcp_plugin](/qgis_mcp_plugin/) and its content on your QGIS profile plugins folder.5859You 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`.6061> On a Windows machine the plugins folder is usually located at: `C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins`6263and on MacOS: `~/Library/Application\ Support/QGIS/QGIS3/profiles/default/python/plugins`6465 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.6667### Claude for Desktop Integration6869Go to `Claude` > `Settings` > `Developer` > `Edit Config` > `claude_desktop_config.json` to include the following:7071> If you can't find the "Developers tab" or the `claude_desktop_config.json` look at this [documentation](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server).7273```json74{75 "mcpServers": {76 "qgis": {77 "command": "uv",78 "args": [79 "--directory",80 "/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/qgis_mcp/src/qgis_mcp",81 "run",82 "qgis_mcp_server.py"83 ]84 }8586 }87}88```8990## Usage9192### Starting the Connection93941. In QGIS, go to `plugins` > `QGIS MCP` > `QGIS MCP`95 962. Click "Start Server"97 9899### Using with Claude100101Once 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.102103104105#### Tools106107- `ping` - Simple ping command to check server connectivity108- `get_qgis_info` - Get QGIS information about the current installation109- `load_project` - Load a QGIS project from the specified path110- `create_new_project` - Create a new project and save it111- `get_project_info` - Get current project information112- `add_vector_layer` - Add a vector layer to the project113- `add_raster_layer` - Add a raster layer to the project114- `get_layers` - Retrieve all layers in the current project115- `remove_layer` - Remove a layer from the project by its ID116- `zoom_to_layer` - Zoom to the extent of a specified layer117- `get_layer_features` - Retrieve features from a vector layer with an optional limit118- `execute_processing` - Execute a processing algorithm with the given parameters119- `save_project` - Save the current project to the given path120- `render_map` - Render the current map view to an image file121- `execute_code` - Execute arbitrary PyQGIS code provided as a string122123### Example Commands124125This is the example I used for the [demo](https://x.com/jjsantoso/status/1900293848271667395):126127```plain128You have access to the tools to work with QGIS. You will do the following:129 1. Ping to check the connection. If it works, continue with the following steps.130 2. Create a new project and save it at: "C:/Users/USER/GitHub/qgis_mcp/data/cdmx.qgz"131 3. Load the vector layer: ""C:/Users/USER/GitHub/qgis_mcp/data/cdmx/mgpc_2019.shp" and name it "Colonias".132 4. Load the raster layer: "C:/Users/USER/GitHub/qgis_mcp/data/09014.tif" and name it "BJ"133 5. Zoom to the "BJ" layer.134 6. Execute the centroid algorithm on the "Colonias" layer. Skip the geometry check. Save the output to "colonias_centroids.geojson".135 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.136 8. Render the map to "C:/Users/USER/GitHub/qgis_mcp/data/cdmx.png"137 9. Save the project.138```139
Full transparency — inspect the skill content before installing.