ping
Check server connectivity to verify QGIS MCP server availability and network status for GIS operations.
Instructions
Simple ping command to check server connectivity
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/qgis_mcp/qgis_mcp_server.py:146-151 (handler)MCP tool handler for the 'ping' tool. Proxies the ping command to the underlying QGIS socket server and returns the JSON-formatted response.@mcp.tool() def ping(ctx: Context) -> str: """Simple ping command to check server connectivity""" qgis = get_qgis_connection() result = qgis.send_command("ping") return json.dumps(result, indent=2)
- Core implementation of the ping command in the QGIS MCP socket server, returning a simple pong response.def ping(self, **kwargs): """Simple ping command""" return {"pong": True}
- qgis_mcp_plugin/qgis_mcp_plugin.py:133-149 (registration)Registration of the 'ping' handler (and other commands) in the QGIS MCP socket server's command dispatcher.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 used by the MCP server to send the 'ping' command to QGIS.def ping(self): """Simple ping command to check server connectivity""" return self.send_command("ping")