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 | 数据中心 |
签名步骤:
- 将
secret, thirdtimestamp, thirdCuId, thirdUserId, thirdDc, apiPath字典序排序后拼接 - 做 SHA1 hex,写入请求头
djthirdsign apiPath不含 host 与 query(如broker/roomListing/listStatus)- URL 仅带
?djrqformat=pcjson,无需 Bearer Token
测试
pytest
Release files for erp-property-mcp 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| erp_property_mcp-1.0.0.tar.gz | 24.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| erp_property_mcp-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.8 kB
Release files / erp_property_mcp-1.0.0.tar.gz
| Download URL | erp_property_mcp-1.0.0.tar.gz |
|---|---|
| Size | 24.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0342864693360635b4d45b992b95c53c8ec8f4cd29964b2e4412b8fbf48981a2
|
|
BLAKE2b-256 checksum How to use checksums |
cbd113f7f57e9affe4440201d587ba3d4be812cd062fe20192de8cc46cccffb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / erp_property_mcp-1.0.0-py3-none-any.whl
| Download URL | erp_property_mcp-1.0.0-py3-none-any.whl |
|---|---|
| Size | 24.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1efc49c151a34b927746f083610d2b22afd8e2765011ba2f4fe753c884188f36
|
|
BLAKE2b-256 checksum How to use checksums |
c636b0b632ec14426873bf96f7709ed604f73e915e8bf8d20b7e15f5ace3acfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|