属性MCP服务器
通过ATTOM data API将Claude AI连接到房地产数据的最小模型上下文协议服务器。
快速开始
# Install dependencies
pip install -r requirements.txt
# Set up .env file
echo "ATTOM_API_KEY=your_key_here" > .env
# Test the tool
python test_tool.py "1600 Amphitheatre Parkway, Mountain View, CA 94043"
# Run the server (for Claude Desktop)
python -m mcp_server.server建筑
mcp_server/
├── server.py # Entry point
├── tools/
│ └── property_info_tool.py # tool interface
├── services/
│ └── attom_client.py # HTTP client
├── config.py # Environment config
└── utils/
└── errors.py # Exceptions错误处理
错误被捕获并作为结构化JSON响应返回:
{
"error": True,
"message": "ATTOM API error: 400 Bad Request",
"status_code": 400
}- API错误:从ATTOM API响应中解析的HTTP错误
- 网络错误:APIError中包含连接失败
- 配置错误:缺少API键在启动时引发ConfigError
- 工具层:捕获APIError并返回错误字典(从不引发)
Claude桌面配置
添加到 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"property-mcp": {
"command": "/path/to/venv/bin/python3.12",
"args": ["-m", "mcp_server.server"],
"cwd": "/path/to/property-MCP",
"env": {
"PYTHONPATH": "/path/to/property-MCP"
}
}
}
}收件人API文件
https://api.developer.attomdata.com/
