
jjsantos01/qgis_mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Протокол контекста модели (MCP), позволяющий LLM использовать QGIS Desktop
Обзор
QGISMCP соединяет QGIS с Claude AI через протокол Model Context Protocol (MCP), позволяя Claude напрямую взаимодействовать с QGIS и управлять ими. Эта интеграция позволяет создавать проекты с подсказками, загружать слои, выполнять код и многое другое. Этот проект сильно основан на проекте BlenderMCP Сиддхарта Ахуджи - : Подключить Claude AI к QGIS через сервер на базе сокета. - : Создавать, загружать и сохранять проекты в QGIS. - : Добавлять и удалять векторные или растровые слои в проект. - : Выполнять алгоритмы обработки (Processing Toolbox). - : Запускать произвольный код на Python в QGIS из Claude. Очень мощно, но при этом будьте очень осторожны с этим инструментом. Система состоит из двух основных компонентов: 1. : QGIS-плагин, который создаёт сокетный сервер внутри QGIS для приема и выполнения команд. 2. : Python-сервер, реализующий протокол контекста модели и подключающийся к плагину QGIS. - QGIS 3.X (тестирован только на 3.22) - Claude desktop - Python 3.
Обзор (машинный перевод)
QGISMCP соединяет QGIS с Claude AI через протокол Model Context Protocol (MCP), позволяя Claude напрямую взаимодействовать с QGIS и управлять ими. Эта интеграция позволяет создавать проекты с подсказками, загружать слои, выполнять код и многое другое.
Этот проект сильно основан на проекте BlenderMCP Сиддхарта Ахуджи
Особенности
- Двусторонняя связь: Подключить Claude AI к QGIS через сервер на базе сокетов.
- Управление проектами: Создание, загрузка и сохранение проектов в QGIS.
- Манипуляция слоями: Добавлять и удалять векторные или растровые слои в проект.
- Выполнить обработку: Выполнить алгоритмы обработки (Processing Toolbox).
- Выполнение кода: Запустите произвольный код на Python в QGIS из Claude. Очень мощно, но при этом будьте очень осторожны с этим инструментом.
Компоненты
Система состоит из двух основных компонентов:
- QGIS плагин: QGIS-плагин, который создает сокетный сервер внутри QGIS для получения и выполнения команд.
- MCP Server: Python-сервер, реализующий протокол Model Context Protocol и подключающийся к плагину QGIS.
Установка
Требования
- QGIS 3.X (протестирован только на 3.22)
- Рабочий стол Claude
- Python 3.10 или новее
- UV-менеджер пакетов:
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
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:
- QGIS plugin: A QGIS plugin that 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.
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 [email protected]: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:
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"qgis": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/qgis_mcp/src/qgis_mcp",
"run",
"qgis_mcp_server.py"
]
}
}
}