QGIS Skill
Geospatial analysis and GIS operations via FastMCP protocol, communicating with QGIS instance via TCP socket.
When to Use This Skill
- Calculate distances between geographic points
- Create buffer zones around features (proximity analysis)
- Transform coordinates between CRS (GPS to Web Mercator)
- Load and manipulate geospatial layers (Shapefile, GeoJSON, GeoPackage)
- Perform geoprocessing operations (intersect, union, difference, clip)
- Export map images for reports or web display
- Query features with spatial filters
- Style layers with categorized or graduated symbology
Architecture
┌─────────────────────────────┐
│ Claude Code / VisionFlow │
│ (MCP Client) │
└──────────────┬──────────────┘
│ MCP Protocol (stdio)
▼
┌─────────────────────────────┐
│ QGIS MCP Server (FastMCP) │
│ Port: stdio │
└──────────────┬──────────────┘
│ TCP Socket
▼
┌─────────────────────────────┐
│ QGIS Desktop (Display :1) │
│ MCP Plugin on Port 9877 │
└─────────────────────────────┘
Tools
| Tool |
Description |
load_layer |
Load geospatial layer (Shapefile, GeoJSON, GeoPackage, WMS) |
buffer_analysis |
Create buffer zones around features |
calculate_distance |
Calculate distance between two points |
transform_coordinates |
Transform between coordinate systems |
export_map |
Export map view as PNG, JPG, or PDF |
query_features |
Query layer features with filter expression |
list_layers |
List all loaded layers |
set_layer_style |
Apply styling (simple, categorized, graduated) |
geoprocessing |
Intersect, union, difference, dissolve, clip |
get_layer_extent |
Get bounding box of a layer |
health_check |
Verify QGIS connection |
Examples
# Load a GeoJSON layer
load_layer({
"path": "/data/cities.geojson",
"name": "Cities"
})
# Create 10km buffer around points
buffer_analysis({
"layer_name": "Cities",
"distance": 10000, # meters
"output_name": "city_buffers"
})
# Transform GPS coordinates to Web Mercator
transform_coordinates({
"coordinates": [-122.4194, 37.7749], # San Francisco
"source_crs": "EPSG:4326",
"target_crs": "EPSG:3857"
})
# Export map image
export_map({
"output_path": "/output/map.png",
"width": 1920,
"height": 1080,
"dpi": 150
})
Environment Variables
| Variable |
Default |
Description |
QGIS_HOST |
localhost |
QGIS MCP plugin host |
QGIS_PORT |
9877 |
QGIS MCP plugin port |
QGIS_TIMEOUT |
60 |
Socket timeout in seconds |
Troubleshooting
Connection refused:
# Check QGIS is running on Display :1
supervisorctl status qgis
# Verify MCP plugin is loaded
# In QGIS: Plugins → Manage Plugins → Search "MCP"
VisionFlow Integration
This skill exposes qgis://capabilities and qgis://status resources for discovery by VisionFlow's MCP TCP client.
1---2name: qgis3description: Geospatial analysis and GIS operations via QGIS. Use for calculating distances, buffering zones, coordinate transforms (EPSG:4326 to EPSG:3857), layer operations, geoprocessing (intersect, union, clip), and exporting map images. Requires QGIS running on Display :1 with MCP plugin enabled.4---5
6# QGIS Skill
7
8Geospatial analysis and GIS operations via FastMCP protocol, communicating with QGIS instance via TCP socket.
9
10## When to Use This Skill
11
12- Calculate distances between geographic points
13- Create buffer zones around features (proximity analysis)
14- Transform coordinates between CRS (GPS to Web Mercator)
15- Load and manipulate geospatial layers (Shapefile, GeoJSON, GeoPackage)
16- Perform geoprocessing operations (intersect, union, difference, clip)
17- Export map images for reports or web display
18- Query features with spatial filters
19- Style layers with categorized or graduated symbology
20
21## Architecture
22
23```text
24┌─────────────────────────────┐
25│ Claude Code / VisionFlow │
26│ (MCP Client) │
27└──────────────┬──────────────┘
28 │ MCP Protocol (stdio)
29 ▼
30┌─────────────────────────────┐
31│ QGIS MCP Server (FastMCP) │
32│ Port: stdio │
33└──────────────┬──────────────┘
34 │ TCP Socket
35 ▼
36┌─────────────────────────────┐
37│ QGIS Desktop (Display :1) │
38│ MCP Plugin on Port 9877 │
39└─────────────────────────────┘
40```
41
42## Tools
43
44| Tool | Description |
45| ----------------------- | ----------------------------------------------------------- |
46| `load_layer` | Load geospatial layer (Shapefile, GeoJSON, GeoPackage, WMS) |
47| `buffer_analysis` | Create buffer zones around features |
48| `calculate_distance` | Calculate distance between two points |
49| `transform_coordinates` | Transform between coordinate systems |
50| `export_map` | Export map view as PNG, JPG, or PDF |
51| `query_features` | Query layer features with filter expression |
52| `list_layers` | List all loaded layers |
53| `set_layer_style` | Apply styling (simple, categorized, graduated) |
54| `geoprocessing` | Intersect, union, difference, dissolve, clip |
55| `get_layer_extent` | Get bounding box of a layer |
56| `health_check` | Verify QGIS connection |
57
58## Examples
59
60```python
61# Load a GeoJSON layer
62load_layer({
63 "path": "/data/cities.geojson",
64 "name": "Cities"
65})
66
67# Create 10km buffer around points
68buffer_analysis({
69 "layer_name": "Cities",
70 "distance": 10000, # meters
71 "output_name": "city_buffers"
72})
73
74# Transform GPS coordinates to Web Mercator
75transform_coordinates({
76 "coordinates": [-122.4194, 37.7749], # San Francisco
77 "source_crs": "EPSG:4326",
78 "target_crs": "EPSG:3857"
79})
80
81# Export map image
82export_map({
83 "output_path": "/output/map.png",
84 "width": 1920,
85 "height": 1080,
86 "dpi": 150
87})
88```
89
90## Environment Variables
91
92| Variable | Default | Description |
93| -------------- | ----------- | ------------------------- |
94| `QGIS_HOST` | `localhost` | QGIS MCP plugin host |
95| `QGIS_PORT` | `9877` | QGIS MCP plugin port |
96| `QGIS_TIMEOUT` | `60` | Socket timeout in seconds |
97
98## Troubleshooting
99
100**Connection refused:**
101
102```bash
103# Check QGIS is running on Display :1
104supervisorctl status qgis
105
106# Verify MCP plugin is loaded
107# In QGIS: Plugins → Manage Plugins → Search "MCP"
108```
109
110## VisionFlow Integration
111
112This skill exposes `qgis://capabilities` and `qgis://status` resources for discovery by VisionFlow's MCP TCP client.