QGISMCP - QGIS 模型上下文协议集成 logo

QGISMCP - QGIS 模型上下文协议集成

CommunityPopular
jjsantos01

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

Publisherjjsantos01
Repositoryqgis_mcp
LanguagePython
Forks
172
Stars
1.1K
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    QGISMCP - QGIS 模型上下文协议集成 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    1.1K stars and 172 forks from the linked repository.

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.

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

bash
brew install uv

On Windows Powershell

bash
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:

bash
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.

json
{
    "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:

plain
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.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "jjsantos01-qgis_mcp": {
      "command": "",
      "args": []
    }
  }
}

Use QGISMCP - QGIS 模型上下文协议集成 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once QGISMCP - QGIS 模型上下文协议集成 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add QGISMCP - QGIS 模型上下文协议集成 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the QGISMCP - QGIS 模型上下文协议集成 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "jjsantos01-qgis_mcp": {
      "command": "npx",
      "args": [
        "-y",
        "qgis-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the QGISMCP - QGIS 模型上下文协议集成 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the QGISMCP - QGIS 模型上下文协议集成 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use QGISMCP - QGIS 模型上下文协议集成 to help me with this task?
QGISMCP - QGIS 模型上下文协议集成
Sure. I read it.
Here is what I found using QGISMCP - QGIS 模型上下文协议集成.

Frequently asked questions

What is the QGISMCP - QGIS 模型上下文协议集成 MCP server used for?

QGISMCP - QGIS 模型上下文协议集成 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use QGISMCP - QGIS 模型上下文协议集成 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use QGISMCP - QGIS 模型上下文协议集成 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use QGISMCP - QGIS 模型上下文协议集成 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With QGISMCP - QGIS 模型上下文协议集成 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect QGISMCP - QGIS 模型上下文协议集成 MCP to TypingMind?

QGISMCP - QGIS 模型上下文协议集成 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does QGISMCP - QGIS 模型上下文协议集成 MCP provide in TypingMind?

QGISMCP - QGIS 模型上下文协议集成 exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use QGISMCP - QGIS 模型上下文协议集成 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If QGISMCP - QGIS 模型上下文协议集成 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇