About Qgis MCP
Qgis MCP is an MCP server published by nkarasiak in the Science category: connect QGIS to AI agent through the Model Context Protocol (MCP). Conduid read 152 tools from its source: active_layer, add_bookmark, add_features, add_field, add_layer_from_connection, add_layout_label and 146 more. No package is published for it, so it installs from a source checkout.
The repository has 472 stars and 95 forks, is licensed GPL-2.0, and its last commit was on 2 Dec 2026. The latest release is v0.15.3 (11 Nov 2026): Two fixes to Processing models, both from one user report. It follows v0.15.2 (17 Oct 2026), and the 5 most recent releases go back to v0.14.1 (17 Sep 2026). It passes 4 of the 5 static checks Conduid ran on the repository; it does not pass No dynamic code execution. Its topics include science.
Install
git clone https://github.com/nkarasiak/qgis-mcpTools (152)
active_layerActive layer management.
Actions: get, set
- get: no params
- set: layer_id (str)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
add_bookmarkAdd a spatial bookmark to the project for quick navigation. Provide a name and extent (xmin/ymin/xmax/ymax), in crs when given, else the project CRS.| Parameter | Type | Description |
|---|---|---|
| crs | string | |
| group | string | |
| instance | string | |
| name * | string | |
| xmax * | number | |
| xmin * | number | |
| ymax * | number | |
| ymin * | number |
add_featuresAdd features to a vector layer. Each feature: {attributes: {field: value}, geometry_wkt: 'POINT(1 2)'}. geometry_wkt is in the layer's CRS, or in crs when given (it is then reprojected). A geometry type the layer cannot hold is refused; invalid geometry or 2D on a Z layer comes back in warnings. Returns count of added features.| Parameter | Type | Description |
|---|---|---|
| crs | string | |
| features * | array | |
| instance | string | |
| layer_id * | string |
add_fieldAdd a new field to a vector layer. field_type: 'string', 'int', 'double', 'bool', 'date', 'datetime'. Inside an edit session the change is buffered (undoable, discarded by rollback); otherwise it is written straight to the data source.| Parameter | Type | Description |
|---|---|---|
| field_name * | string | |
| field_type * | string | |
| instance | string | |
| layer_id * | string | |
| length | integer | |
| precision | integer |
add_layer_from_connectionLoad a table from a saved connection as a project layer. Pass table (+ schema), or sql to build a query layer executed by the database. For a SQL layer, geometry_column and primary_key may be needed for QGIS to map/identify the result.| Parameter | Type | Description |
|---|---|---|
| connection * | string | |
| geometry_column | string | |
| instance | string | |
| name | string | |
| primary_key | string | |
| provider * | string | |
| schema | string | |
| sql | string | |
| table | string |
add_layout_labelAdd a text label to a print layout (mm). text may contain [% expression %] for dynamic content. color is hex (e.g. '#000000').| Parameter | Type | Description |
|---|---|---|
| color | string | |
| font_size | integer | |
| height | number | |
| instance | string | |
| layout_name * | string | |
| text * | string | |
| width | number | |
| x | number | |
| y | number |
add_layout_legendAdd a legend to a print layout, linked to a map item (defaults to the first map item). Position/size in mm.| Parameter | Type | Description |
|---|---|---|
| height | number | |
| instance | string | |
| layout_name * | string | |
| map_item_id | string | |
| title | string | |
| width | number | |
| x | number | |
| y | number |
add_layout_mapAdd a map item to a print layout at specified position and size (in millimeters).| Parameter | Type | Description |
|---|---|---|
| height * | number | |
| instance | string | |
| layout_name * | string | |
| width * | number | |
| x * | number | |
| y * | number |
add_layout_pictureAdd a picture or SVG (logo, north arrow) to a print layout. path is an image or SVG file path. Position/size in mm.| Parameter | Type | Description |
|---|---|---|
| height | number | |
| instance | string | |
| layout_name * | string | |
| path * | string | |
| width | number | |
| x | number | |
| y | number |
add_layout_scalebarAdd a scale bar to a print layout, linked to a map item. style e.g. 'Single Box', 'Double Box', 'Line Ticks Up', 'Numeric'.| Parameter | Type | Description |
|---|---|---|
| height | number | |
| instance | string | |
| layout_name * | string | |
| map_item_id | string | |
| style | string | |
| width | number | |
| x | number | |
| y | number |
add_layout_tableAdd an attribute table for a vector layer to a print layout. max_rows caps the number of features shown. Position/size in mm.| Parameter | Type | Description |
|---|---|---|
| height | number | |
| instance | string | |
| layer_id * | string | |
| layout_name * | string | |
| max_rows | integer | |
| width | number | |
| x | number | |
| y | number |
add_map_themeCreate a map theme from the current layer visibility state. If a theme with this name exists, it will be updated.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| name * | string |
add_raster_layerAdd a raster layer (GeoTIFF, etc.) to the project.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| name | string | |
| path * | string | |
| provider | string |
add_table_joinAdd a table join to a vector layer.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| join_field * | string | |
| join_layer_id * | string | |
| prefix | string | |
| target_field * | string | |
| target_layer_id * | string |
add_vector_layerAdd a vector layer (shapefile, GeoJSON, GeoPackage, etc.) to the project.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| name | string | |
| path * | string | |
| provider | string |
add_web_layerAdd a web layer (XYZ, WMS, WFS) to the project. service: 'xyz', 'wms', 'wfs'. crs is optional and only meaningful for wms ('crs=' in the uri) and wfs ('srsname='): leave it unset to take whatever the service serves natively. XYZ tiles are always EPSG:3857, so requesting another CRS for them is an error rather than a silent no-op. The response reports the CRS the layer actually got.| Parameter | Type | Description |
|---|---|---|
| crs | string | |
| instance | string | |
| name | string | |
| service * | string | |
| url * | string |
analysisVector and raster analysis.
Actions: spatial_join, zonal_statistics, raster_calculator, sample_raster
- spatial_join: target_layer (str), join_layer (str), predicates (list[int], default [0]: 0=intersects 1=contains 2=equals 3=touches 4=overlaps 5=within 6=crosses), join_fields (list[str], optional - default all), method (int, default 1: 0=one-to-many 1=first match - keeps one arbitrary match, drops the rest - 2=largest overlap), prefix (str, default ''), output_path (str, optional - omit for an in-memory layer)
- zonal_statistics: polygon_layer (str), raster_layer (str), band (int, default 1), prefix (str, default '_'), stats (list[int], default [0,1,2]: 0=count 1=sum 2=mean 3=median 4=stdev 5=min 6=max 7=range 8=minority 9=majority 10=variety 11=variance), output_path (str, optional - omit for an in-memory layer)
- raster_calculator: expression (str, reference bands as 'LayerName@band'), output_path (str, GeoTIFF), reference_layer (str, optional - grid/extent source)
- sample_raster: raster_layer (str), points (list[[x, y]] in crs or the raster CRS), band (int, optional - omit to sample all bands), crs (str, optional)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
apply_map_themeApply a map theme - restores the layer visibility state saved in the theme.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| name * | string |
apply_style_qmlApply a QGIS QML style to a layer, from a file (path) or inline QML text (qml); pass exactly one. Use it for styles the other styling tools do not model (rule-based renderers, data-defined properties, SVG fills, blend modes). Rejected, with the previous style restored, if the XML is malformed, targets the other layer kind, or QGIS loads a different renderer than the QML declares. Tip: save_style_qml on a similar layer gives a template in this QGIS version's format.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| path | string | |
| qml | string |
batchExecute multiple commands in a single round-trip.
Actions: execute
- execute: commands (list[dict]) - each {'type': '<command>', 'params': {...}}.| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
batch_commandsExecute multiple commands in a single round-trip. Each command is {"type": "<command_name>", "params": {...}}. Destructive commands| Parameter | Type | Description |
|---|---|---|
| commands * | array | |
| instance | string |
bookmarksSpatial bookmarks for quick navigation.
Actions: list, add, remove
- list: no params
- add: name (str), xmin (float), ymin (float), xmax (float), ymax (float), crs (str, optional - default the project CRS), group (str, optional)
- remove: bookmark_id (str) - destructive| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
cancel_processing_jobAsk a running background job to stop. Its state turns 'cancelled' once QGIS has stopped it; outputs it already wrote stay on disk.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| job_id * | string |
canvasMap canvas operations.
Actions: get_extent, set_extent, screenshot, screenshot_3d, get_scale, set_scale
- get_extent: no params
- set_extent: xmin (float), ymin (float), xmax (float), ymax (float), crs (str, optional)
- screenshot: no params - returns inline image
- screenshot_3d: view_index (int, optional), dpi (int, optional), pitch (float, optional: 0=top-down, 90=edge-on), distance (float, optional), heading (float, optional) - capture an open 3D map view as an inline image
- get_scale: no params
- set_scale: scale (float, optional), rotation (float, optional)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
clear_selectionClear the selection on a layer.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
codeExecute arbitrary PyQGIS code.
Actions: execute
- execute: code (str), timeout (int, optional, seconds before the script is cancelled, default 55); a script that raises or times out is a tool error with the traceback and output so far - destructive, requires confirmation| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
commit_editsCommit the layer's edit buffer to the data source and close the edit session.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
configure_atlasConfigure a print layout's atlas: coverage_layer (vector layer id) drives one page per feature. Optional page_name_expression, filter_expression, sort_expression.| Parameter | Type | Description |
|---|---|---|
| coverage_layer * | string | |
| enabled | boolean | |
| filter_expression | string | |
| instance | string | |
| layout_name * | string | |
| page_name_expression | string | |
| sort_expression | string |
connectionSaved data source connections (PostgreSQL, GeoPackage, SpatiaLite, MS SQL, ...) - the QGIS Browser panel entries.
Actions: list, create, list_tables, add_layer, import_layer, execute_sql
- list: provider (str, optional filter, e.g. 'postgres', 'ogr')
- create: PostgreSQL only, password-free. name (str) and connection_mode (str) are required; connection_mode selects the other required parameters, ask the user which applies when unclear: endpoint_using_auth_manager needs host, port (the real database port, never an assumed 5432), database, auth_config_id; service_using_auth_manager needs service (pg_service.conf name) and auth_config_id, database optionally overrides dbname; service_only needs service, database optionally overrides dbname. ssl_mode (str, default 'prefer': prefer|disable|allow|require|verify-ca|verify-full). Validates the connection before saving
- list_tables: provider (str), connection (str), schema (str, optional - omit on schema-aware providers to get the schema list first)
- add_layer: provider (str), connection (str), table (str) + schema (str, optional), OR sql (str) for a database-side query layer; geometry_column (str, optional), primary_key (str, optional), name (str, optional)
- import_layer: layer_id (str), provider (str), connection (str), table (str), schema (str, optional), overwrite (bool, default false) - destructive
- execute_sql: provider (str), connection (str), sql (str), limit (int, default 100, -1 for all) - runs server-side, can modify the database, requires confirmation| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
create_checkpointSnapshot the whole project (layers, styles, labels, layouts, map themes, variables, and the features of memory layers) so restore_checkpoint can return to it. Take one before a sequence of changes you may want to undo. The user's project file is not touched. Data in files and databases is not copied, and uncommitted edits are listed under 'uncommitted_edits' because the checkpoint does not hold them. The last 20 are kept, until the plugin's server stops.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| name | string |
create_layer_groupCreate a new layer group in the layer tree. Optionally specify a parent group name.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| name * | string | |
| parent | string |
create_layoutCreate a new print layout.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| name * | string |
create_memory_layerCreate 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.| Parameter | Type | Description |
|---|---|---|
| crs | string | |
| fields | array | |
| geometry_type * | string | |
| instance | string | |
| name * | string |
create_new_projectCreate a new empty QGIS project and save it to the given path. Replaces the open project; unsaved changes to it are lost.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| path * | string |
create_postgresql_connectionValidate and save a new PostgreSQL Browser-panel connection. Passwords are never accepted: credentials come from a QGIS Authentication Manager configuration, from the libpq service file (pg_service.conf), or both. connection_mode selects which parameters are required; when the user's intent is unclear, ask which mode applies before calling. endpoint_using_auth_manager: host, port, database, auth_config_id (port must be the actual database port supplied by the caller or user, this tool never assumes 5432). service_using_auth_manager: service (the name defined in pg_service.conf) and auth_config_id; database optionally overrides the service file's dbname. service_only: service; database optionally overrides dbname; do not pass auth_config_id. Parameters a mode does not use are rejected. Fails if name already exists or the database cannot be reached. ssl_mode is one of prefer (default), disable, allow, require, verify-ca, or verify-full.| Parameter | Type | Description |
|---|---|---|
| auth_config_id | string | |
| connection_mode * | string | |
| database | string | |
| host | string | |
| instance | string | |
| name * | string | |
| port | integer | |
| service | string | |
| ssl_mode | string |
create_processing_modelBuild QGIS Processing Model (.model3) from structured spec; save to user models folder, register in Processing Toolbox. Only call needed: algorithm discovery + param validation run in the plugin against the live registry, so do NOT call list_processing_algorithms or get_algorithm_help first. Pass keyword ('buffer') or full id ('native:buffer'); handler resolves it. Ambiguous hint returns candidate list to refine and retry. Bad param/output names reported with the valid set.
Spec:
inputs: [{name, type, description?, default?, optional?, parent_layer? (for field/distance), options? (for enum)}]. Types: vector, feature_source, raster, field, number, integer, distance, string, boolean, extent, crs, point, file, folder, enum, multiple_layers.
steps: [{id, algorithm, description?, parameters: {ALG_PARAM: value}}]. algorithm = keyword or full id. Param values:
'@input_name' = model input value
'$step_id.OUTPUT' = earlier step output
'=expression' = QGIS expression ('=$area'). Expression params (FORMULA, EXPRESSION) get it as text, evaluated per feature; others get its value per run
else = static literal (number/bool/string/list)
outputs: [{name, from_step, from_output, description?}] = exposed outputs; omit to expose the last step OUTPUT as 'Result'.
Name collision appends a suffix (name_2.model3, ...). Response returns the actual 'name', the 'requested_name', and 'resolved_steps' (which algorithm each hint mapped to).| Parameter | Type | Description |
|---|---|---|
| description | string | |
| group | string | |
| inputs | array | |
| instance | string | |
| name * | string | |
| outputs | array | |
| steps * | array |
delete_featuresDelete features by feature IDs or expression filter. Provide either fids (list of ints) or expression (string), not both. Returns requested and the measured deleted count.| Parameter | Type | Description |
|---|---|---|
| expression | string | |
| fids | array | |
| instance | string | |
| layer_id * | string |
delete_fieldDelete a field from a vector layer. Inside an edit session the change is buffered (undoable, discarded by rollback).| Parameter | Type | Description |
|---|---|---|
| field_name * | string | |
| instance | string | |
| layer_id * | string |
diagnoseRun diagnostic checks on the QGIS MCP stack. Reports QGIS version, plugin/server version match, processing providers, connected clients, and project status.| Parameter | Type | Description |
|---|---|---|
| instance | string |
duplicate_layerDuplicate a layer (including its style) under a new name.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| new_name | string |
editingVector layer edit sessions. While a session is open, feature add/update/delete goes to an undoable buffer instead of the data source.
Actions: start, commit, rollback, status, undo, redo
- start: layer_id (str)
- commit: layer_id (str) - writes the buffer to the data source
- rollback: layer_id (str) - discards it, requires confirmation
- status: layer_id (str)
- undo: layer_id (str), steps (int, default 1)
- redo: layer_id (str), steps (int, default 1)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
evaluate_expressionEvaluate a standalone QGIS expression to a scalar value (e.g. aggregate('layer','sum','field'), @project_var, now()). Optional layer_id adds layer scope. Distinct from validate_expression (validate only) and field_calculator (per-feature).| Parameter | Type | Description |
|---|---|---|
| expression * | string | |
| instance | string | |
| layer_id | string |
execute_codeExecute arbitrary PyQGIS code. Use for operations not covered by other tools. Has access to QgsProject, iface, and core QGIS classes. Returns stdout/stderr and elapsed seconds. timeout: seconds before the script is cancelled (default 55); a script that runs past it comes back with timed_out=True and the output printed so far, and its side effects stand. Raise timeout or split bulk work into several calls; QGIS is unresponsive while a script runs. A single blocking call (time.sleep, GDAL) cannot be interrupted before it returns. A script that raises or times out is a tool error carrying the traceback and output so far.| Parameter | Type | Description |
|---|---|---|
| code * | string | |
| instance | string | |
| timeout | integer |
execute_connection_sqlRun SQL directly on the database behind a saved connection (server-side, not a virtual layer - use execute_sql for that). Can modify the database: DDL/DML run as issued. limit caps returned rows (-1 for all).| Parameter | Type | Description |
|---|---|---|
| connection * | string | |
| instance | string | |
| limit | integer | |
| provider * | string | |
| sql * | string |
execute_processingExecute 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. timeout: seconds before the algorithm is cancelled (default 55). Raise it for heavy raster work, or use start_processing_job, which runs in the background with no limit. load_results: add the algorithm's outputs to the project and list them in 'loaded_layers' (the processing.runAndLoadResults() behaviour). This is the only way to keep a 'TEMPORARY_OUTPUT'/'memory:' result, which is otherwise discarded when the run ends. Only vector and raster destinations are loaded, never file or folder ones. ellipsoid: ellipsoid for distance/area measurements (e.g. 'EPSG:7030' for WGS 84, 'NONE' for planimetric). Default is the open project's ellipsoid.| Parameter | Type | Description |
|---|---|---|
| algorithm * | string | |
| ellipsoid | string | |
| instance | string | |
| load_results | boolean | |
| parameters * | object | |
| timeout | integer |
execute_processing_batchRun one algorithm once per parameter dict in 'parameters_list'. Returns a per-run result with index and success/error status. Use for applying the same operation over many inputs in a single round-trip. timeout: seconds for the whole batch (default 55); runs that would start after it has elapsed come back as 'skipped' with the completed ones intact, so raise it or split the list for big batches. ellipsoid: measurement ellipsoid for every run (e.g. 'EPSG:7030'); default is the project's.| Parameter | Type | Description |
|---|---|---|
| algorithm * | string | |
| ellipsoid | string | |
| instance | string | |
| parameters_list * | array | |
| timeout | integer |
execute_sqlSQL across loaded layers via a virtual layer; reference layers by name in FROM/JOIN. as_layer=True registers the result as a new layer (set geometry_field for spatial output); else returns rows inline, capped by limit (default 1000, negative for all) with a truncated flag. layers limits sources by layer id.| Parameter | Type | Description |
|---|---|---|
| as_layer | boolean | |
| geometry_field | string | |
| instance | string | |
| layer_name | string | |
| layers | array | |
| limit | integer | |
| query * | string | |
| uid_field | string |
export_atlasExport a configured atlas. format 'pdf' writes a single multi-page file at output_path; image formats ('png','jpg','tif') write one file per feature into the output_path directory. Call configure_atlas first.| Parameter | Type | Description |
|---|---|---|
| dpi | integer | |
| format | string | |
| instance | string | |
| layout_name * | string | |
| output_path * | string |
export_layerExport vector/raster to disk; format from output_path extension (.gpkg, .shp, .geojson, .tif, ...). target_crs (e.g. 'EPSG:4326') reprojects on export. filter_expression (vector only) exports a subset matching a QGIS expression.| Parameter | Type | Description |
|---|---|---|
| filter_expression | string | |
| instance | string | |
| layer_id * | string | |
| output_path * | string | |
| target_crs | string |
export_layoutExport a print layout to file. format: 'pdf', 'png', 'jpg', 'svg'. dpi: resolution (default 300).| Parameter | Type | Description |
|---|---|---|
| dpi | integer | |
| format | string | |
| instance | string | |
| layout_name * | string | |
| path * | string |
export_sessionEvery command that changed something in this QGIS since the plugin's server started (read-only calls left out), as a Python script that replays them from the QGIS Python console. Layer ids are remapped on replay. Returns the script, or writes it to 'path' and returns the path. clear: start a new journal afterwards. Commands from every connected client are in it; a restore_checkpoint rewinds it.| Parameter | Type | Description |
|---|---|---|
| clear | boolean | |
| instance | string | |
| path | string |
expressionExpression validation and evaluation.
Actions: validate, evaluate
- validate: expression (str), layer_id (str, optional)
- evaluate: expression (str), layer_id (str, optional) - returns scalar result| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
featuresFeature access and editing.
Actions: get, get_statistics, add, update, update_geometry, delete
- get: layer_id (str), limit (int, default 10, max 50), offset (int, default 0), expression (str, optional), include_geometry (bool, default false)
- get_statistics: layer_id (str), field_name (str)
- add: layer_id (str), features (list[dict]), crs (str, optional - of geometry_wkt, default the layer CRS) - destructive
- update: layer_id (str), updates (list[dict]) - destructive
- update_geometry: layer_id (str), updates (list[dict], [{fid, geometry_wkt}]) - destructive
- delete: layer_id (str), fids (list[int], optional), expression (str, optional) - destructive, requires confirmation| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
fieldVector field (attribute column) management.
Actions: add, delete, rename, calculate, unique_values
- add: layer_id (str), field_name (str), field_type (str: 'string', 'int', 'double', 'bool', 'date', 'datetime'), length (int, optional), precision (int, optional)
- delete: layer_id (str), field_name (str) - destructive, requires confirmation
- rename: layer_id (str), old_name (str), new_name (str)
- calculate: layer_id (str), field_name (str), expression (str), field_type (str, default 'double'), length (int, default 0), precision (int, default 0) - creates the field if missing, then populates it
- unique_values: layer_id (str), field (str), limit (int, default 1000, -1 for all)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
field_calculatorAdd (if missing) + populate a field from a QGIS expression, per feature, in-place. field_type: string|int|double|bool|date|datetime (default double). Example: expression='$area', field_name='area'. $area/$length use the project's ellipsoid and units (reported back as 'measurement'), not necessarily m2/m; the area()/length() functions are planimetric in the layer CRS (measurement.planimetric_units, squared for area()); length() of a string counts characters and reports no units. Returns updated and failed counts; failed features keep their old value and first_error says why. Refused while the layer has an open edit session.| Parameter | Type | Description |
|---|---|---|
| expression * | string | |
| field_name * | string | |
| field_type | string | |
| instance | string | |
| layer_id * | string | |
| length | integer | |
| precision | integer |
find_layerFind layers by name pattern. Supports fnmatch wildcards (e.g. 'roads*') and substring matching.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| name_pattern * | string |
get_3d_screenshotCapture an OPEN 3D Map View as an inline image. Reuses the open view's scene + camera, rendered via a print-layout 3D map item (the 2D get_canvas_screenshot cannot capture the OpenGL 3D view). Requires a 3D map view to be open in QGIS (View > 3D Map Views > New 3D Map View). view_index selects which view when several are open; dpi controls output resolution. Optional camera overrides (applied to the capture only, leaving the live view unchanged): pitch (0 = straight down/top-down, 90 = horizontal/edge-on; ~45 = balanced oblique), heading (compass degrees), distance (metres).| Parameter | Type | Description |
|---|---|---|
| distance | number | |
| dpi | integer | |
| heading | number | |
| instance | string | |
| pitch | number | |
| view_index | integer |
get_active_layerGet the currently active (selected) layer in the QGIS layer panel.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_algorithm_helpGet detailed help for a processing algorithm: parameters (name, type, optional, default), outputs, and description.| Parameter | Type | Description |
|---|---|---|
| algorithm_id * | string | |
| instance | string |
get_bookmarksGet spatial bookmarks from the project. Each bookmark has a name, group, extent (xmin/ymin/xmax/ymax), and CRS.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_canvas_extentGet the current map canvas extent and CRS.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_canvas_scaleGet the current map canvas scale, rotation, and magnification factor.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_canvas_screenshotGrab a fast screenshot of the current map canvas widget (no re-render). Returns the image inline. Much faster than render_map.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_edit_statusEdit state of a layer: editable, modified, undo/redo availability, and the counts of pending added/deleted/changed features.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
get_field_statisticsCompute aggregate statistics (count, sum, mean, min, max, stdev) for a numeric field. For non-numeric fields returns count and distinct values.| Parameter | Type | Description |
|---|---|---|
| field_name * | string | |
| instance | string | |
| layer_id * | string |
get_layer_crsGet the coordinate reference system (CRS) of a layer: EPSG code, description, whether geographic, and PROJ4 string.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
get_layer_extentGet the spatial extent (bounding box) and CRS of a layer.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
get_layer_featuresGet features from a vector layer. Flat dicts: _fid + attributes at top level. expression filter (QGIS, e.g. "name = 'Berlin'", "population > 1000000"), limit (max 50, larger is refused; default 10), offset for paging, optional geometry in _geometry key. feature_count is the layer total; matched is the count after the expression filter.| Parameter | Type | Description |
|---|---|---|
| expression | string | |
| include_geometry | boolean | |
| instance | string | |
| layer_id * | string | |
| limit | integer | |
| offset | integer |
get_layer_labelingGet the labeling configuration of a vector layer: enabled state, field, font size, color.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
get_layer_treeGet the full layer tree structure with groups and layers. Returns recursive tree with type, name, visibility, and children.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_layersList layers in the current project with IDs, names, types, visibility, and type-specific info. Use limit/offset for pagination. Response includes total_count.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| limit | integer | |
| offset | integer |
get_layout_infoList items in a print layout (type, id, uuid, position, size) and page count.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layout_name * | string |
get_map_themesGet map themes (visibility presets). Each theme stores which layers are visible.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_message_logGet QGIS message log entries. Filter by level ('info', 'warning', 'critical', 'success', 'none') and/or tag (e.g. 'QGIS MCP'). Returns newest first.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| level | string | |
| limit | integer | |
| tag | string |
get_plugin_infoGet detailed info for a specific plugin: name, enabled, version, description, author, path.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| plugin_name * | string |
get_processing_jobState of a background job: 'running' (with progress 0-100), 'succeeded' (with result, loaded_layers and warnings, as execute_processing returns them), 'failed' (with error) or 'cancelled'. Omit job_id to list every job.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| job_id | string |
get_processing_providersList Processing providers (native, gdal, grass, saga, model, ...) with algorithm counts and active status. Use to diagnose missing algorithms.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_project_infoGet current project metadata: filename, title, CRS, layer count, and summary of layers.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_project_variablesGet all project-level variables (key-value pairs set in Project Properties).| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_qgis_infoGet QGIS version, profile path, and plugin count.| Parameter | Type | Description |
|---|---|---|
| instance | string |
get_raster_infoGet raster layer info: band count, dimensions, CRS, extent, per-band statistics, nodata values.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
get_selectionGet the current selection for a layer. Returns feature IDs and count.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
get_settingRead a QGIS setting by key path (e.g. 'qgis/sketching/sketching_enabled').| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| key * | string |
get_unique_valuesReturn the distinct values of a field. Use 'limit' to cap results (-1 for all). Useful before building categorized symbology or filters.| Parameter | Type | Description |
|---|---|---|
| field * | string | |
| instance | string | |
| layer_id * | string | |
| limit | integer |
identify_featuresIdentify features at a point [x, y] across layers (map-click analogue). The point and tolerance are in crs when given, else the project CRS; layers in another CRS are reprojected. tolerance (in those units) expands the search; 0 = exact hit. layer_ids limits the search (default: visible vector layers). limit caps features per layer. Layers the point cannot be transformed into are listed in skipped_layers.| Parameter | Type | Description |
|---|---|---|
| crs | string | |
| instance | string | |
| layer_ids | array | |
| limit | integer | |
| point * | array | |
| tolerance | number |
import_layer_to_connectionWrite a loaded vector layer into a saved connection as a new table (PostgreSQL, GeoPackage, ...). Fails if the table exists unless overwrite=true.| Parameter | Type | Description |
|---|---|---|
| connection * | string | |
| instance | string | |
| layer_id * | string | |
| overwrite | boolean | |
| provider * | string | |
| schema | string | |
| table * | string |
layerLayer management.
Actions: list, add_vector, add_raster, add_web, remove, find, create_memory, set_visibility, zoom_to, get_info, get_schema, get_extent, get_raster_info, get_crs, set_crs, get_labeling, set_labeling, duplicate, set_order, export, save_style, apply_style, add_join
- list: limit (int, default 50), offset (int, default 0)
- add_vector: path (str), provider (str, default 'ogr'), name (str, optional)
- add_raster: path (str), provider (str, default 'gdal'), name (str, optional)
- remove: layer_id (str) - destructive, requires confirmation
- find: name_pattern (str)
- create_memory: name (str), geometry_type (str), crs (str, default 'EPSG:4326'), fields (list[dict], optional)
- set_visibility: layer_id (str), visible (bool)
- zoom_to: layer_id (str)
- get_info: layer_id (str)
- get_schema: layer_id (str)
- get_extent: layer_id (str)
- get_raster_info: layer_id (str)
- get_crs: layer_id (str)
- set_crs: layer_id (str), crs (str)
- get_labeling: layer_id (str)
- set_labeling: layer_id (str), enabled (bool, default true), field_name (str, optional), font_size (float, optional), color (str, optional)
- duplicate: layer_id (str), new_name (str, optional)
- set_order: layer_ids (list[str]) - top to bottom
- add_web: url (str), service (str: 'xyz', 'wms', 'wfs'), name (str, optional), crs (str, optional - only for wms/wfs; XYZ tiles are always EPSG:3857 and requesting another CRS is an error)
- export: layer_id (str), output_path (str) - format from extension (.gpkg/.shp/.geojson/.tif); target_crs (str, optional) reprojects, filter_expression (str, optional) exports a subset
- save_style: layer_id (str), path (str) - write a .qml
- apply_style: layer_id (str), path (str) or qml (str, inline QML text) - apply a style; the previous one is restored if QGIS loads another renderer
- add_join: target_layer_id (str), join_layer_id (str), target_field (str), join_field (str), prefix (str, default '')| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
layer_propertyLayer properties.
Actions: set
- set: layer_id (str), property (str), value (str) - supported: opacity, name, min_scale, max_scale, scale_visibility| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
layer_treeLayer tree structure.
Actions: get, create_group, move_to_group
- get: no params
- create_group: name (str), parent (str, optional)
- move_to_group: layer_id (str), group_name (str)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
list_checkpointsList the project checkpoints: id, name, creation time, layer count.| Parameter | Type | Description |
|---|---|---|
| instance | string |
list_connection_tablesList tables reachable through a saved connection. On providers with schemas (PostgreSQL), omit schema to get the schema list first, then pass one. Returns each table's geometry column, CRS, primary key and kind.| Parameter | Type | Description |
|---|---|---|
| connection * | string | |
| instance | string | |
| provider * | string | |
| schema | string |
list_connectionsList the data source connections saved in QGIS (PostgreSQL, GeoPackage, SpatiaLite, MS SQL, Oracle, ...) - the Browser panel entries. Optionally filter by provider (e.g. 'postgres', 'ogr', 'spatialite'). Passwords are redacted from the URIs.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| provider | string |
list_layoutsList all print layouts in the current project with names and page counts.| Parameter | Type | Description |
|---|---|---|
| instance | string |
list_pluginsList installed QGIS plugins with name, enabled status, and version. Set enabled_only=true to list only active plugins.| Parameter | Type | Description |
|---|---|---|
| enabled_only | boolean | |
| instance | string |
list_processing_algorithmsSearch for processing algorithms by keyword and/or provider. Returns id, name, provider for each match.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| provider | string | |
| search | string |
list_processing_modelsList registered Processing models (the 'model' provider). Returns id, name, group for each. Use run_model to execute one.| Parameter | Type | Description |
|---|---|---|
| instance | string |
list_qgis_instancesList the configured QGIS instances: name, host, port, reachability, and - for each reachable one - which QGIS actually answered (version, process id, window title, profile). Use it to confirm a name maps to the window you mean before writing to it. Pass a name as the 'instance' argument of any other tool to target that QGIS window; omitting it targets the instance named 'default', or the first one listed when no instance is called 'default'.load_projectLoad a QGIS project from a .qgs/.qgz file path. Replaces the open project; unsaved changes to it are lost. Layers whose source is missing are kept as unavailable and listed in 'unavailable_layers'.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| path * | string |
map_themesMap themes (visibility presets).
Actions: list, add, remove, apply
- list: no params
- add: name (str) - saves current visibility state
- remove: name (str) - destructive
- apply: name (str) - restores saved visibility state| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
message_logQGIS message log.
Actions: get
- get: level (str, optional: 'info', 'warning', 'critical', 'success', 'none'), tag (str, optional), limit (int, default 100)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
move_layer_to_groupMove a layer into a layer group by group name.| Parameter | Type | Description |
|---|---|---|
| group_name * | string | |
| instance | string | |
| layer_id * | string |
pingCheck connectivity to the QGIS plugin server. Returns pong if connected.| Parameter | Type | Description |
|---|---|---|
| instance | string |
pluginsPlugin management.
Actions: list, get_info, reload
- list: enabled_only (bool, default false)
- get_info: plugin_name (str)
- reload: plugin_name (str) - destructive| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
processingQGIS Processing framework.
Actions: execute, execute_batch, list_algorithms, get_help, get_providers, create_model, list_models, run_model, start_job, get_job, cancel_job
- execute: algorithm (str), parameters (dict), timeout (int, optional, seconds before the algorithm is cancelled, default 55), load_results (bool, optional) - add the outputs to the project and list them in 'loaded_layers'; the only way to keep a 'TEMPORARY_OUTPUT'/'memory:' result, ellipsoid (str, optional) - measurement ellipsoid, e.g. 'EPSG:7030' (WGS 84); default is the project's
- execute_batch: algorithm (str), parameters_list (list[dict]), timeout (int, optional, seconds for the whole batch, default 55), ellipsoid (str, optional) - one run per dict, per-run success/error/skipped status
- list_algorithms: search (str, optional), provider (str, optional)
- get_help: algorithm_id (str)
- get_providers: no params - providers with algorithm counts and active status
- list_models: no params - registered Processing models (id, name, group)
- run_model: model (str: registered id like 'model:myflow', or a .model3 path), parameters (dict, optional) mapping the model's input names to values; missing output/sink parameters default to a temporary layer; ellipsoid (str, optional)
- create_model: name (str), steps (list[dict]), inputs (list[dict], optional), outputs (list[dict], optional), description (str, optional), group (str, optional).
inputs: [{name, type, description?, default?, optional?, parent_layer? (field/distance), options? (enum)}]. Types: vector, feature_source, raster, field, number, integer, distance, string, boolean, extent, crs, point, file, folder, enum, multiple_layers.
steps: [{id, algorithm, description?, parameters: {ALG_PARAM: value}}] - 'id' is REQUIRED and must be unique; 'algorithm' takes a keyword ('buffer') or a full id ('native:buffer').
step parameter values: '@input_name' = model input, '$step_id.OUTPUT' = earlier step output, '=expression' = QGIS expression (per feature on expression params like FORMULA, once per run elsewhere), anything else = static literal.
outputs: [{name, from_step, from_output, description?}]; omit to expose the last step's OUTPUT as 'Result'.
The model is saved into the QGIS user models folder and registered; a numeric suffix is appended to the name on collision.
- start_job: algorithm (str), parameters (dict), load_results (bool, optional), ellipsoid (str, optional) - run as a background task with no time limit and return a job id at once; use it for anything that may take more than a minute. A 'TEMPORARY_OUTPUT' feature sink needs load_results; temporary files are kept
- get_job: job_id (str, optional) - omit it to list every job. The state is running with progress, succeeded with result, failed with error, or cancelled
- cancel_job: job_id (str)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
projectProject management.
Actions: get_info, load, create, save, set_crs, create_checkpoint, list_checkpoints, restore_checkpoint, export_session
- get_info: no params
- load: path (str)
- create: path (str)
- save: path (str, optional)
- set_crs: crs (str)
- create_checkpoint: name (str, optional) - snapshot the whole project, memory layer features included, to undo a sequence of changes; uncommitted edits and file/database data are not held
- list_checkpoints: no params
- restore_checkpoint: checkpoint_id (str) - discard every change since it
- export_session: path (str, optional), clear (bool, optional) - the commands that changed something, as a Python script replaying them from the QGIS console
load, create and restore_checkpoint replace the open project; unsaved changes to it are lost.| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
queryCross-layer query.
Actions: sql, identify
- sql: query (str), layers (list[str], optional), as_layer (bool, default false), layer_name (str), geometry_field (str, optional), uid_field (str, optional), limit (int, default 1000, negative for all)
- identify: point (list[float] [x,y], in crs or the project CRS), tolerance (float, same units, default 0), layer_ids (list[str], optional), limit (int, default 10), crs (str, optional)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
raster_calculatorBand math via the QGIS raster calculator. Reference loaded raster layers in the expression as 'LayerName@band' (e.g. '("dem@1" > 1000) * 1'). Writes a GeoTIFF to output_path. Output grid, extent and CRS taken from reference_layer (layer id or name), defaulting to the first loaded file-based raster.| Parameter | Type | Description |
|---|---|---|
| expression * | string | |
| instance | string | |
| output_path * | string | |
| reference_layer | string |
redo_editsRedo previously undone edit operations on a layer.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| steps | integer |
reload_pluginReload a QGIS plugin by name. Cannot reload the MCP plugin itself. Useful during plugin development.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| plugin_name * | string |
remove_bookmarkRemove a spatial bookmark by its ID.| Parameter | Type | Description |
|---|---|---|
| bookmark_id * | string | |
| instance | string |
remove_layerRemove a layer from the project by its layer ID. This is irreversible.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
remove_layoutRemove a print layout from the project.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layout_name * | string |
remove_map_themeRemove a map theme by name.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| name * | string |
rename_fieldRename a field in a vector layer. Inside an edit session the change is buffered (undoable, discarded by rollback).| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| new_name * | string | |
| old_name * | string |
renderRendering, layout authoring and atlas export.
Actions: map, list_layouts, create_layout, get_layout_info, remove_layout, add_map, add_label, add_legend, add_scalebar, add_picture, add_table, configure_atlas, export_layout, export_atlas
- map: width (int, default 800), height (int, default 600), path (str, optional) - returns inline image
- list_layouts: no params
- create_layout: name (str)
- get_layout_info: layout_name (str)
- remove_layout: layout_name (str) - destructive
- add_map: layout_name (str), x, y, width, height (float, mm)
- add_label: layout_name (str), text (str), x, y, width, height, font_size (int), color (hex)
- add_legend: layout_name (str), map_item_id (str, optional), x, y, width, height, title (str)
- add_scalebar: layout_name (str), map_item_id (str, optional), x, y, width, height, style (str)
- add_picture: layout_name (str), path (str), x, y, width, height
- add_table: layout_name (str), layer_id (str), x, y, width, height, max_rows (int)
- configure_atlas: layout_name (str), coverage_layer (str), enabled (bool), page_name_expression/filter_expression/sort_expression (str, optional)
- export_layout: layout_name (str), path (str), format (str, default 'pdf'), dpi (int, default 300)
- export_atlas: layout_name (str), output_path (str), format (str, default 'pdf'), dpi (int, default 300)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
render_mapRender the current map canvas to an image. Returns the image inline so you can see it. Optionally saves to a file path on disk.| Parameter | Type | Description |
|---|---|---|
| height | integer | |
| instance | string | |
| path | string | |
| width | integer |
restore_checkpointPut the project back as it was at a checkpoint: every change since, and any uncommitted edit, is discarded. The project keeps its file name and is left unsaved. Memory layer features come back with new feature ids. Layers whose source is missing are kept as unavailable and listed in 'unavailable_layers'. export_session afterwards replays the restored state, not the undone steps.| Parameter | Type | Description |
|---|---|---|
| checkpoint_id * | string | |
| instance | string |
rollback_editsDiscard every uncommitted change on a layer and close the edit session.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
run_modelRun a Processing model by registered id (e.g. 'model:myflow') or by a .model3 file path. 'parameters' maps the model's input names to values (layer ids/paths, numbers, etc.); outputs take the names declared when the model was built, and an unknown key is refused. ellipsoid: ellipsoid for distance/area measurements (e.g. 'EPSG:7030' for WGS 84, 'NONE' for planimetric); default is the project's.| Parameter | Type | Description |
|---|---|---|
| ellipsoid | string | |
| instance | string | |
| model * | string | |
| parameters | object |
sample_raster_valuesSample raster pixel values at points. 'points' is a list of [x, y] in crs when given (reprojected to the raster), else in the raster's CRS. Omit 'band' to sample all bands. A null value is nodata when outside_extent is false; outside_extent true means the point is off the raster (often a CRS mix-up); transform_failed marks a point the raster's CRS cannot express.| Parameter | Type | Description |
|---|---|---|
| band | integer | |
| crs | string | |
| instance | string | |
| points * | array | |
| raster_layer * | string |
save_projectSave the current project. Optionally specify a new path.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| path | string |
save_style_qmlSave a layer's style to a QGIS QML file.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| path * | string |
select_featuresSelect features in a layer by expression or feature IDs (one or the other, not both).| Parameter | Type | Description |
|---|---|---|
| expression | string | |
| fids | array | |
| instance | string | |
| layer_id * | string |
selectionFeature selection.
Actions: select, get, clear
- select: layer_id (str), expression (str, optional), fids (list[int], optional); one or the other, not both
- get: layer_id (str)
- clear: layer_id (str)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
set_active_layerSet the active layer in the QGIS layer panel by layer ID.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
set_canvas_extentSet the map canvas extent. Coordinates should be in the specified CRS (default: project CRS).| Parameter | Type | Description |
|---|---|---|
| crs | string | |
| instance | string | |
| xmax * | number | |
| xmin * | number | |
| ymax * | number | |
| ymin * | number |
set_canvas_scaleSet the map canvas scale and/or rotation. Provide scale as denominator (e.g. 50000 for 1:50000). Rotation in degrees (0-360).| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| rotation | number | |
| scale | number |
set_layer_crsSet the CRS of a layer (e.g. 'EPSG:4326'). This does NOT reproject data - it only changes how the layer's coordinates are interpreted.| Parameter | Type | Description |
|---|---|---|
| crs * | string | |
| instance | string | |
| layer_id * | string |
set_layer_labelingConfigure 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').| Parameter | Type | Description |
|---|---|---|
| color | string | |
| enabled | boolean | |
| field_name | string | |
| font_size | number | |
| instance | string | |
| layer_id * | string |
set_layer_orderReorder layer tree nodes; tree order is draw order. layer_ids is the ordered list of layer ids from top (drawn last) to bottom; unlisted layers keep their slots. Clears any custom draw order (it freezes a snapshot list - layers added later would silently draw behind everything).| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_ids * | array |
set_layer_propertySet a layer property. Supported properties: opacity (0.0-1.0), name (string), min_scale, max_scale (float), scale_visibility (bool).| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| property * | string | |
| value * | string |
set_layer_styleSet symbology. style_type: 'single' (one symbol), 'categorized' (unique values), 'graduated' (numeric ranges). field required for categorized/graduated. color_ramp: QGIS ramp name (e.g. 'Spectral', 'Viridis', 'Blues'). classes: graduated class count (default 5).| Parameter | Type | Description |
|---|---|---|
| classes | integer | |
| color_ramp | string | |
| field | string | |
| instance | string | |
| layer_id * | string | |
| style_type * | string |
set_layer_visibilitySet a layer's visibility in the layer tree (show/hide on map).| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| visible * | boolean |
set_project_crsSet the project coordinate reference system (e.g. 'EPSG:4326', 'EPSG:3857'). This changes how layers are projected on the map canvas.| Parameter | Type | Description |
|---|---|---|
| crs * | string | |
| instance | string |
set_project_variableSet a project-level variable. Variables are accessible in expressions as @key.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| key * | string | |
| value * | string |
set_raster_styleSet raster symbology. style_type: 'singleband_pseudocolor' (color ramp over one band), 'singleband_gray', 'multiband_color' (RGB), 'hillshade'. min_value/max_value default to the band statistics. color_ramp: QGIS ramp name (e.g. 'Viridis', 'Spectral', 'RdYlGn'). classification: continuous|equal_interval|quantile. interpolation: interpolated|discrete|exact. gradient (gray): black_to_white|white_to_black. contrast: none|stretch|clip|stretch_clip. hillshade uses band, azimuth, altitude, z_factor.| Parameter | Type | Description |
|---|---|---|
| altitude | number | |
| azimuth | number | |
| band | integer | |
| blue_band | integer | |
| classes | integer | |
| classification | string | |
| color_ramp | string | |
| contrast | string | |
| gradient | string | |
| green_band | integer | |
| instance | string | |
| interpolation | string | |
| layer_id * | string | |
| max_value | number | |
| min_value | number | |
| red_band | integer | |
| style_type * | string | |
| z_factor | number |
set_settingWrite a QGIS setting. Use with care - incorrect settings can affect QGIS behavior.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| key * | string | |
| value * | string |
settingsQGIS settings.
Actions: get, set
- get: key (str)
- set: key (str), value (str) - destructive, requires confirmation| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
spatial_joinJoin attributes by location (native:joinattributesbylocation). predicates int list: 0=intersects 1=contains 2=equals 3=touches 4=overlaps 5=within 6=crosses (default [0]). method: 0=one-to-many 1=first match (default) 2=largest overlap. First match keeps one arbitrary match per target feature and drops the others; use 0 when several can match. join_fields = copied columns (default all). No output_path = in-memory layer. Returns joined_count (target features that found a match, whatever the method) next to target_features. warnings/warning_count report features QGIS skipped, e.g. invalid geometries under the Processing setting that skips them; fix them first (native:fixgeometries) or those features never match.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| join_fields | array | |
| join_layer * | string | |
| method | integer | |
| output_path | string | |
| predicates | array | |
| prefix | string | |
| target_layer * | string |
start_editingOpen an edit session on a vector layer. Subsequent add/update/delete calls go to the undoable edit buffer instead of the data source, until commit_edits or rollback_edits.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
start_processing_jobRun a Processing algorithm as a QGIS background task, with no time limit, and return its job id at once. QGIS stays usable while it runs. Poll get_processing_job for progress and the result; cancel_processing_job stops it. Use it instead of execute_processing for anything that may take more than a minute. Same parameters as execute_processing. A 'TEMPORARY_OUTPUT'/'memory:' vector (feature sink) output needs load_results=True, since that memory layer ends with the job; temporary files stay on disk. Algorithms that must run on QGIS's main thread are refused: use execute_processing for those.| Parameter | Type | Description |
|---|---|---|
| algorithm * | string | |
| ellipsoid | string | |
| instance | string | |
| load_results | boolean | |
| parameters * | object |
styleLayer symbology.
Actions: set, set_raster
- set: layer_id (str), style_type (str: 'single', 'categorized', 'graduated'), field (str, optional - required for categorized/graduated), classes (int, default 5), color_ramp (str, default 'Spectral')
- set_raster: layer_id (str), style_type (str: 'singleband_pseudocolor', 'singleband_gray', 'multiband_color', 'hillshade'), band (int, default 1), color_ramp (str, default 'Viridis'), classes (int, default 5), min_value/max_value (float, optional - default to band statistics), classification (str: continuous|equal_interval|quantile), interpolation (str: interpolated|discrete|exact), gradient (str: black_to_white|white_to_black), contrast (str: none|stretch|clip|stretch_clip), red_band/green_band/blue_band (int, multiband_color), azimuth/altitude/z_factor (float, hillshade)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
systemSystem operations.
Actions: ping, diagnose, get_qgis_info
- ping: no params
- diagnose: no params
- get_qgis_info: no params| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
transformCRS coordinate transformation.
Actions: coordinates
- coordinates: source_crs (str), target_crs (str), point (dict, optional), points (list[dict], optional), bbox (dict, optional)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
transform_coordinatesTransform coordinates between CRS. Accepts a point {x, y}, a point list [{x, y}, ...], or a bbox {xmin, ymin, xmax, ymax}. Returns the same format. x is always longitude/easting and y latitude/northing, including for EPSG:4326. A bbox that crosses the antimeridian comes back with xmin > xmax and crosses_antimeridian: true.| Parameter | Type | Description |
|---|---|---|
| bbox | object | |
| instance | string | |
| point | object | |
| points | array | |
| source_crs * | string | |
| target_crs * | string |
undo_editsUndo the last edit operations on a layer (its own undo stack). Returns how many steps were actually undone.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| steps | integer |
update_feature_geometryReplace feature geometries. updates: [{fid: 1, geometry_wkt: 'POINT(1 2)'}]. WKT must be in the layer's CRS. A geometry type the layer cannot hold is refused. Inside an edit session the change is undoable; otherwise it is written straight to the data source.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| updates * | array |
update_featuresUpdate feature attributes. updates: [{fid: 1, attributes: {field: value}}]. Returns count of updated features.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string | |
| updates * | array |
validate_expressionValidate a QGIS expression. Returns whether it's valid, any parse errors, and referenced column names. Optionally test against a layer's fields.| Parameter | Type | Description |
|---|---|---|
| expression * | string | |
| instance | string | |
| layer_id | string |
variablesProject variables.
Actions: get, set
- get: no params
- set: key (str), value (str)| Parameter | Type | Description |
|---|---|---|
| action * | string | |
| params | object |
zonal_statisticsPer-polygon stats from a raster (native:zonalstatisticsfb). stats int codes: 0=count 1=sum 2=mean 3=median 4=stdev 5=min 6=max 7=range 8=minority 9=majority 10=variety 11=variance (default [0,1,2]). New columns prefixed by 'prefix'. No output_path = in-memory layer.| Parameter | Type | Description |
|---|---|---|
| band | integer | |
| instance | string | |
| output_path | string | |
| polygon_layer * | string | |
| prefix | string | |
| raster_layer * | string | |
| stats | array |
zoom_to_layerZoom the map canvas to the full extent of the specified layer.| Parameter | Type | Description |
|---|---|---|
| instance | string | |
| layer_id * | string |
Security checks
Static checks derived from the repository 2 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 2.4K words.
- ✓License declaredThe repository declares the GPL-2.0 license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by uv.lock.
- !No dynamic code executionScanned 28 source files and found 1 call to eval or shell execution, in qgis_mcp_plugin/handlers/system.py:201. Review how tool inputs reach them before granting credentials.
1 check has not been run yet.
What the source scan found
- Transport
- stdio and Streamable HTTPsrc/qgis_mcp/server.py:3589, src/qgis_mcp/server.py:3587
- Starts other programs
- 8 callsinstall.py:159, install.py:175, install.py:181
- Outbound network calls
- No outbound network calls
- Writes or deletes files
- 16 callssrc/qgis_mcp/server.py:89, install.py:304, install.py:310
- Lockfile
- uv.lock
Pattern matches on the source text of 28 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 2.4K words, fetched 2 days ago. The original in the repository is authoritative.
Read full README