README.md-Zillow MCP服务器
一个模型上下文协议(MCP)服务器,提供对Zillow房地产数据的实时访问,使用Python和FastMCP构建。
特性
- 🏠 房产搜索:按位置、价格范围和房产特征搜索房产
- 💰 属性详细信息:获取有关特定房产的详细信息
- 📊 Zestimates:访问Zillow的专有房屋估值数据
- 📈 市场趋势:查看任何地点的房地产市场趋势
- 🧮 按揭计算器:根据各种输入计算抵押贷款付款
- 🔍 健康检查:验证API连接并监控性能
需求
- Python 3.8或更高版本
- Zillow Bridge API密钥(请求访问api@bridgeinteractive.com)
安装
- 克隆此存储库:
git clone https://github.com/rohitsingh-iitd/zillow-mcp-server
cd zillow-mcp-server- 安装依赖项:
pip install -r requirements.txt- 创建一个
.env使用Zillow API密钥文件:
ZILLOW_API_KEY=your_zillow_api_key_here用法
使用以下选项运行服务器:
# Standard stdio mode (for Claude Desktop)
python zillow_mcp_server.py
# HTTP server mode (for remote access)
python zillow_mcp_server.py --http --port 8000
# Debug mode for more verbose logging
python zillow_mcp_server.py --debug您还可以使用Docker运行服务器:
# Build the Docker image
docker build -t zillow-mcp-server .
# Run with environment variables
docker run -p 8000:8000 -e ZILLOW_API_KEY=your_key_here zillow-mcp-server
# Or using an env file
docker run -p 8000:8000 --env-file .env zillow-mcp-server使用Claude Desktop
将Zillow MCP服务器添加到您的Claude Desktop配置文件中:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - 视窗:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"zillow": {
"command": "python",
"args": ["/path/to/zillow_mcp_server.py"]
}
}
}对于远程HTTP服务器:
{
"mcpServers": {
"zillow-remote": {
"command": "npx",
"args": ["mcp-remote", "https://your-mcp-server-url.com/sse"]
}
}
}可用工具
搜索属性
根据各种条件搜索房产:
search_properties(
location: str,
type: str = "forSale",
min_price: Optional[int] = None,
max_price: Optional[int] = None,
beds_min: Optional[int] = None,
beds_max: Optional[int] = None,
baths_min: Optional[float] = None,
baths_max: Optional[float] = None,
home_types: Optional[List[str]] = None
)Claude中的示例用法:
Please search for properties in Seattle with prices between $500,000 and $800,000.获取_属性_详细信息
获取特定房产的详细信息:
get_property_details(
property_id: str = None,
address: str = None
)Claude中的示例用法:
Can you get the details for the property with ID 12345?get_zestimate
获取Zillow对房产的估计价值:
get_zestimate(
property_id: str = None,
address: str = None
)Claude中的示例用法:
What's the Zestimate for 123 Main St, Seattle, WA?获取市场趋势
获取特定地点的房地产市场趋势:
get_market_trends(
location: str,
metrics: List[str] = ["median_list_price", "median_sale_price", "median_days_on_market"],
time_period: str = "1year"
)Claude中的示例用法:
What are the current real estate trends in Boston over the past year?计算器_测距仪
计算抵押贷款和相关费用:
calculate_mortgage(
home_price: int,
down_payment: int = None,
down_payment_percent: float = None,
loan_term: int = 30,
interest_rate: float = 6.5,
annual_property_tax: int = None,
annual_homeowners_insurance: int = None,
monthly_hoa: int = 0,
include_pmi: bool = True
)Claude中的示例用法:
Calculate the monthly mortgage payment for a $600,000 house with 20% down and a 6% interest rate.健康检查
验证Zillow API连接并获取服务器状态:
check_health()Claude中的示例用法:
Please check if the Zillow API is currently responsive.get_server_tools
获取此服务器上所有可用工具的列表:
get_server_tools()Claude中的示例用法:
What tools are available in the Zillow MCP server?资源
以格式化文本资源的形式获取属性信息:
zillow://property/{property_id}以格式化文本资源的形式获取市场趋势信息:
zillow://market-trends/{location}错误处理
服务器通过以下方式实现了稳健的错误处理:
- 具有指数回退的自动重试
- 详细的错误记录
- 费率限制处理
- 连接超时
- 优雅降级
技术细节
此MCP服务器是使用以下方式构建的:
- FastMCP:用于构建模型上下文协议服务器的Python框架
- 请求::用于通过连接池和重试向Zillow Bridge API发出HTTP请求
- 回退:用于实现指数退避重试逻辑
- python dotenv:用于管理环境变量
服务器提供工具(交互功能)和资源(静态数据),Claude可以访问这些工具和资源向用户提供房地产信息。
限制和注意事项
- Zillow的API有使用限制(通常每个数据集每天1000个请求)
- Zillow的服务条款禁止在本地存储数据;所有请求都必须是动态的
- 您必须在用户界面中将数据正确地归因于Zillow
- Bridge API功能可能会随时间变化,需要更新服务器
许可证
此项目根据MIT许可证获得许可-有关详细信息,请参阅许可证文件。
致谢
- Zillow提供桥梁API
- 模型上下文协议规范的拟人化
