article
README
🚀 Daft.ie MCP 服务器
这是一个 MCP(模型上下文协议)服务器,专为与 Daft.ie 交互而设计,主要用于通过网页抓取搜索租赁房产信息。
🚀 快速开始
本项目可帮助你通过网页抓取的方式,基于 Daft.ie 搜索租赁房产信息。以下是快速启动项目的步骤:
✨ 主要特性
- 搜索租赁房产:可根据位置、价格范围、卧室数量和房产类型等各种标准搜索租赁房源。此工具采用网页抓取技术。
- 获取租赁房产详情:尝试使用唯一 ID 检索特定租赁房产的详细信息。
⚠️ 重要提示
此工具依赖 Daft.ie 官方 API(v3),需要 API 密钥。如果没有有效的密钥(通过
DAFT_API_KEY环境变量设置),该工具可能会失败。有关更多详细信息和 Daft.ie API 文档链接,请参考src/daftApi.ts。
📦 安装指南
- 克隆仓库:
git clone [YOUR_GITHUB_REPO_URL]
cd daft-ie-mcp
- 安装依赖:
npm install
- 构建服务器:
npm run build
- 测试(可选但推荐): 本项目使用 Vitest 进行单元测试。运行测试命令如下:
npm test
以监视模式运行测试:
npm run test:watch
- 配置 MCP 设置:
将以下配置添加到你的 MCP 设置文件中(例如
~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json):
{
"mcpServers": {
"daft-ie-mcp": {
"command": "node",
"args": ["~/daft-ie-mcp/build/index.js"],
"env": {},
"disabled": false,
"alwaysAllow": []
}
}
}
💻 使用示例
基础用法
MCP 服务器配置并运行后,你可以使用以下工具:
use_mcp_tool,其中server_name为"daft-ie-mcp",tool_name为"search_rental_properties"use_mcp_tool,其中server_name为"daft-ie-mcp",tool_name为"get_rental_property_details"
示例:搜索都柏林的租赁房产
<use_mcp_tool>
<server_name>daft-ie-mcp</server_name>
<tool_name>search_rental_properties</tool_name>
<arguments>
{
"location": "Dublin",
"min_price": 1000,
"max_price": 2000,
"num_beds": 2
}
</arguments>
</use_mcp_tool>
高级用法
示例:获取特定房产的详细信息
<use_mcp_tool>
<server_name>daft-ie-mcp</server_name>
<tool_name>get_rental_property_details</tool_name>
<arguments>
{
"property_id": "1234567"
}
</arguments>
</use_mcp_tool>
微信扫一扫