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 dayong@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.txtOr 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! 🗺️