Skip to content
Back to search

qgis_mcp

Model Context Protocol (MCP) that allows LLMs to use QGIS Desktop

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/jjsantos01--qgis-mcp/badge.svg)](/listings/jjsantos01--qgis-mcp)

HTML

<a href="/listings/jjsantos01--qgis-mcp"><img src="/api/listings/jjsantos01--qgis-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

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

brew install uv

On Windows Powershell

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Otherwise installation instructions are on their website: [Install uv](https://docs.astral.sh/uv/getting-started/installation/)

**⚠️ Do not proceed before installing UV**

Download code

Download this repo to your computer. You can clone it with:

git clone git@github.com:jjsantos01/qgis_mcp.git

QGIS plugin

You need to copy the folder [qgis_mcp_plugin](/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](https://modelcontextprotocol.io/quickstart/user#2-add-the-filesystem-mcp-server).

{
    "mcpServers": {
        "qgis": {
            "command": "uv",
            "args": [
                "--directory",
                "/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/qgis_mcp/src/qgis_mcp",
                "run",
                "qgis_mcp_server.py"
            ]
        }

    }
}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 138 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # QGISMCP - QGIS Model Context Protocol Integration
  2. QGISMCP 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.
  3. This project is strongly based on the [BlenderMCP](https://github.com/ahujasid/blender-mcp/tree/main) project by [Siddharth Ahuja](https://x.com/sidahuj)
  4. ## Features
  5. - **Two-way communication**: Connect Claude AI to QGIS through a socket-based server.
  6. - **Project manipulation**: Create, load and save projects in QGIS.
  7. - **Layer manipulation**: Add and remove vector or raster layers to a project.
  8. - **Execute processing**: Execute processing algorithms ([Processing Toolbox](https://docs.qgis.org/3.40/en/docs/user_manual/processing/toolbox.html)).
  9. - **Code execution**: Run arbitrary Python code in QGIS from Claude. Very powerful, but also be very cautious using this tool.
  10. ## Components
  11. The system consists of two main components:
  12. 1. **[QGIS plugin](/qgis_mcp_plugin/)**: A QGIS plugin that creates a socket server within QGIS to receive and execute commands.
  13. 2. **[MCP Server](/src/qgis_mcp/qgis_mcp_server.py)**: A Python server that implements the Model Context Protocol and connects to the QGIS plugin.
  14. ## Installation
  15. ### Prerequisites
  16. - QGIS 3.X (only tested on 3.22)
  17. - Claude desktop
  18. - Python 3.10 or newer
  19. - uv package manager:
  20. If you're on Mac, please install uv as
  21. ```bash
  22. brew install uv
  23. ```
  24. On Windows Powershell
  25. ```bash
  26. powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  27. ```
  28. Otherwise installation instructions are on their website: [Install uv](https://docs.astral.sh/uv/getting-started/installation/)
  29. **⚠️ Do not proceed before installing UV**
  30. ### Download code
  31. Download this repo to your computer. You can clone it with:
  32. ```bash
  33. git clone git@github.com:jjsantos01/qgis_mcp.git
  34. ```
  35. ### QGIS plugin
  36. You need to copy the folder [qgis_mcp_plugin](/qgis_mcp_plugin/) and its content on your QGIS profile plugins folder.
  37. 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`.
  38. > On a Windows machine the plugins folder is usually located at: `C:\Users\USER\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins`
  39. and on MacOS: `~/Library/Application\ Support/QGIS/QGIS3/profiles/default/python/plugins`
  40. 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.
  41. ### Claude for Desktop Integration
  42. Go to `Claude` > `Settings` > `Developer` > `Edit Config` > `claude_desktop_config.json` to include the following:
  43. > 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).
  44. ```json
  45. {
  46. "mcpServers": {
  47. "qgis": {
  48. "command": "uv",
  49. "args": [
  50. "--directory",
  51. "/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/qgis_mcp/src/qgis_mcp",
  52. "run",
  53. "qgis_mcp_server.py"
  54. ]
  55. }
  56. }
  57. }
  58. ```
  59. ## Usage
  60. ### Starting the Connection
  61. 1. In QGIS, go to `plugins` > `QGIS MCP` > `QGIS MCP`
  62. ![plugins menu](/assets/imgs/qgis-plugins-menu.png)
  63. 2. Click "Start Server"
  64. ![start server](/assets/imgs/qgis-mcp-start-server.png)
  65. ### Using with Claude
  66. 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.
  67. ![Claude tools](assets/imgs/claude-available-tools.png)
  68. #### Tools
  69. - `ping` - Simple ping command to check server connectivity
  70. - `get_qgis_info` - Get QGIS information about the current installation
  71. - `load_project` - Load a QGIS project from the specified path
  72. - `create_new_project` - Create a new project and save it
  73. - `get_project_info` - Get current project information
  74. - `add_vector_layer` - Add a vector layer to the project
  75. - `add_raster_layer` - Add a raster layer to the project
  76. - `get_layers` - Retrieve all layers in the current project
  77. - `remove_layer` - Remove a layer from the project by its ID
  78. - `zoom_to_layer` - Zoom to the extent of a specified layer
  79. - `get_layer_features` - Retrieve features from a vector layer with an optional limit
  80. - `execute_processing` - Execute a processing algorithm with the given parameters
  81. - `save_project` - Save the current project to the given path
  82. - `render_map` - Render the current map view to an image file
  83. - `execute_code` - Execute arbitrary PyQGIS code provided as a string
  84. ### Example Commands
  85. This is the example I used for the [demo](https://x.com/jjsantoso/status/1900293848271667395):
  86. ```plain
  87. You have access to the tools to work with QGIS. You will do the following:
  88. 1. Ping to check the connection. If it works, continue with the following steps.
  89. 2. Create a new project and save it at: "C:/Users/USER/GitHub/qgis_mcp/data/cdmx.qgz"
  90. 3. Load the vector layer: ""C:/Users/USER/GitHub/qgis_mcp/data/cdmx/mgpc_2019.shp" and name it "Colonias".
  91. 4. Load the raster layer: "C:/Users/USER/GitHub/qgis_mcp/data/09014.tif" and name it "BJ"
  92. 5. Zoom to the "BJ" layer.
  93. 6. Execute the centroid algorithm on the "Colonias" layer. Skip the geometry check. Save the output to "colonias_centroids.geojson".
  94. 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.
  95. 8. Render the map to "C:/Users/USER/GitHub/qgis_mcp/data/cdmx.png"
  96. 9. Save the project.
  97. ```

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.