microfarm-mcp
Enables AI assistants to assess any parcel for micro-farm viability (climate, water, farmland context, access, flood risk) and dwelling feasibility, and to find real land for sale from free, keyless public data sources.
README
<div align="center">
Microfarm MCP
Land-viability intelligence for would-be small farmers — a free, open-source MCP server that plugs into Claude, Cursor, or any MCP-capable AI to answer the two questions that matter about a piece of land:
- Is this plot actually good for growing food?
- Can I legally put a home on it?
…and finds real land for sale to score in the first place.
A tool for stewards, not speculators.
</div>
Why this exists
Everyone should own land — because this is what will make you rich. Not money, not nice cars — but land you can cultivate, grow, and enrich; land that provides for you and your family, your neighbours, and your community; land that feeds animals and sustains life.
— the reason this project exists
Most of what the real-estate market does with land is speculating on it. This tool is for the people who want a piece of ground to own, live on, and care for — water, topsoil, a workable season, and the honest answer about whether they're actually allowed to build on it. It does not guess: every signal comes from a named public source, and anything it can't know is flagged, never invented.
Works in the US, France, and Cyprus — and scores land anywhere Open-Meteo + OSM have data. Exactly what's available differs by country, so here's the honest picture:
Country coverage
| Country | Score land (assess_land) |
Find land for sale (find_land) |
Flood / dwelling check |
|---|---|---|---|
| United States | ✅ full climate + water + farmland + land-type | ✅ farms.com + Craigslist (live) | ✅ FEMA flood zone |
| Cyprus | ✅ full | ✅ index.cy (live; Greek/English titles) | ⚠️ no flood data — flags "confirm with planning authority" |
| France | ✅ full | 🔜 browser-locked (leboncoin.fr, offer.com.cy) — not yet scraped | ⚠️ no flood data — flags "confirm with mairie/DDT" |
| Everywhere else (anywhere Open-Meteo + OSM have data) | ✅ climate, water, farmland, land-type, access | ❌ no listing source wired | ⚠️ no flood data |
Verdict legend: ✅ = works now · ⚠️ = works, with an honest "confirm locally"
note · 🔜 = registered but needs a browser (see land_sources.browser_only)
What's global vs. country-specific:
- Global (works almost anywhere): climate (precipitation, growing season,
hardiness), water features, farmland, land type, roads/access — this is what
assess_landscores, and it uses Open-Meteo + OpenStreetMap, both worldwide. - Country-specific:
find_landlistings come from per-country sites; flood zones come from FEMA, which is US-only — so the dwelling-flood check really only applies to the US, and elsewhere it honestly says "confirm with your local planning authority" rather than guessing.
Tools
| Tool | What it does |
|---|---|
assess_land |
Scores a parcel for micro-farm viability and dwelling feasibility — precipitation, growing season, water access, farmland context, land type, tree cover, neighbours/privacy, soil (fertility, pH, texture → well-recharge), access, flood zone. Returns an evidence-backed promising / requires_look / likely_mismatch verdict. |
find_land |
Finds real land for sale from free sources with price, size, photos, description, location — and a country/state filter. |
zone |
Explains a planning-zone code and whether a dwelling is allowed on farmland — for France (A/U/AU/N + STECAL/extension rules, "logement de fonction" conditions), Cyprus (Γη3/ΚΑ6/H2), and the US (agricultural districts). |
land_sources |
Lists the free public data sources + licenses used (transparency & attribution). |
about_microfarm |
Plain-language explanation of what to look for in land. |
Everything is evidence-backed: each signal names its source, and missing data is reported as missing — never treated as "good."
Quickstart
git clone https://github.com/omardaaboul/microfarm-mcp.git
cd microfarm-mcp
python3 -m venv .venv
.venv/bin/pip install -e ".[test]"
.venv/bin/microfarm-mcp # start the server (stdio)
Connect it to Claude / Cursor / OpenCode / Gemini / any MCP client
Microfarm is a standard MCP server, so any tool that supports MCP can use it. The exact setup depends on the client:
Claude Desktop — claude_desktop_config.json:
{
"mcpServers": {
"microfarm-mcp": {
"command": "python3",
"args": ["-m", "microfarm.server"],
"env": { "PYTHONPATH": "/absolute/path/to/microfarm-mcp" }
}
}
}
Claude Code — claude mcp add:
claude mcp add microfarm-mcp -- python3 -m microfarm.server
Cursor — .cursor/mcp.json:
{
"mcpServers": {
"microfarm-mcp": {
"command": "python3",
"args": ["-m", "microfarm.server"],
"env": { "PYTHONPATH": "/absolute/path/to/microfarm-mcp" }
}
}
}
OpenCode — opencode.json (repo) or ~/.config/opencode/config.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"microfarm-mcp": {
"type": "local",
"command": ["python3", "-m", "microfarm.server"],
"cwd": "/absolute/path/to/microfarm-mcp",
"enabled": true,
"timeout": 10000
}
}
}
Gemini CLI — ~/.gemini/settings.json:
{
"mcpServers": {
"microfarm-mcp": {
"command": ["python3", "-m", "microfarm.server"],
"env": { "PYTHONPATH": "/absolute/path/to/microfarm-mcp" }
}
}
}
VS Code (built-in Copilot MCP / extension) — .vscode/mcp.json:
{
"servers": {
"microfarm-mcp": {
"type": "stdio",
"command": "python3",
"args": ["-m", "microfarm.server"],
"env": { "PYTHONPATH": "/absolute/path/to/microfarm-mcp" }
}
}
}
A note on ChatGPT. ChatGPT supports MCP only as a remote HTTPS server, and that capability is currently limited to Business/Enterprise plans. A local
stdioserver (what this repo runs by default) cannot be plugged into ChatGPT directly. To use it in ChatGPT you'd need to host the server remotely and give ChatGPT its HTTPS URL — a real step, not a config tweak. For local use, Claude, Cursor, OpenCode, or Gemini CLI are the simple paths.
Then just ask your assistant:
"Is this plot in Dordogne good for a small farm, and can I build a house on it?"
"Find me land under €150k in Paphos District and tell me which looks worth a visit."
What the results look like
assess_land("Polemi, Paphos, Cyprus")
→ promising | 75
[positive] adequate_precipitation: ~426 mm/yr
[positive] long_season: ~363 growing days/yr
[positive] water_access: 5 water feature(s) nearby
[positive] farmland: 27 farm land tag(s) nearby
[caution] land_type: built-up
[caution] tree_cover: little/no mapped tree cover
[caution] privacy: 23 structures nearby
[positive] soil_fertility: ~42 g/kg organic carbon
[caution] soil_ph: pH ~7.8
[caution] well_recharge: ~33% clay / ~23% sand
[positive] access: 158 road segment(s) nearby
zone("A", "France") → explains agricultural zone + when a dwelling is allowed
zone("Γη3", "Cyprus") → agricultural zone, min ~4,000m² for one rural dwelling
Data sources & attribution
These are the free, keyless public sources behind every answer. When you use this project or its data in your own work, please credit the sources below — several require attribution by license.
| Source | What it provides | License / attribution |
|---|---|---|
| Open-Meteo Geocoding | place name → lat/lon, elevation | CC BY 4.0 |
| Open-Meteo Historical Climate | precipitation, temperature, growing days | CC BY 4.0 |
| Open-Meteo Elevation | surface elevation | CC BY 4.0 |
| ISRIC SoilGrids | topsoil: organic carbon, pH, clay/sand/silt texture, CEC | CC BY 4.0 |
| OpenStreetMap via Overpass API | water features, buildings, roads, farmland, trees | ODbL |
| FEMA National Flood Hazard Layer | flood zone at a point (US only) | US federal, public domain (data), ArcGIS service by FEMA |
| farms.com | US farm/land listings (find_land) | site content is theirs; we link to listings |
| Craigslist | US land by-owner listings (find_land) | site content is theirs; we link to listings |
| index.cy | Cyprus plots/land listings (find_land) | site content is theirs; we link to listings |
Open-Meteo aggregates national weather services; its API is licensed CC BY 4.0 and we gratefully use it. OpenStreetMap data is © OpenStreetMap contributors under the Open Database License. Listing content belongs to the respective marketplaces — we surface and link through to their pages, never re-host their images.
Land type, zone & the "can I build a dwelling here?" question
- Land type (farmland / pasture / forest / scrub / built-up / waterfront) and tree cover are detected from OpenStreetMap and reported in every assessment.
- Official zoning — what you're legally allowed to build or do on land — is
not available from free national data. It's set by local planning authorities
(US county, Cyprus Planning Authority, French mairie/DDT), and recorded on title
deeds / cadastres / PLU documents that aren't freely machine-queryable. The
zonetool explains the codes (FranceA/U/N, CyprusΓη/ΚΑ, US agricultural districts) and their usual building rules — including the specific conditions for a farm dwelling / logement de fonction — and tells you exactly what to confirm with the local authority. It is a guide, never a substitute for the official record.
Honest limits
- Zoning / dwelling law is local. This tool is an initial screen from public data (flood + farmland context); it does not replace the official ordinance. Always verify in person and with local officials.
- Flood data is US-only (FEMA). Outside the US it's honestly reported as unavailable — never falsely "no hazard."
- Some listing sites are browser-locked (landbanksearch, govdeals, farmflip,
Bazaraki, land.cy, offer.com.cy, leboncoin.fr). They're registered but not yet
scraped;
land_sourcesshows the boundary of what's reachable vs. browser-only. - Geo-region names like "Limousin" (abolished in 2016) may not geocode — use a current town or district.
- Greek listing titles get a basic word-level translation; obscure place names may stay in Greek.
Development
.venv/bin/ruff check microfarm tests # lint
.venv/bin/ruff format --check microfarm tests
.venv/bin/mypy microfarm # type-check
.venv/bin/pytest tests/ -q # 43 tests (mocked providers, deterministic)
CI runs lint, format, type-check, tests, and a package build on Python 3.10 / 3.11 / 3.12.
Project layout
microfarm-mcp/
├── microfarm/
│ ├── server.py ← FastMCP server (5 tools)
│ ├── engine.py ← orchestration + cache + find_land
│ ├── providers.py ← free data providers (Open-Meteo, SoilGrids, OSM, FEMA)
│ ├── listings.py ← land-listing collectors (farms.com, Craigslist, index.cy)
│ ├── scorer.py ← evidence-backed viability + dwelling scoring
│ ├── zones.py ← planning-zone explainer (France, Cyprus, US)
│ └── models.py ← typed pydantic models
├── tests/ ← 43 tests
├── configs/ ← ready-to-use MCP client configs (Claude, Cursor,
│ OpenCode, Gemini CLI, VS Code, generic)
├── .github/workflows/ci.yml
└── pyproject.toml
License & disclaimer
MIT licensed — you're free to use, modify, and share it.
This is not financial, legal, or real-estate advice. Always verify a property in person and with the local planning authority before relying on it. Data comes from the free public sources above and may be incomplete or imperfect.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.