QGISMCP (QGIS Model Context Protocol Integration) is an integration solution that connects QGIS Desktop with Claude AI through the Model Context Protocol (MCP), enabling Claude to interact with and control QGIS directly. The project is built on Siddharth Ahuja's BlenderMCP project.
Purpose: Use prompt assistance to complete GIS operations such as project creation, layer loading, and code execution, enabling large language models to operate the QGIS desktop.
Main capabilities:
- Two-way communication: connect Claude AI and QGIS through a socket-based server.
- Project operations: create, load, and save projects in QGIS.
- Layer operations: add or remove vector or raster layers to or from a project.
- Execute processing: run processing algorithms from the Processing Toolbox.
- Code execution: run arbitrary Python code in QGIS from Claude. The functionality is very powerful, but this tool must also be used with great caution.
System components: The system consists of two main components:
- QGIS plugin: creates a socket server within QGIS to receive and execute commands.
- MCP Server: a Python server that implements the Model Context Protocol and connects to the QGIS plugin.
Environment requirements:
- QGIS 3.X (only tested on 3.22)
- Python 3.10 or newer
- uv package manager: on Mac, install uv as required; on Windows PowerShell there is also a corresponding method, and other installation instructions are available on its official website. Note: do not continue with the subsequent steps before installing UV.
Installation method:
- Download this repository to your computer; it can be obtained by cloning.
- Copy the qgis_mcp_plugin folder and its contents into the plugin folder of the QGIS configuration. You can obtain the configuration folder through the QGIS menu Settings -> User profiles -> Open active profile folder, then enter Python/plugins and paste qgis_mcp_plthe plugin folder. On Windows machines, the plugins folder is usually located at: C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins On MacOS it is located at: ~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
- Close QGIS and reopen it. Go to the menu Plugins > Installing and Managing Plugins, select the All tab and search for "QGIS MCP", then check the QGIS MCP checkbox.
Claude for Desktop integration: Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json, and write the corresponding configuration as instructed. If you cannot find the "Developers tab" or claude_desktop_config.json, consult the relevant documentation.
Starting the connection: In QGIS, go to plugins > QGIS MCP > QGIS MCP in sequence, and click "Start Server".
Using it in Claude: After setting up the configuration file in Claude and with the server running in QGIS, you will see a hammer icon containing the QGIS MCP tools:
- ping - a simple ping command used to check server connectivity
- get_qgis_info - get information about the currently installed QGIS
- load_project - load a QGIS project from a specified path
- create_new_project - create a new project and save it
- 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 from the project based on layer IDremove a layer
- zoom_to_layer - zoom to the extent of the specified layer
- get_layer_features - retrieve features from a vector layer, with an optional limit on the number
- execute_processing - execute a processing algorithm with the given parameters
- save_project - save the current project to the given path
- render_map - render the current map view to an image file
- execute_code - execute arbitrary PyQGIS code provided as a string
Example commands are provided for demonstration.
Limitations:
- The QGIS version has only been tested on 3.22.
- The ability to execute arbitrary Python code is very powerful, but it must be used with great caution.
- Other information about fees, prices, platforms, or effects not mentioned in the materials is not currently provided.