Skip to content
AI Agent
QGIS
Guide

Claude and QGIS: 3 Ways to Connect Them, Tested on One Task

Published

There is no official Anthropic plugin for QGIS. You have three main ways to use Claude with QGIS: connect Claude Desktop or Claude Code through a QGIS MCP server, ask Claude to write PyQGIS code that you paste into the Python console, or install an agent plugin inside QGIS.

On 7 November 2026, I tested how Claude handles a real task: loading the districts and OpenStreetMap schools of Pune, India, counting schools per polygon, and styling a choropleth. Neither of the two PyQGIS scripts Claude Sonnet 5.5 wrote ran as pasted, though one succeeded in 44 to 48 seconds after I swapped its data server URL. An agent inside QGIS finished the same prompt in 45 to 63 seconds on two straight runs.

QGIS window showing the Pune schools by ward choropleth map in blue tones, the layer tree on the left, and the AI Agent chat panel on the right displaying the prompt, the Pune city wards selection, and the final count of 256 schools across 58 electoral wards.
The Pune school choropleth built from a single sentence in QGIS: 256 OpenStreetMap schools counted across 58 electoral wards in 63 seconds.

What are the ways to use Claude with QGIS?

Connecting Claude to QGIS means either giving Anthropic's model a bridge so it can run tools inside your open project, or copying PyQGIS scripts between a chat window and the QGIS Python console. A third route skips the bridge and puts an AI agent panel directly inside QGIS.

Most tutorials only show the Model Context Protocol (MCP) bridge. Before you install extra command-line tools or edit configuration files, it helps to see what all three routes require and what happens when you give them the same job.

Route 1: Claude + QGIS MCPRoute 2: Claude writes PyQGISRoute 3: An agent inside QGIS
Setup steps5 steps (install plugin, uv, client, config, click Run MCP each session)0 setup steps (3 clicks per task to open editor, paste, and run)3 steps (install from QGIS plugin manager, open panel, sign in)
What you needClaude Desktop (Free or paid) or Claude Code (paid plan), plus uv and a local serverAny Claude chat, no extra softwareQGIS 3.28+ and a free account (no API key or card)
Who runs the codeClaude triggers tools across the local MCP portYou paste and run the script in the Python consoleThe plugin runs QGIS tools and checks the map itself
Sees your project?Yes, when the MCP server is runningNo, unless you type your layer names and CRS into the promptYes, reads open layers, fields, and map extent
UndoManual cleanup in QGISManual cleanup in QGISOne-click Undo changes button on every answer
Pune task resultNot run on Pune (9 min 28 s on a comparable Lyon school task)0 of 2 scripts ran as pasted; 1 worked in 44 to 48 s after a URL edit (447 schools in 14 talukas)2 of 2 runs passed in 63 s and ~45 s (256 schools in 58 city wards)

If you want to do this task manually without any AI, the free QGIS route takes four steps: download the boundaries and amenity=school points with Vector > QuickOSM > QuickOSM..., run Vector > Analysis Tools > Count Points in Polygon... (native:countpointsinpolygon), and set Layer Properties > Symbology to Graduated on the new count field.

Is there a Claude plugin in the QGIS repository?

No official plugin from Anthropic exists in the QGIS plugin repository. When I checked the repository index on 7 November 2026 (4,399 plugins for QGIS 3.44 and 1,697 for QGIS 4.0), 45 plugins contained the word "claude" in their metadata, but 36 of those merely credited Claude as a coding assistant or had an author named Claude.

Only nine community plugins actually connect a Claude model or subscription to QGIS:

  • QGIS MCP (by Nicolas Karasiak, v0.15.2, 77,002 downloads as of 7 November 2026): opens a local port so Claude Desktop, Claude Code, or Cursor can run 125 tools inside QGIS.
  • WAI QGIS MCP (v0.3.0, 753 downloads): connects to Claude Desktop through a single .mcpb extension file so you do not have to install Node.js yourself.
  • QGIS Agent (by bunkmr, v2.4.15, 3,783 downloads), QGIS Agent Mcp (v0.5.0, 3,210 downloads), QGIS Salah MCP (v1.1.1, 2,037 downloads), and ClaudIA QGIS (v0.4.6, 784 downloads): other MCP socket servers or panels that take your own API key.
  • LandTalk.AI (v1.5.0, 5,927 downloads) and AI Copilot (v1.8.0, 2,098 downloads): multi-model chat panels that accept Claude, OpenAI, or Gemini keys.
  • Mapsuke (by MIERUNE, v1.6.0, 1,242 downloads, updated 30 October 2026): a chat panel inside QGIS 3.44+ that runs on your existing Claude Code or Codex login without an MCP server, provided you have the Claude Code CLI installed.

Which Claude plan you need depends on how you connect. According to Anthropic's plan comparison pages (read 7 November 2026), Claude Desktop chat is available on the Free tier as well as Pro, Max, Ultra, Team, and Enterprise, and you can attach a local MCP server via Settings > Developer > Edit Config or through Desktop Extensions. Claude Code, the command-line tool that plugins like Mapsuke and CLI workflows rely on, is not included on the Free plan and requires a Pro, Max, or Ultra subscription.

The test: mapping schools per district in Pune

Every tutorial I read for the SERP gap map tested Claude on a file the author already had on disk. In real GIS work, you often ask the tool to fetch open data for a city it has never seen.

I wrote the success criteria before running anything on 7 November 2026. The prompt was a single sentence:

Load the districts of Pune, India and the schools from OpenStreetMap, count schools per district and make a choropleth.

I picked Pune on purpose because "districts of Pune" is ambiguous. Pune is a district in Maharashtra divided into 14 sub-districts (talukas or tehsils), while the city of Pune is divided into 15 administrative ward offices and 58 electoral wards. A good workflow either asks which boundary you mean or states clearly which one it loaded.

Route 2: Asking Claude for PyQGIS code to paste

For the copy-paste route, I ran Claude Sonnet 5.5 (claude-sonnet-5-5 via Claude Code 2.1.306 with all tools and web access turned off, matching a plain chat window) twice on the exact same prompt, adding only "I use QGIS. Write the PyQGIS code I can paste in the QGIS Python console for this task". If you have never used the console, our PyQGIS guide explains how scripts run there.

Claude took 77 seconds to generate the first 134-line script and 67 seconds for the second 108-line script. Both answers noted that "districts" is ambiguous, chose admin_level=6 (the 14 talukas of Pune district), and explained how to change the level in code. The second answer even added a fair warning at the bottom: "I haven't run it, so the first run is the test."

Neither script ran as pasted in QGIS 3.44.15:

  1. Answer 1 failed after 1 second with URLError: <urlopen error [Errno 61] Connection refused>. The script called the main public Overpass server (overpass-api.de), which was refusing connections from our IP that morning.
  2. Answer 2 failed on line 3 before making any network call. It raised ImportError: cannot import name 'QgsClassificationNaturalBreaks' from 'qgis.core'.
QGIS Python Console showing a red Traceback with ImportError: cannot import name QgsClassificationNaturalBreaks from qgis.core on line 3 of the pasted script.
Claude's second PyQGIS script stopped on line 3: QgsClassificationNaturalBreaks does not exist in QGIS 3.44.15 (the real class is QgsClassificationJenks).

In QGIS 3.44, the natural breaks class is called QgsClassificationJenks, not QgsClassificationNaturalBreaks. Because a chatbot without tools cannot test its own imports against your QGIS version, a single invented class name stops the whole script. We saw the exact same blind-guessing pattern when we tested ChatGPT for QGIS on three tasks in Annecy.

To see whether Claude's first script was otherwise sound, I changed one constant in Answer 1, swapping overpass-api.de for the French mirror overpass.openstreetmap.fr, and ran it three times on a clean layer tree. With a working server, it finished in 48, 44, and 45 seconds.

Map of the 14 talukas of Pune district styled in graduated red tones with black school points on top, generated by Claude's first PyQGIS script after changing the Overpass server URL.
Claude's first script after swapping the Overpass URL: 447 schools counted across 14 Pune talukas, styled with quantile breaks.

The math in Answer 1 was right: it loaded 14 taluka polygons and 447 school features, and when I recomputed the point-in-polygon counts independently, all 447 schools matched the n_schools field with zero mismatches (246 in Pune City Subdistrict, 75 in Haveli, 55 in Mulshi, down to 0 in Indapur, Velhe, and Ambegaon). Still, the map had rough edges that a human has to clean up: the quantile legend printed decimal breaks like 0,0000 - 1,2000 for whole-number school counts, and the labels in the centre overlapped at the default zoom.

Route 1: Connecting Claude Desktop or Claude Code via QGIS MCP

Giving Claude a QGIS MCP server solves the blindness problem: Claude can inspect your layers, run execute_code, see the error traceback, and try again.

I did not re-run the MCP server on Pune because the public Overpass server was refusing our network that morning and would have blocked the same OpenStreetMap calls. Instead, we already measured Claude Sonnet 5.5 driving QGIS MCP (v0.15.0 to 0.15.2) in Claude Code across four real tasks and a 41-question benchmark in late September and October 2026:

  • Setup takes 5 steps and about 3 minutes once you have uv and a client installed, plus 16 seconds on the first call while it downloads a 90 MB server exposing 125 tools. Every time you restart QGIS, you have to remember to click Run MCP again or Claude returns Error executing tool ping. Our QGIS MCP setup and test guide walks through every step and config file.
  • On a comparable school task in Lyon (counting schools within 300 m of a tram stop), Claude + QGIS MCP got the right count (87 schools) in 9 minutes 28 seconds. Six of its ten steps were raw Python, and QGIS froze for about 7 minutes while the script hit Overpass 406, 504, and 502 errors.
  • When the data are already clean, MCP is fast. On a Porto building and print-layout task, Claude + QGIS MCP finished in 2 minutes 48 seconds, beating our own agent's 5 minutes 26 seconds.
  • On Google's GeoExpertQueries benchmark (41 held-out tasks), Claude Sonnet 5.5 with QGIS MCP in Claude Code scored 24.9 out of 100, compared with 43.8 for AI Agent at Low effort (see the full benchmark results).

If you already pay for Claude Pro or Max and live in Claude Code all day, MCP costs nothing extra and gives you full freedom to combine shell scripts, local files, and QGIS in one terminal.

Route 3: Using an agent plugin inside QGIS

We build AI Agent, so this section is about our own plugin. Instead of bridging an external app into QGIS, it docks a chat panel right next to your map canvas, reads your project state, pulls from a built-in data catalogue (about 90 sources and 2,800 datasets, plus OpenStreetMap and Overture Maps), checks a rendered image of the map before answering, and puts an Undo changes button under every reply.

I ran the exact same Pune sentence twice in QGIS 3.44.15 (Balanced permissions, Medium effort).

On the first run, after 11 seconds, the panel paused and showed a clarification card asking "Which subdivisions of Pune should the school counts use?" with two clickable choices: Pune city wards and Pune district tehsils. Selecting Pune city wards brought the total wall-clock time from clicking Send to 63 seconds across 15 steps.

Close-up map render of Pune's 58 electoral wards coloured in five blue Jenks classes from light blue to dark navy, with dark point markers for the 256 OpenStreetMap schools.
The rendered map from Run 1: 58 electoral wards (2022 DataMeet boundaries) in five Jenks classes, with the highest count (39 schools) in Ward 16 Fergusson College - Erandwane.

On the second run in a fresh chat, it did not ask the question; it stated in its answer that it was using Pune's 58 electoral wards as the city districts and finished in about 45 seconds (16 steps), styling the wards in an orange palette.

QGIS window from the second run showing the Pune electoral wards styled in a five-class orange choropleth on the left and the AI Agent answer on the right confirming 256 OpenStreetMap school features across 58 wards.
Run 2 on the same prompt: finished in about 45 seconds with the same 256 schools across 58 wards and five Jenks classes (0-1, 1-5, 5-11, 11-22, 22-39).

Why did both runs succeed while the pasted scripts hit connection errors? Because the agent did not call the overloaded overpass-api.de endpoint from a raw script; it pulled the 2022 electoral wards from DataMeet and fetched the 256 school features (108 nodes and 148 ways, converting polygon schools to surface points) through its built-in data tools. When I ran an independent point-in-polygon check on both outputs, all 256 school points sat inside the 58 wards with zero mismatches against the schools attribute field.

It also kept the layer tree tidy by tucking three intermediate layers into a hidden Working layers group, and reminded me in the answer that OpenStreetMap is not an official school census. My one complaint: between Run 1 and Run 2 it changed its mind about whether to ask me the ward-versus-tehsil question or decide on its own.

Try AI Agent free in QGIS, no card needed

Which way should you choose?

In my own work, I still use plain Claude in a browser or terminal when I am writing a reusable Processing script or debugging a custom plugin across twenty files. You want to read the Python, commit it to Git, and run it outside the GUI. Just remember to paste your QGIS version, layer names, field names, and CRS into the prompt, and expect to fix an import or two.

Pick Claude + QGIS MCP if you already have a paid Claude subscription, are comfortable with uv and JSON config files, and want to mix local file operations with QGIS calls in Claude Desktop or Claude Code. It is free on top of your existing plan and fast when your data layers are already loaded.

Pick an agent inside QGIS when you want the map and the numbers without babysitting Python tracebacks, Overpass timeouts, or broken ports. For an analyst on a deadline or a team that needs consistent symbology, data source citations, and a one-click Undo, having the agent and the data catalogue built into QGIS saves the most time. You can read how the architecture differs in our guide to what an AI agent in QGIS is, or browse every current tool on the QGIS AI hub.

How we measured this. All Pune runs took place on 7 November 2026 between 10:29 and 11:03 Paris time on macOS with QGIS 3.44.15-Solothurn (Qt 5.15.19). Success criteria were written at 10:14 before the first prompt. Claude Sonnet 5.5 (claude-sonnet-5-5) was called through Claude Code 2.1.306 (claude -p --safe-mode --tools "" --model sonnet) in an empty directory with no MCP servers or web access; the two returned scripts were executed in QGIS Python and checked with an independent point-in-polygon script. AI Agent 1.9.4 (Balanced mode, Medium effort) was run twice on the same sentence in clean projects. Other QGIS sessions were running on the same Mac during testing, so wall-clock times are slower than on an idle machine. Two runs per route on a single task is a small sample, and the overpass-api.de connection refusal was observed from one network on one morning.

Frequently asked questions

Is there an official Claude plugin for QGIS?

No. Anthropic does not publish a QGIS plugin. As of 7 November 2026, the QGIS plugin repository has nine community plugins that connect Claude to QGIS, either through a local Model Context Protocol (MCP) server (such as QGIS MCP and WAI QGIS MCP), through your own API key, or through a local Claude Code login (Mapsuke). Alternatively, AI Agent installs directly from the QGIS plugin manager with the AI model and data catalogue built in.

Can Claude Desktop control QGIS for free?

Yes, with limits. According to Anthropic's plan documentation, Claude Desktop chat is available on the Free plan and supports local MCP servers via claude_desktop_config.json or Desktop Extensions (.mcpb). Running Claude Code from the terminal requires a paid Claude Pro, Max, or Ultra plan.

Can Claude write PyQGIS code that runs in QGIS 3.44?

Yes, Claude Sonnet 5.5 writes well-structured PyQGIS, but because it cannot see your QGIS installation or test its own code, it sometimes invents class names or relies on external servers that fail. In our two-sample test on QGIS 3.44.15, one script failed with ImportError on QgsClassificationNaturalBreaks (the real class is QgsClassificationJenks) and the other failed until we swapped its Overpass API URL.

What is the easiest way to use AI inside QGIS without setting up MCP?

Install an integrated agent plugin from Plugins > Manage and Install Plugins in QGIS. With AI Agent, there is no Python environment, uv package manager, or config file to maintain: you sign in for free, get 5 tasks a month (300 on Pro), and type your request in the docked panel.

Try AI Agent for free

Do it in QGIS by asking for it

AI Agent carries out the task you describe, in your own QGIS project. Free, no card.

Try AI Agent for free