Skip to main content
Glama
QGIS MCP Server

QGIS MCP Server

by jjsantos01

QGISMCP - QGIS Model Context Protocol Integration

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

Features

  • Two-way communication: Connect Claude AI to QGIS through a socket-based server.

  • Project manipulation: Create, load and save projects in QGIS.

  • Layer manipulation: Add and remove vector or raster layers to a project.

  • Execute processing: Execute processing algorithms (Processing Toolbox).

  • Code execution: Run arbitrary Python code in QGIS from Claude. Very powerful, but also be very cautious using this tool.

Related MCP server: QGISMCP

Components

The system consists of two main components:

  1. QGIS plugin: A QGIS plugin that creates a socket server within QGIS to receive and execute commands.

  2. MCP Server: A Python server that implements the Model Context Protocol and connects to the QGIS plugin.

Installation

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

⚠️ 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 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.

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

    }
}

Usage

Starting the Connection

  1. In QGIS, go to plugins > QGIS MCP > QGIS MCP plugins menu

  2. Click "Start Server" start server

Using with Claude

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.

Claude tools

Tools

  • ping - Simple ping command to check server connectivity

  • get_qgis_info - Get QGIS information about the current installation

  • load_project - Load a QGIS project from the 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 a layer from the project by its ID

  • zoom_to_layer - Zoom to the extent of a specified layer

  • get_layer_features - Retrieve features from a vector layer with an optional limit

  • 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

This is the example I used for the demo:

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.

Available Tools

15 tools
add_raster_layerC

Add a raster layer to the project.

Inputs: path (required), provider, name.

add_vector_layerC

Add a vector layer to the project.

Inputs: path (required), provider, name.

create_new_projectC

Create a new project a save it

Inputs: path (required).

execute_codeC

Execute arbitrary PyQGIS code provided as a string.

Inputs: code (required).

execute_processingC

Execute a processing algorithm with the given parameters.

Inputs: algorithm (required), parameters (required).

get_layer_featuresB

Retrieve features from a vector layer with an optional limit.

Inputs: layer_id (required), limit.

get_layersA

Retrieve all layers in the current project.

Inputs: no named parameters.

get_project_infoC

Get current project information

Inputs: no named parameters.

get_qgis_infoC

Get QGIS information

Inputs: no named parameters.

load_projectB

Load a QGIS project from the specified path.

Inputs: path (required).

pingA

Simple ping command to check server connectivity

Inputs: no named parameters.

remove_layerB

Remove a layer from the project by its ID.

Inputs: layer_id (required).

render_mapC

Render the current map view to an image file with the specified dimensions.

Inputs: path (required), width, height.

save_projectA

Save the current project to the given path, or to the current project path if not specified.

Inputs: path.

zoom_to_layerC

Zoom to the extent of a specified layer.

Inputs: layer_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 15 tools

    Disambiguation4/5

    Most tools have distinct purposes, such as add_raster_layer vs. add_vector_layer, but execute_code and execute_processing could be confused as both involve running code or algorithms. The descriptions help clarify, but there is some overlap in their broad functionality.

    Naming Consistency5/5

    Tool names consistently follow a verb_noun pattern throughout, such as add_raster_layer, get_layer_features, and save_project. There are no deviations in naming conventions, making the set predictable and readable.

    Tool Count5/5

    With 15 tools, the count is well-scoped for a QGIS server, covering core operations like project management, layer handling, and rendering. Each tool earns its place without feeling excessive or insufficient for the domain.

    Completeness4/5

    The tool surface provides good coverage for QGIS workflows, including project CRUD (create, load, save), layer operations (add, get, remove, zoom), and rendering. Minor gaps exist, such as no direct tool for editing layer attributes or styling, but agents can work around this with execute_code.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Connects Sketchup to Claude AI through the Model Context Protocol, allowing Claude to directly interact with and control Sketchup for prompt-assisted 3D modeling and scene manipulation.
      10
      557
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Connects QGIS to Claude AI through the Model Context Protocol, enabling AI-assisted project creation, layer manipulation, processing algorithm execution, and Python code running within QGIS.
      7
      -
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that connects Claude AI to QGIS, enabling direct interaction with the GIS software for project creation, layer manipulation, code execution, and processing algorithms through natural language prompts.
      15
      10
      Creative Commons Zero v1.0 Universal
    • F
      license
      B
      quality
      D
      maintenance
      QGISMCP connects QGIS to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control QGIS for project creation, layer loading, code execution, and more.
      15
      1
      -