QGIS MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| QGIS_MCP_HOST | No | Host for socket connection | localhost |
| QGIS_MCP_PORT | No | Port for socket connection | 9876 |
| QGIS_MCP_TRANSPORT | No | MCP transport: stdio or streamable-http | stdio |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| completions | {} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| pingA | Check connectivity to the QGIS plugin server. Returns pong if connected. |
| diagnoseA | Run diagnostic checks on the QGIS MCP stack. Reports QGIS version, plugin/server version match, processing providers, connected clients, and project status. |
| get_qgis_infoA | Get QGIS version, profile path, and plugin count. |
| get_project_infoA | Get current project metadata: filename, title, CRS, layer count, and summary of layers. |
| load_projectB | Load a QGIS project from a .qgs/.qgz file path. |
| create_new_projectB | Create a new empty QGIS project and save it to the given path. |
| save_projectC | Save the current project. Optionally specify a new path. |
| get_layersA | List layers in the current project with IDs, names, types, visibility, and type-specific info. Use limit/offset for pagination. Response includes total_count. |
| add_vector_layerC | Add a vector layer (shapefile, GeoJSON, GeoPackage, etc.) to the project. |
| add_raster_layerC | Add a raster layer (GeoTIFF, etc.) to the project. |
| remove_layerA | Remove a layer from the project by its layer ID. This is irreversible. |
| find_layerA | Find layers by name pattern. Supports fnmatch wildcards (e.g. 'roads*') and substring matching. |
| create_memory_layerB | Create a new in-memory vector layer. geometry_type: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon. fields: [{name, type}] where type is integer, double, string, date, datetime. |
| set_layer_visibilityB | Set a layer's visibility in the layer tree (show/hide on map). |
| zoom_to_layerA | Zoom the map canvas to the full extent of the specified layer. |
| get_layer_featuresA | Retrieve features from a vector layer. Features are flat dicts with _fid and attributes at top level. Supports expression filtering (QGIS expressions like "name = 'Berlin'" or "population > 1000000"), limit (max 50, default 10), offset for paging, and optional geometry inclusion (in _geometry key). |
| get_field_statisticsA | Compute aggregate statistics (count, sum, mean, min, max, stdev) for a numeric field. For non-numeric fields returns count and distinct values. |
| add_featuresA | Add features to a vector layer. Each feature: {attributes: {field: value}, geometry_wkt: 'POINT(1 2)'}. Returns count of added features. |
| update_featuresB | Update feature attributes. updates: [{fid: 1, attributes: {field: value}}]. Returns count of updated features. |
| delete_featuresA | Delete features by feature IDs or expression filter. Provide either fids (list of ints) or expression (string), not both. |
| select_featuresB | Select features in a layer by expression or feature IDs. |
| get_selectionA | Get the current selection for a layer. Returns feature IDs and count. |
| clear_selectionA | Clear the selection on a layer. |
| set_layer_styleA | Set layer symbology. style_type: 'single' (one symbol), 'categorized' (unique values), or 'graduated' (numeric ranges). field is required for categorized/graduated. color_ramp: name from QGIS style (e.g. 'Spectral', 'Viridis', 'Blues'). classes: number of classes for graduated (default 5). |
| get_canvas_extentA | Get the current map canvas extent and CRS. |
| set_canvas_extentB | Set the map canvas extent. Coordinates should be in the specified CRS (default: project CRS). |
| get_canvas_screenshotA | Grab a fast screenshot of the current map canvas widget (no re-render). Returns the image inline. Much faster than render_map. |
| get_raster_infoA | Get raster layer info: band count, dimensions, CRS, extent, per-band statistics, nodata values. |
| execute_processingA | Execute a QGIS Processing algorithm. Use get_algorithm_help to discover parameters. Layer params accept layer IDs or file paths. Set OUTPUT to 'memory:' for temp layers. |
| list_processing_algorithmsA | Search for processing algorithms by keyword and/or provider. Returns id, name, provider for each match. |
| get_algorithm_helpA | Get detailed help for a processing algorithm: parameters (name, type, optional, default), outputs, and description. |
| render_mapB | Render the current map canvas to an image. Returns the image inline so you can see it. Optionally saves to a file path on disk. |
| execute_codeA | Execute arbitrary PyQGIS code. Use for operations not covered by other tools. Has access to QgsProject, iface, and core QGIS classes. Returns stdout/stderr. |
| get_active_layerA | Get the currently active (selected) layer in the QGIS layer panel. |
| set_active_layerB | Set the active layer in the QGIS layer panel by layer ID. |
| get_canvas_scaleA | Get the current map canvas scale, rotation, and magnification factor. |
| set_canvas_scaleA | Set the map canvas scale and/or rotation. Provide scale as denominator (e.g. 50000 for 1:50000). Rotation in degrees (0-360). |
| get_layer_labelingA | Get the labeling configuration of a vector layer: enabled state, field, font size, color. |
| set_layer_labelingA | Configure labeling for a vector layer. Set enabled=false to disable labels. Set field_name to the attribute field to label with. Optional: font_size (float), color (hex like '#000000'). |
| get_layer_crsA | Get the coordinate reference system (CRS) of a layer: EPSG code, description, whether geographic, and PROJ4 string. |
| set_layer_crsA | Set the CRS of a layer (e.g. 'EPSG:4326'). This does NOT reproject data — it only changes how the layer's coordinates are interpreted. |
| get_bookmarksA | Get spatial bookmarks from the project. Each bookmark has a name, group, extent (xmin/ymin/xmax/ymax), and CRS. |
| add_bookmarkB | Add a spatial bookmark to the project for quick navigation. Provide a name and extent (xmin/ymin/xmax/ymax) with CRS. |
| remove_bookmarkA | Remove a spatial bookmark by its ID. |
| get_map_themesA | Get map themes (visibility presets). Each theme stores which layers are visible. |
| add_map_themeA | Create a map theme from the current layer visibility state. If a theme with this name exists, it will be updated. |
| remove_map_themeA | Remove a map theme by name. |
| apply_map_themeA | Apply a map theme — restores the layer visibility state saved in the theme. |
| set_project_crsB | Set the project coordinate reference system (e.g. 'EPSG:4326', 'EPSG:3857'). This changes how layers are projected on the map canvas. |
| batch_commandsA | Execute multiple commands in a single round-trip. Each command is {"type": "", "params": {...}}. Destructive commands (execute_code, remove_layer, delete_features, set_setting, reload_plugin) are not allowed in batch — use them individually. |
| list_layoutsA | List all print layouts in the current project with names and page counts. |
| export_layoutB | Export a print layout to file. format: 'pdf', 'png', 'jpg', 'svg'. dpi: resolution (default 300). |
| get_message_logA | Get QGIS message log entries. Filter by level ('info', 'warning', 'critical') and/or tag (e.g. 'QGIS MCP'). Returns newest first. |
| list_pluginsA | List installed QGIS plugins with name, enabled status, and version. Set enabled_only=true to list only active plugins. |
| get_plugin_infoA | Get detailed info for a specific plugin: name, enabled, version, description, author, path. |
| reload_pluginA | Reload a QGIS plugin by name. Cannot reload the MCP plugin itself. Useful during plugin development. |
| get_layer_treeA | Get the full layer tree structure with groups and layers. Returns recursive tree with type, name, visibility, and children. |
| create_layer_groupC | Create a new layer group in the layer tree. Optionally specify a parent group name. |
| move_layer_to_groupC | Move a layer into a layer group by group name. |
| set_layer_propertyA | Set a layer property. Supported properties: opacity (0.0-1.0), name (string), min_scale, max_scale (float), scale_visibility (bool). |
| get_layer_extentA | Get the spatial extent (bounding box) and CRS of a layer. |
| get_project_variablesA | Get all project-level variables (key-value pairs set in Project Properties). |
| set_project_variableA | Set a project-level variable. Variables are accessible in expressions as @key. |
| validate_expressionA | Validate a QGIS expression. Returns whether it's valid, any parse errors, and referenced column names. Optionally test against a layer's fields. |
| get_settingA | Read a QGIS setting by key path (e.g. 'qgis/sketching/sketching_enabled'). |
| set_settingC | Write a QGIS setting. Use with care — incorrect settings can affect QGIS behavior. |
| transform_coordinatesA | Transform coordinates between CRS. Accepts a single point {x, y}, a list of points [{x, y}, ...], or a bbox {xmin, ymin, xmax, ymax}. Returns transformed coordinates in the same format. |
| add_web_layerC | Add a web layer (XYZ, WMS, WFS) to the project. service: 'xyz', 'wms', 'wfs'. |
| add_table_joinC | Add a table join to a vector layer. |
| add_fieldC | Add a new field to a vector layer. field_type: 'string', 'int', 'double', 'bool', 'date', 'datetime'. |
| delete_fieldB | Delete a field from a vector layer. |
| rename_fieldB | Rename a field in a vector layer. |
| apply_style_qmlC | Apply a QGIS QML style file to a layer. |
| save_style_qmlB | Save a layer's style to a QGIS QML file. |
| create_layoutC | Create a new print layout. |
| add_layout_mapC | Add a map item to a print layout at specified position and size (in millimeters). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| analyze_layer | Deeply inspect a layer's schema, sample data, and compute detailed field statistics |
| spatial_analysis | Run a spatial operation between two layers with CRS validation |
| style_map | Create a thematic map with categorized or graduated symbology |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| qgis_info | QGIS version, profile, and plugin count |
| project_info | Current project metadata, CRS, layer count, layer summary |
| layer_list | All layers with IDs, names, types, visibility |
| llms_context | Capabilities summary for LLM context — lists all tools, resources, and usage tips |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nkarasiak/qgis-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server