QGIS-MCP-Server

dkudom/QGIS-MCP-Server

3.2

If you are the rightful owner of QGIS-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The BABMA Maps - QGIS MCP Server Project provides GIS mapping data and analysis tools for the Bibiani-Anhwiaso-Bekwai Municipal Assembly in Ghana, along with a Model Context Protocol server for AI interaction with QGIS and shapefile data.

Tools
5
Resources
0
Prompts
0

BABMA Maps - QGIS MCP Server Project

πŸ—ΊοΈ Overview

This project contains GIS mapping data and analysis tools for the Bibiani-Anhwiaso-Bekwai Municipal Assembly (BABMA) in Ghana, along with a powerful Model Context Protocol (MCP) server that enables AI assistants to interact with QGIS and shapefile data.

πŸ“Š Project Contents

πŸ—‚οΈ GIS Data

  • Population Maps: 2025 and 2029 population projections
  • Transportation Networks: Road systems and infrastructure
  • Administrative Boundaries: Municipal, regional, and national contexts
  • Development Maps: Existing development and situational analysis
  • Shapefiles: Comprehensive spatial data for BABMA region

πŸ€– MCP Server

A custom Model Context Protocol server (qgis_shapefile_mcp.py) that provides AI assistants with GIS capabilities:

  • πŸ“– Read and analyze shapefiles
  • πŸ› οΈ Create new shapefiles with custom fields
  • πŸ” Query spatial features with filters
  • πŸ“‹ Extract detailed GIS metadata
  • 🎯 Integrate with QGIS projects

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • pip package manager
  • QGIS (optional, falls back to GeoPandas)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/babma-maps-qgis-mcp.git
    cd babma-maps-qgis-mcp
    
  2. Install dependencies:

    pip install -r requirements.txt
    

    Or run the setup script (Windows):

    setup_mcp.bat
    
  3. Test the MCP server:

    python qgis_shapefile_mcp.py
    

πŸ”§ Cursor AI Integration

To use this MCP server with Cursor AI:

  1. Configure Cursor AI (Settings β†’ Features β†’ MCP Servers):

    {
      "qgis-shapefile": {
        "command": "python",
        "args": ["qgis_shapefile_mcp.py"],
        "cwd": "/path/to/your/project",
        "env": {
          "PYTHONPATH": "/path/to/your/project"
        }
      }
    }
    
  2. Restart Cursor AI

  3. Test integration: Ask "Can you list the available MCP tools?"

πŸ“ Directory Structure

BABMA MAPS/
β”œβ”€β”€ qgis_shapefile_mcp.py           # MCP Server
β”œβ”€β”€ requirements.txt                # Python dependencies  
β”œβ”€β”€ mcp_server_config.json         # MCP configuration
β”œβ”€β”€ setup_mcp.bat                  # Windows setup script
β”œβ”€β”€ README_MCP_Setup.md            # Detailed setup guide
β”œβ”€β”€ 
β”œβ”€β”€ SHAPEFILES/                    # Spatial data
β”‚   β”œβ”€β”€ BABMA/                     # Municipal boundaries
β”‚   β”œβ”€β”€ BABMA Towns/               # Settlement data
β”‚   β”œβ”€β”€ BABMA Road/                # Road networks
β”‚   β”œβ”€β”€ Districts/                 # District boundaries
β”‚   └── ...                       # Other spatial datasets
β”œβ”€β”€ 
β”œβ”€β”€ PICTURES/                      # Generated maps (JPG)
β”œβ”€β”€ Layouts/                       # QGIS layout templates
└── Map/                          # QGIS project files

πŸ› οΈ Available Tools

The MCP server provides these tools for AI assistants:

ToolDescription
read_shapefileAnalyze shapefile structure and properties
create_shapefileCreate new shapefiles with custom schema
query_shapefileQuery features with attribute filters
get_shapefile_infoExtract detailed shapefile metadata
add_layer_to_qgisAdd layers to QGIS projects

πŸ’‘ Example AI Interactions

Once configured, you can ask AI assistants:

  • "Analyze all shapefiles in the BABMA project"
  • "What's the coordinate system used in the road data?"
  • "Create a point shapefile for GPS coordinates with elevation data"
  • "Query the towns shapefile for settlements with population > 1000"
  • "What administrative levels are available in this dataset?"

🌍 About BABMA

Bibiani-Anhwiaso-Bekwai Municipal Assembly is located in the Western North Region of Ghana. This project contains comprehensive spatial analysis and mapping data for:

  • Population distribution and projections
  • Transportation infrastructure
  • Administrative boundaries
  • Development planning
  • Regional context mapping

πŸ“– Documentation

  • - Detailed setup instructions
  • - Python dependencies
  • - MCP server config

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test the MCP server
  5. Submit a pull request

πŸ“„ License

This project is open source. Please respect data usage guidelines for the GIS datasets.

πŸ”§ Troubleshooting

  • QGIS not found: The server works in fallback mode with GeoPandas
  • Import errors: Ensure all dependencies are installed
  • Path issues: Check working directory in MCP configuration
  • Permission errors: Verify read/write access to shapefile directories

πŸ“ž Support

For issues or questions:

  1. Check the
  2. Verify dependencies are installed
  3. Test the MCP server independently
  4. Check Cursor AI MCP server logs

πŸš€ Transform your GIS workflow with AI-powered spatial analysis! πŸ—ΊοΈ