MCP ExplorerExplorer

Estate Gd Mcp

@DreamCCCon a year ago
1 MIT
FreeCommunity
AI Systems
An intelligent real estate Q&A system using large models and map data for interactive consultations.

Overview

What is Estate Gd Mcp

estate-gd-mcp is an intelligent question-and-answer system for real estate agents, leveraging large models and integrating data from Beike and Gaode Map to provide natural language interactive real estate consulting services.

Use cases

Use cases include assisting clients in finding properties based on specific criteria, analyzing commuting routes, providing school district information, and generating reports on property price trends and neighborhood evaluations.

How to use

To use estate-gd-mcp, you can either run the automated setup script to configure the environment and dependencies or manually set up the project by creating a virtual environment, installing dependencies, and configuring the MySQL database.

Key features

Key features include intelligent Q&A for user intent parsing, multi-dimensional property browsing and filtering, map analysis with price heatmaps, and comprehensive decision reports that assess property prices and surrounding environments.

Where to use

estate-gd-mcp can be used in the real estate industry, particularly for real estate agencies, property management firms, and any business that requires interactive property consultation services.

Content

房产中介智能问答系统

一个基于大模型的房产中介智能问答系统,结合贝壳网房源数据和高德地图地理信息,提供自然语言交互式房产咨询服务。

系统架构

后端组件

  • FastAPI框架: 提供高性能RESTful API接口
  • MySQL: 存储房源数据、用户交互记录及系统配置
  • OpenRouter集成: 通过OpenRouter访问Claude等大型语言模型
  • 高德地图集成: 通过MCP工具访问高德地图API,获取地理信息

前端组件

  • Vue.js: 基于Vue 3的前端框架
  • Element Plus: UI组件库
  • Vuex: 状态管理
  • ECharts: 数据可视化,用于展示房价热力图等

主要功能

1. 智能问答

  • 自然语言交互,解析用户意图
  • 房源条件筛选(如预算、户型、地段等)
  • 通勤路线规划与分析
  • 学区信息咨询
  • 房价趋势分析

2. 房源浏览与筛选

  • 多维度条件筛选(价格、面积、户型、地理位置等)
  • 列表/网格视图切换
  • 详细房源信息展示
  • 相似房源推荐

3. 地图分析

  • 房价热力图可视化
  • 周边配套设施查询(交通、教育、商业、医疗等)
  • 区域房价对比
  • 自定义区域选择

4. 决策报告

  • 房源综合分析
  • 价格合理性评估
  • 周边环境评分
  • VR看房链接

数据流程

  1. 通过八爪鱼爬虫采集贝壳网房源数据
  2. 系统处理并存储结构化数据到MySQL数据库
  3. 结合高德地图API获取地理信息(交通、学区、商业配套等)
  4. 大模型解析用户问题,检索相关信息
  5. 生成答案并展示给用户

项目结构

├── backend/                  # 后端代码
│   ├── app/                  # 应用主体
│   │   ├── api/              # API定义
│   │   ├── core/             # 核心配置
│   │   ├── db/               # 数据库模型
│   │   └── services/         # 业务逻辑
│   ├── main.py               # 入口文件
│   └── requirements.txt      # 依赖列表
│
├── frontend/                 # 前端代码
│   ├── public/               # 静态资源
│   └── src/                  # 源代码
│       ├── assets/           # 资源文件
│       ├── components/       # 组件
│       ├── router/           # 路由配置
│       ├── store/            # Vuex状态管理
│       └── views/            # 页面视图
│
├── crawler/                  # 爬虫代码
│   ├── processors/           # 数据处理器
│   └── scrapers/             # 爬虫脚本
│
├── data/                     # 数据文件
│
├── setup.py                  # 自动化设置脚本
├── setup_mysql_db.py         # MySQL数据库设置脚本
├── import_csv_to_mysql.py    # CSV数据导入MySQL脚本
└── .env                      # 环境变量配置文件

安装与配置

自动化设置(推荐)

使用自动化设置脚本可以一键完成所有配置:

python setup.py

此脚本将自动执行以下操作:

  • 创建并配置Python虚拟环境
  • 安装所有必要依赖
  • 设置MySQL数据库和表结构
  • 导入CSV数据(如果存在)

手动设置

如果您想手动设置项目,请按照以下步骤操作:

1. 创建虚拟环境

创建并激活Python虚拟环境:

python -m venv venv
source venv/bin/activate  # Linux/Mac
# 或者
venv\Scripts\activate     # Windows

2. 安装依赖

安装所需Python包:

pip install fastapi uvicorn pymysql sqlalchemy python-dotenv pandas httpx aiohttp matplotlib plotly

3. 配置环境变量

创建或编辑.env文件,配置以下环境变量:

# MySQL数据库设置
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=
MYSQL_DATABASE=realestate_qa

# OpenRouter API设置
OPENROUTER_API_KEY=your_openrouter_key
OPENROUTER_URL=https://openrouter.ai/api/v1/chat/completions

# 高德地图API设置
AMAP_KEY=your_amap_key

4. 设置MySQL数据库

运行MySQL数据库设置脚本:

python setup_mysql_db.py

5. 导入CSV数据

导入贝壳网房源数据到MySQL:

python import_csv_to_mysql.py data/shanghai_beike_rentals.csv

启动系统

后端服务

启动后端API服务:

cd backend
python main.py

服务将在 http://localhost:8000 上运行。

前端服务

使用Python内置HTTP服务器启动前端:

cd frontend
python serve.py

或者,如果您想使用npm:

cd frontend
npm install
npm run serve

前端将在 http://localhost:8080 上运行。

使用示例

自然语言查询示例

用户可以提问如:

  • “海淀区300-500万预算的两居室有哪些?”
  • “从望京到国贸上班,有什么合适的居住区域推荐?”
  • “朝阳区有哪些优质学区房?”
  • “北京西站附近生活便利度如何?”
  • “最近一年海淀区的房价走势如何?”

接口调用示例

import requests

# 发送问答请求
response = requests.post(
    "http://localhost:8000/api/qa/ask",
    json={"question": "海淀区的两居室大概什么价位?"}
)
print(response.json())

# 获取房源列表
response = requests.get(
    "http://localhost:8000/api/property/list",
    params={"district": "海淀区", "min_price": 3000000, "max_price": 5000000}
)
print(response.json())

技术亮点

  1. MySQL数据存储: 使用MySQL关系型数据库存储房源数据,提供高效查询和数据完整性
  2. 自然语言理解: 使用OpenRouter API集成大型语言模型,实现高质量自然语言交互
  3. 地理信息集成: 通过高德地图API获取详细的地理信息,为房产评估提供关键参考
  4. 响应式设计: 前端适配不同设备尺寸,提供一致的用户体验
  5. 数据可视化: 使用ECharts实现房价热力图等直观的数据展示
  6. 模块化架构: 系统设计模块化,便于维护和扩展
  7. 自动化设置: 一键完成环境配置、数据库设置和数据导入

未来扩展

  • 推荐系统: 基于用户行为和偏好的个性化房源推荐
  • 价格预测: 使用机器学习模型预测未来房价趋势
  • 更多数据源: 整合更多房产数据源,提供更全面的信息
  • 移动应用: 开发配套的移动应用,提供随时随地的服务

贡献者

  • 开发团队

许可证

MIT

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers