Skip to main content
Glama

Microfarm MCP

为潜在小型农户准备的土地可行性情报 —— 一个免费、开源的 MCP 服务器,可接入 Claude、Cursor 或任何支持 MCP 的 AI,用来回答关于一块土地真正值得关心的两个问题:

  1. 这块地真的适合种粮食吗?

  2. 我能合法地在上面盖房子吗?

……并帮你抢先找到真正在售的土地,再去评估。

为土地的守护者而生的工具,而不是为投机者。

License: MIT Python 3.10+ CI tests


这个项目为何存在

每个人都应该拥有土地——因为这才是真正让你富起来的东西。 不是钱,不是好车——而是你可以耕种、可以滋养、可以让它增值的土地; 一片能养活你、你的家庭、你的邻居,养得起你的社区的土地; 一片能喂养动物并长久维系生命的土地。

——这就是这个项目存在的原因

房地产市场上,大多数对土地的运作是投机。这个工具是为那些想要一块地,用来拥有、居住、照料的人准备的——有水、有表土、有一个可用可作的季节,以及一个关于他们是否真的被允许在上面建造的诚实回答。它不靠猜:每一个信号都来自具体的公共数据源;只要它不知道,就会如实标出来,绝不会凭空编造。

在美国、法国和塞浦路斯都可使用, 并且只需 Open-Meteo + OSM 有数据的地方,都能为土地打分。不同国家具体能获得的信息不相同,所以下面是一份如实的说明:

Related MCP server: Plantos MCP Server

国家/地区覆盖

国家/地区

土地打分(使用方法 assess_land)

查找在售土地(find_land)

洪水 / 是否可建住宅检查

美国

有 ✅ 完整的气候 + 水源机 + 农田 + 土地类型

✅ farms.com + Craigslist(实时)

✅ FEMA 洪积泛区

塞浦路斯

✅ 完整

✅ index.cy(实时;希腊语/英语标题)

⚠️ 无洪水数据——会标注"请与规划部门确认"

法国

✅ 完整

🔜 需要浏览器(leboncoin.fr、offer.com.cy)——尚未爬取

⚠️ 无洪水数据——会标注"请与市政府/省农业厅确认"

其他所有地区(只要 Open-Meteo + OSM 有数据)

✅ 气候、水源、农田、土地类型、道路可达性

❌ 未接入挂牌源

⚠️ 无洪水数据

标记说明: ✅ = 目前可用 · ⚠️ = 能用,但会如实标注"需自行向当地确认" · 🔜 = 已经登记,但需要浏览器(见 land_sources.browser_only)

哪些是全球通用,哪些分国家/地区:

  • **全球通用(几乎任何地方都能工作):**气候(降水、生长季、耐寒性)、水体、农田、土地类型、道路/可达性——这正是 assess_land 的评分依据,使用 Open-Meteo 与 OpenStreetMap,两者都覆盖全球。

  • 国家/地区特有: find_land 的挂牌源来自各个国家的站;洪泛区来自 FEMA(仅美国)——所以“房子是否在洪泛区”这项检查实际上只在单一美国适用;在全世界其他地区,它会诚实地说“请与当地规划部门确认”,而不是靠猜。

工具

工具

一句话说明

assess_land

评估一套地块的微型农场可行性;也评估住宅可行性——包含降水、生长季、水源条件、农田背景、土地类型、树木覆盖、周边邻居/隐私、土壤(肥力、pH、质地 → 地下水补充)、可达性、洪泛区状态。并且返回一个值得考虑 / 需要进一步看 / 大概率不匹配的结论。

find_land

从免费来源中筛选出在售的真实土地,包含价格、面积、照片、描述、位置——还可以用 country(国家)/state(州/省)进行过滤。

zone

解释一个规划分区代码,并告诉你在农田上是否可以建住宅——适用于法国(A/U/AU/N + STECAL/扩缩规则、“logement de fonctions”条件)、塞浦路斯(Γη3/ΚΑ6/H2)、以及美国(农业区几个)

land_sources

列出我们所用的免费公共数据源及其许可证(保持透明性和说明来源)。

about_microfarm

用通俗易懂的话解释选择地块时需要看重哪些点。

所有结论都有依据:每一条信号都记录来源,缺失的数据也会如实标为“缺失”——绝不会因为“无法获得”就当作“很好很好”。

快速开始

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)

连接到 Claude / Cursor / OpenCode / Gemini / 任意 MCP 客户端

Microfarm 是标准 MCP 服务器,因此任何支持 MCP 的工具都可以直接使用。具体配置方法取决于客户端:

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(仓库内)或 ~/.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(内置的 Copilot MCP / 扩展)—— .vscode/mcp.json:

{
  "servers": {
    "microfarm-mcp": {
      "type": "stdio",
      "command": "python3",
      "args": ["-m", "microfarm.server"],
      "env": { "PYTHONPATH": "/absolute/path/to/microfarm-mcp" }
    }
  }
}

关于 ChatGPT 的说明。 ChatGPT 只支持使用 HTTPS 远程服务器来接入 MCP,而且这种能力目前只限制在 Business / Enterprise 计划中。一个本地 stdio 服务器,也就是本仓库默认的运行方式,不能直接被 ChatGPT 使用。要在 ChatGPT 里使用,你需要把服务器放到远程,并给 ChatGPT 一个 HTTPS URL——这是一个真实集成步骤,不是一行配置就能完成的。用于本地使用,Claude、Cursor、OpenCode 或 Gemini CLI 是最方便的路径。

然后,直接告诉你的助手,比如:

"佐尔多涅的这块地适合做小农场吗?我能在上面造房子吗?"

"帮我找帕福斯区 €15万以下的土地信息,看看哪几块值得去一趟。"

结果长什么样

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

数据来源与版权说明

以下就是我们每一个答案背后的免费、且无需 key 的公共数据源。如果要把本项目或其数据用在你自己的作品或研究中,请注明以下来源——其中几个来源按许可证要求必须保留署名。

数据源

提供内容

许可证 / 署名要求

Open-Meteo 地理编码

地名 → 经纬度、海拔

CC BY 4.0

Open-Meteo 历史气候

降水、气温、种植天数

CC BY 4.0

Open-Meteo 海拔

地表海拔

CC BY 4.0

ISRIC SoilGrids

表层土壤:有机碳、pH、粘土/砂/粘汤质地、CEC

CC BY 4.0

OpenStreetMap,通过 Overpass API

水系、建筑物、道路、农田、树木

ODBL

FEMA 国家洪泛危害层

点位的洪洗泛范围(仅美国)

美国联邦公有领域(数据),FEMA 提供的 ArcGIS 服务

farms.com

美国农场/土地挂牌(find_land)

网站内容归自己所有;我们提供指向该页面的链接

Craigslist

美国的个人挂土地源(find_land)

网站内容归其所有;我们提供指向该页面的链接

index.cy

塞浦路斯地块/土地挂牌(find_land)

网站内容归其所有;我们提供指向该页面的链接

Open-Meteo 相当于一个各国气象服务的聚合者;其 API 采用 CC BY 4.0 许可,客人心存感激地使用。
OpenStreetMap 的数据来自 © OpenStreetMap 贡献者,许可证为 开放数据库许可。挂牌内容都归各个市场所有——我们只是通过链接把他们已有的页面展示出来,不会重新托管他们的图片。

土地类型、用地分区以及“我能在上面建住宅吗?”这个问题

  • 土地类型(农田/牧场/林地/灌丛/已建区/水岸)和树冠覆盖都从 OpenStreetMap 中获取,并在每次评估中报告。

  • 官方规划分区——你合法地在土地上能建造什么、能做什么——是通过没有免费的国立地理数据获得的。这些是由当地规划部门(美国各县、塞浦鲁斯规划局、法国市政府/省农业部门)制定的,记录在将土地证书/地籍/PLU 信息里,而且这些信息并不对外免费开放接口。zone 这个工具的作用是把常见代码(比如法国的 A/U/N、塞浦路斯的 Γη/ΚΑ、美国的农业区域)和常见的建筑规则解释清楚——也包含了农场住房 / 功能住房(logement de fonction)时的具体要求——并明确告诉你应该向当地规划部门确认哪些信息。只能作为指南,永远不能替代官方记录。

坦诚的局限

  • 分区/住宅法律是地方性的。 该工具基于公共数据(洪水+农田背景)进行初步筛查;它不能替代官方法规。请务必亲自核实并咨询当地官员。

  • 洪水数据仅限美国(FEMA)。在美国以外,系统会如实报告为不可用——绝不会虚假地显示"无风险"。

  • 部分房源网站受浏览器限制(landbanksearch、govdeals、farmflip、Bazaraki、land.cy、offer.com.cy、leboncoin.fr)。它们已注册但尚未抓取;land_sources 显示了可访问与仅限浏览器之间的边界。

  • 地理区域名称如"Limousin"(2016年废除)可能无法地理编码——请使用当前的城镇或地区。

  • 希腊语房源标题会进行基本的逐词翻译;生僻地名可能保留希腊语。

开发

.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 在 Python 3.10 / 3.11 / 3.12 上运行 lint、格式化、类型检查、测试和包构建。

项目结构

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

许可证与免责声明

MIT 许可——您可以自由使用、修改和分享。

这不是财务、法律或房地产建议。 在依赖任何信息之前,请务必亲自核实房产并咨询当地规划部门。数据来自上述免费公共来源,可能不完整或有缺陷。

Available Tools

5 tools
about_microfarmA

Plain-language explanation of what a micro-farm is and what to look for in land.

Inputs: text (required).

assess_landA

Assess a US parcel for small-scale (micro) farming viability AND whether a dwelling is likely feasible there.

Provide a place name/address like 'Petaluma, California' or 'Lamoille County, VT', OR explicit lat/lon. Uses free public data (Open-Meteo climate + geocoding + elevation, OpenStreetMap land/water/roads/farmland, FEMA flood zones) to score precipitation, growing season, water access, farmland context, access, and dwelling feasibility. Every signal lists its source; missing data is flagged.

Inputs: lat, lon, place. Returns: data, score, state, signals, +4 more

find_landA

Find real land for sale from free, accessible online sources (farms.com, Craigslist, and index.cy for Cyprus), optionally filtered by country/state/price/acreage. Each listing includes price, land size, location, and photo URLs where available.

Examples: find_land(country="CY") → Cyprus plots from index.cy (Greek & English listings, titles translated). find_land(state="OH") → US farms. Free, no key. Browser-only sources are listed in browser_only_sources.

Inputs: limit, state, county, country, +3 more.

land_sourcesA

List the free, keyless public data sources this server uses (transparency).

Inputs: no named parameters.

zoneA

Explain a planning-zone code and what it means for building a dwelling on farmland, for Cyprus (e.g. 'Γη3', 'ΚΑ6', 'H2'), France ('A', 'U', 'AU', 'N'), or the US ('A' agricultural district). Includes the specific conditions for a 'farm dwelling' / logement de fonction.

Planning law is local: exact density, min size and build conditions come from the Local Plan / zoning ordinance and title deed. This is a guide that tells you the general logic and exactly what to confirm — never a substitute for the official source.

Inputs: code (required), country.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: assessing viability, finding listings, explaining zoning codes, listing data sources, and providing background education. There is no practical overlap that would confuse an agent.

    Naming Consistency3/5

    The naming is readable and uniform in style with underscores, but it mixes conventions: assess_land and find_land follow verb_noun, while zone, land_sources, and about_microfarm are noun or prepositional style. The inconsistency is noticeable but not chaotic.

    Tool Count5/5

    Five tools is a well-scoped set for a specialized micro-farm research server. Each tool addresses a distinct part of the domain without redundancy or bloat.

    Completeness5/5

    The tool set covers the full user journey: learning about micro-farming, seeing available land, assessing a specific parcel, and understanding zoning implications. It also includes transparency about data sources, leaving no obvious dead ends.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Instant U.S. property intelligence for AI agents. Zoning, Buildability™ Score, ADU eligibility, flood risk, and more from 20+ government sources. Pay-as-you-go: $5 per analysis (prepaid credits). Free Score available at buildability.us. Get a key at buildability.us/api.
      5
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to access free, open agronomic data for field briefings, spray windows, water balance, pest pressure, and more, using only public data sources without API keys.
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides free property and parcel intelligence using official US government data APIs, county assessor records, and live listings, with tools for hazard risk checks, affordability calculations, and parcel ranking.
      1
      -