An MCP for retrieving land use data for a given location
Project description
landuse-mcp
A Model Context Protocol (MCP) server for retrieving land use data for given geographical locations using the National Land Cover Database (NLCD) and other geospatial datasets.
Features
- Land Cover Data: Retrieve detailed land cover classifications for any coordinate
- Soil Type Information: Get FAO soil type classifications for geographical points
- Temporal Data: Access available dates for land use data at specific locations
- MCP Integration: Full Model Context Protocol support for AI agents
- Geospatial Processing: Built on robust geospatial libraries for accurate data retrieval
Quick Start
# Install dependencies and set up development environment
make dev
# Run the MCP server
make server
# Run tests
make test-coverage
# Demo functionality
make demo
Installation
From PyPI (Recommended)
# Install with uvx
uvx landuse-mcp
From Source
# Clone the repository
git clone https://github.com/justaddcoffee/landuse-mcp.git
cd landuse-mcp
# Install in development mode
make dev
Usage
Command Line Interface
# Run the MCP server
landuse-mcp
# Or using uv
uv run landuse-mcp
Python API
from landuse_mcp.main import get_land_cover, get_soil_type, get_landuse_dates
# Get land cover data for Death Valley
land_cover = get_land_cover(36.5322649, -116.9325408, "2001-01-01", "2002-01-01")
print(land_cover)
# Get soil type for a location
soil_type = get_soil_type(32.95047, -87.393259)
print(soil_type) # e.g., "Cambisols"
# Get available dates for land use data
dates = get_landuse_dates(36.5322649, -116.9325408)
print(dates) # List of available dates
Testing MCP Protocol
# Test MCP handshake
make test-mcp
# Extended MCP testing
make test-mcp-extended
Integration with AI Tools
Claude Desktop
Add this to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"landuse-mcp": {
"command": "uvx",
"args": ["landuse-mcp"],
"cwd": "/path/to/landuse-mcp"
}
}
}
Claude Code
claude mcp add -s project landuse-mcp uvx landuse-mcp
Goose
goose session --with-extension "uvx landuse-mcp"
Available Tools
The MCP server provides three main tools:
get_land_cover: Retrieve land cover data for coordinates with temporal rangeget_soil_type: Get FAO soil classification for a locationget_landuse_dates: List available dates for land use data at coordinates
Data Sources
- National Land Cover Database (NLCD): Primary source for US land cover data
- FAO Soil Types: Global soil classification system
- nmdc-geoloc-tools: Underlying geospatial processing library
Development
Development Setup
# Full development setup
make dev
# Install production dependencies only
make install
# Run tests with coverage
make test-coverage
# Code quality checks
make format lint mypy
# Check for unused dependencies
make deptry
# Clean build artifacts
make clean
Build and Release
# Build package
make build
# Upload to TestPyPI
make upload-test
# Upload to PyPI
make upload
# Complete release workflow
make release
Testing
# Run all tests
make test-coverage
# Run integration tests
make test-integration
# Test MCP protocol
make test-mcp test-mcp-extended
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
make test-coverage - Run quality checks:
make format lint mypy - Submit a pull request
Requirements
- Python 3.10+
- uv (recommended)
- Dependencies managed via
pyproject.toml
License
MIT License - see LICENSE file for details.
Authors
- Mark Miller
- Justin Reese
- Charles Parker
Citation
If you use this software in your research, please cite it as:
@software{landuse_mcp,
title = {landuse-mcp: A Model Context Protocol server for land use data},
author = {Miller, Mark and Reese, Justin and Parker, Charles},
url = {https://github.com/justaddcoffee/landuse-mcp},
version = {0.1.0},
year = {2024}
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file landuse_mcp-0.1.8.tar.gz.
File metadata
- Download URL: landuse_mcp-0.1.8.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb66e4bc7941c6dbc59eddb625ed4dcd91288e1aac5636055d670da8f00027b5
|
|
| MD5 |
31dfd915dd1ac033187f004f673527e6
|
|
| BLAKE2b-256 |
ac2f97d9add59bf101250e990a77f9856adbf3a0d5bd1fec673ffecbf1e7e575
|
File details
Details for the file landuse_mcp-0.1.8-py3-none-any.whl.
File metadata
- Download URL: landuse_mcp-0.1.8-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f64cbcb80b5e7ed0fd93bafbcf45c847c85776df4effa1687c73ad4f88cb334
|
|
| MD5 |
9168e62c0bfa7e60a22807c34d07c0bf
|
|
| BLAKE2b-256 |
337b2b9bc479dcc80dc8aa88d9bc63c24cee16560ee6c5d0dbae6488dcb3c2ac
|