Skip to main content

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:

  1. get_land_cover: Retrieve land cover data for coordinates with temporal range
  2. get_soil_type: Get FAO soil classification for a location
  3. get_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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: make test-coverage
  5. Run quality checks: make format lint mypy
  6. 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}
}

Release files for landuse-mcp 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for landuse-mcp 0.1.9
File Size Uploaded
landuse_mcp-0.1.9.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for landuse-mcp 0.1.9
File Interpreter ABI Platform
landuse_mcp-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / landuse_mcp-0.1.9.tar.gz

Download URL landuse_mcp-0.1.9.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e3aba9f56ab76b4f63fb079059e3eb9e03af5168d3f39232cae0a19a7175e98e
BLAKE2b-256 checksum
How to use checksums
91904ff9f7611dee06d1f05660d640dd65308d08274c3aa61d1ecb7713874274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.18

Release files / landuse_mcp-0.1.9-py3-none-any.whl

Download URL landuse_mcp-0.1.9-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78a44a3c90b342534ced32e6287edb1d5a9e1b4fdf33f5962a7801670b24e4f8
BLAKE2b-256 checksum
How to use checksums
87658d50347181cda1a60754960b16a7e854e09a6a30938ea15d48b00beb2f40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.18

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page