dkudom/QGIS-MCP-Server
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.
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
-
Clone the repository:
git clone https://github.com/yourusername/babma-maps-qgis-mcp.git cd babma-maps-qgis-mcp
-
Install dependencies:
pip install -r requirements.txt
Or run the setup script (Windows):
setup_mcp.bat
-
Test the MCP server:
python qgis_shapefile_mcp.py
π§ Cursor AI Integration
To use this MCP server with Cursor AI:
-
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" } } }
-
Restart Cursor AI
-
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:
Tool | Description |
---|---|
read_shapefile | Analyze shapefile structure and properties |
create_shapefile | Create new shapefiles with custom schema |
query_shapefile | Query features with attribute filters |
get_shapefile_info | Extract detailed shapefile metadata |
add_layer_to_qgis | Add 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
- Fork the repository
- Create a feature branch
- Make your changes
- Test the MCP server
- 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:
- Check the
- Verify dependencies are installed
- Test the MCP server independently
- Check Cursor AI MCP server logs
π Transform your GIS workflow with AI-powered spatial analysis! πΊοΈ