Skip to main content
Glama
awheeler262
by awheeler262

Quantum GIS (QGIS) MCP

This project explores ways to interact with QGIS using the QGIS MCP Plugin and an MCP Server.

  1. Install QGIS MCP Plugin.

  2. Set configuration to start MCP server on start-up.

  3. Configure Claude as directed, mostly. Best to add -s user to the bash command.

    claude mcp add qgis -s user -- uvx --from https://github.com/nkarasiak/qgis-mcp/archive/refs/tags/v0.11.0.zip qgis-mcp-server
  4. Ask Claude to ping QGIS.

Architecture

The architecture described through key files and classes.

app/main.py
  |-- app/domain/claude_mcp/service.py
      ClaudeMCP -- Chat loop 
     |-- app/clients/claude.py
         Claude <-------------------Claude API------------------> LLM
     |-- app/clients/qgis_mcp.py
         QgisMcpClient <-stdio-> subprocess qgis_mcp.server <---> QGIS MCP Plugin Server

Test with:

uv run pytest -v

Run with:

uv run python -m app.main

Future

  • Consider running the entire application on an AWS EC2.

    • Easily see use cases with times that exceed maximum Lambda timeout.

    • Consider FastAPI for REST endpoints.