get_qgis_info
Retrieve QGIS software details and configuration to verify installation status and prepare for GIS operations within the QGISMCP server environment.
Instructions
Get QGIS information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/qgis_mcp/qgis_mcp_server.py:154-158 (handler)MCP tool handler for 'get_qgis_info' that proxies the request to the QGIS socket client and returns formatted JSON response.def get_qgis_info(ctx: Context) -> str: """Get QGIS information""" qgis = get_qgis_connection() result = qgis.send_command("get_qgis_info") return json.dumps(result, indent=2)
- Core handler implementation in the QGIS plugin that directly queries QGIS APIs for version, profile folder, and active plugins count.def get_qgis_info(self, **kwargs): """Get basic QGIS information""" return { "qgis_version": Qgis.version(), "profile_folder": QgsApplication.qgisSettingsDirPath(), "plugins_count": len(active_plugins) }
- qgis_mcp_plugin/qgis_mcp_plugin.py:133-149 (registration)Registration of command handlers in the QGIS plugin server, mapping 'get_qgis_info' to its handler method.handlers = { "ping": self.ping, "get_qgis_info": self.get_qgis_info, "load_project": self.load_project, "get_project_info": self.get_project_info, "execute_code": self.execute_code, "add_vector_layer": self.add_vector_layer, "add_raster_layer": self.add_raster_layer, "get_layers": self.get_layers, "remove_layer": self.remove_layer, "zoom_to_layer": self.zoom_to_layer, "get_layer_features": self.get_layer_features, "execute_processing": self.execute_processing, "save_project": self.save_project, "render_map": self.render_map, "create_new_project": self.create_new_project, }
- Helper method in the socket client that forwards the 'get_qgis_info' command to the QGIS plugin server.def get_qgis_info(self): """Get QGIS information""" return self.send_command("get_qgis_info")