MCP-RasterAgent
A Python MCP (Model Context Protocol) agent for analyzing and cropping local GeoTIFF files by file path. Integrates seamlessly with Claude Desktop and other MCP-compatible systems.
GitHubスター
0
ユーザー評価
未評価
フォーク
0
イシュー
0
閲覧数
0
お気に入り
0
MCP-RasterAgent
A Python Model Context Protocol (MCP) agent for analyzing and cropping local GeoTIFF files by file path and saving the cropped file as PNG then calculating NDVI Mean and for the given points as X,Y coordinates.
Integrates seamlessly with Claude Desktop and other MCP-compatible systems.
Features
- Analyze local GeoTIFF files: extract bounding box, metadata, color band info, and EPSG code.
- Crop GeoTIFFs by bounding box and export as PNG.
- MCP Native: Runs as a
stdioMCP agent for direct Claude Desktop integration. - No file upload: Works directly with files on disk—ideal for desktop or secure environments.
(Note: Because Claude Desktop doesn't support TIFF uploads, this agent uses file paths instead of uploads.) - Extensible: Easy to add more geospatial tools.
Requirements
- Python 3.8+
- GDAL Python bindings
- modelcontextprotocol (mcp) Python SDK
pip install "mcp[cli]" - Claude Desktop (optional, for GUI workflow)
- PostgreSQL/PostGIS (optional, if saving metadata in a database)
- Project scripts:
main.py,funcs_pool.pyetc.
Installation
Clone the repository
git clone https://github.com/yourusername/MCP-RasterAgent.git cd MCP-RasterAgent(Recommended) Create and activate a conda environment
conda create -n geotiff_mcp python=3.10 gdal conda activate geotiff_mcpInstall Python dependencies
pip install "mcp[cli]" pip install psycopg2-binary # Only if you use PostGIS
Usage
Claude Desktop Integration
- Make sure
main.pyandfuncs_pool.pyare present in your project folder. - In Claude Desktop, click the menu (bars) at the top left, select File > Settings, and in the Developer section edit your
claude_desktop_config.json. - Copy the sample config JSON file provided in this repository into your configuration.
- Restart Claude Desktop.
You’ll see “MCP-RasterAgent” available as an agent/tool with two functions. - When prompted, enter the full local file path to your
.tifor.tifffile.
Note:
You don’t have to run python main.py manually—Claude Desktop handles launching the agent via stdio.
If you want to use HTTP transport (for custom integrations), you can run the code directly and configure the agent accordingly.