erp-property-mcp

v1.0.0
erp-property-mcp Checked 8 hours ago Published 2 months ago

鼎尖 ERP 房源 MCP:日同步 SQLite 缓存、图片查询、历史成交

鼎尖 ERP 第三方签名鉴权,同步在售房源 + 近 3 年成交到本地 SQLite,并提供图片与成交查询。 包名:erp-property-mcp(与 uvx erp-property-mcp / console script 一致)。 1. 将 secret, thirdtimestamp, thirdCuId, thirdUserId, thirdDc, apiPath 字典序排序后拼接 2. 做 SHA1 hex,写入请求头 djthirdsign 3. apiPath 不含 host 与 query(如 broker/roomListing/listStatus) 4. URL 仅带 ?djrqformat=pcjson,无需 Bearer Token

Summary extracted from the README.

ERP 房源 MCP(Python / uvx)

鼎尖 ERP 第三方签名鉴权,同步在售房源 + 近 3 年成交到本地 SQLite,并提供图片与成交查询。

安装与运行

开发

cd mcp/erp-property-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp -n .env.example .env
# 编辑 .env 填入 ERP_*
python -m erp_property_mcp

用户侧(推荐 uvx)

先发布到 PyPI,再:

uvx erp-property-mcp

发布到 PyPI

pip install -U build twine
python -m build
twine upload dist/*

包名:erp-property-mcp(与 uvx erp-property-mcp / console script 一致)。

MCP Tools

Tool 说明
sync_erp_listings 全量同步在售房源 + 近3年成交;force 强制重拉
get_erp_listing_sync_status 当日/最近同步日志(含成交)
search_erp_listings 查本地在售库(默认 auto_sync)
get_erp_listing_status_counts 远程 listStatus 计数
get_erp_listing_images 按房源 ID/编号查图片(报告插图)
search_erp_deals 按小区查本地历史成交(房号已脱敏)

鉴权说明

环境变量:

变量 对应第三方参数 说明
ERP_BASE_URL - 如 https://p.dingjianyun.com/dingjian/
ERP_SECRET secret 第三方 secret
ERP_CU_ID thirdCuId 控制单元
ERP_USER_ID thirdUserId 用户
ERP_DC thirdDc 数据中心

签名步骤:

  1. 将 secret, thirdtimestamp, thirdCuId, thirdUserId, thirdDc, apiPath 字典序排序后拼接
  2. 做 SHA1 hex,写入请求头 djthirdsign
  3. apiPath 不含 host 与 query(如 broker/roomListing/listStatus)
  4. URL 仅带 ?djrqformat=pcjson,无需 Bearer Token

测试

pytest