JQ

jjsantos01/qgis_mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

1142 stars 190 forks 品質 50 トレンド 25

LLMがQGISデスクトップを使用できるようにするモデルコンテキストプロトコル(MCP)

概要

QGISMCP は Model Context Protocol(MCP)を通じて QGIS と Claude AI を接続し、Claude が QGIS と直接やり取り・制御できるようにします。この統合により、プロンプト支援によるプロジェクト作成、レイヤーロード、コード実行などが可能になります。 このプロジェクトは、シッダールト・アフジャによるBlenderMCPプロジェクトを強く基にしています - : Claude AIをソケットベースのサーバーを介してQGISに接続します。- : QGISでプロジェクトを作成、読み込み、保存します。- : プロジェクトにベクターレイヤーまたはラスタレイヤーを追加・削除します。- : 処理アルゴリズム(Processing Toolbox)を実行します。- : ClaudeからQGISで任意のPythonコードを実行します。非常に強力ですが、このツールの使用には十分注意が必要です。 システムは主に2つの構成要素で構成されています。 1. : QGIS内にコマンドの受信および実行用のソケットサーバーを作成するQGISプラグイン。2. : モデルコンテキストプロトコルを実装し、QGISプラグインに接続するPythonサーバー。 - QGIS 3.X(3.22でのみテスト) - Claudeデスクトップ - Python 3

概要(AI 翻訳)

QGISMCP は Model Context Protocol(MCP)を通じて QGIS と Claude AI を接続し、Claude が QGIS と直接やり取り・制御できるようにします。この統合により、プロンプト支援によるプロジェクト作成、レイヤーロード、コード実行などが可能になります。

このプロジェクトは、シッダールト・アフジャによるBlenderMCPプロジェクトを強く基にしています

特徴

  • 双方向通信:Claude AIをソケットベースのサーバーを介してQGISに接続します。
  • プロジェクト操作:QGISでプロジェクトを作成、読み込み、保存します。
  • レイヤー操作:プロジェクトにベクターレイヤーまたはラスタレイヤーを追加・削除します。
  • 実行処理:実行処理アルゴリズム(Processing Toolbox)。
  • コード実行:ClaudeからQGISで任意のPythonコードを実行。非常に強力ですが、このツールの使用には十分注意が必要です。

構成要素

システムは主に2つの構成要素で構成されています。

  1. QGISプラグイン:QGIS内にコマンドを受信・実行するためのソケットサーバーを作成するQGISプラグインです。
  2. MCP Server:モデルコンテキストプロトコルを実装し、QGISプラグインに接続するPythonサーバー。

設置

前提条件

  • QGIS 3.X(3.22のみテスト)
  • Claudeデスクトップ
  • Python 3.10以降
  • UVパッケージマネージャー:

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

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:

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

GitHub で README 全文を見る

インストール

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" ] } } }