A2A-MCP-RealEstate
by gum798
README.md
# ๐ A2A MCP Real Estate
> Korean Real Estate Recommendation System using FastMCP
> AI-powered property analysis with investment value and quality of life evaluation
[](https://github.com/jlowin/fastmcp)
[](https://www.python.org/)
[](https://fastapi.tiangolo.com/)
[](LICENSE)
## ๐ Overview
A2A MCP Real Estate๋ ํ๊ตญ ๋ถ๋์ฐ ์์ฅ์ ์ํ AI ๊ธฐ๋ฐ ์ถ์ฒ ์์คํ
์
๋๋ค. FastMCP(Model Context Protocol) ์๋ฒ๋ฅผ ํตํด ๋ถ๋์ฐ ์ค๊ฑฐ๋๊ฐ ๋ฐ์ดํฐ ๋ถ์, ์์น ๊ธฐ๋ฐ ์๋น์ค, ๊ทธ๋ฆฌ๊ณ ํฌ์๊ฐ์น์ ์ถ์์ง์ ์ข
ํฉํ ๋ง์ถคํ ๋ถ๋์ฐ ์ถ์ฒ ์๋น์ค๋ฅผ ์ ๊ณตํฉ๋๋ค.
### โจ Key Features
- ๐ข **์ค๊ฑฐ๋๊ฐ ๋ฐ์ดํฐ ์กฐํ**: ๊ตญํ ๊ตํต๋ถ ๊ณต๊ณต๋ฐ์ดํฐ API ์ฐ๋
- ๐ **์์น ๊ธฐ๋ฐ ๋ถ์**: ์งํ์ฒ ์ญ ๊ฑฐ๋ฆฌ, ํธ์์์ค, ๊ณต์ ์ ๊ทผ์ฑ ๋ถ์
- ๐ฐ **ํฌ์๊ฐ์น ํ๊ฐ**: AI ๊ธฐ๋ฐ ํฌ์ ์์ต์ฑ ๋ถ์
- ๐ฟ **์ถ์์ง ํ๊ฐ**: ๊ฑฐ์ฃผ ํ๊ฒฝ์ ํธ์์ฑ๊ณผ ์์ ์ฑ ๋ถ์
- ๐ฏ **๋ง์ถคํ ์ถ์ฒ**: ์ฌ์ฉ์ ์ฑํฅ๋ณ ๋ถ๋์ฐ ์ถ์ฒ (ํฌ์/์ถ์์ง/๊ท ํ)
- ๐ **์น ์ธํฐํ์ด์ค**: ์ง๊ด์ ์ธ ๋ถ๋์ฐ ๋ถ์ ๋๊ตฌ
## ๐ Quick Start
### Prerequisites
- Python 3.12+
- ๊ตญํ ๊ตํต๋ถ ๊ณต๊ณต๋ฐ์ดํฐํฌํธ API ํค
- ๋ค์ด๋ฒ ํด๋ผ์ฐ๋ ํ๋ซํผ API ํค
### Installation
```bash
# Clone the repository
git clone https://github.com/your-username/A2A-MCP-RealEstate.git
cd A2A-MCP-RealEstate
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\\Scripts\\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Edit .env file with your API keys
```
### Environment Variables
```bash
# .env file
MOLIT_API_KEY=your_molit_api_key_here
NAVER_CLIENT_ID=your_naver_client_id_here
NAVER_CLIENT_SECRET=your_naver_client_secret_here
PORT=8080
AGENT_ID=agent-py-001
AGENT_NAME=A2A_Python_Agent
LOG_LEVEL=INFO
ENVIRONMENT=development
```
### Running the Application
#### 1. Web Interface (Recommended)
```bash
# Start the web server
python runner.py
# Access the web interface
open http://localhost:8080/web/
```
#### 2. MCP Servers (Standalone)
```bash
# Real Estate Recommendation MCP Server
python app/mcp/real_estate_recommendation_mcp.py
# Location Service MCP Server
python app/mcp/location_service.py
```
#### 3. Claude Desktop Integration
Add to your Claude Desktop MCP configuration:
```json
{
"mcpServers": {
"korean-realestate": {
"command": "python",
"args": ["app/mcp/real_estate_recommendation_mcp.py"],
"cwd": "/path/to/A2A-MCP-RealEstate"
}
}
}
```
## ๐ ๏ธ MCP Tools
### Real Estate Recommendation Server
| Tool Name | Description | Parameters |
|-----------|-------------|------------|
| `get_real_estate_data` | ๋ถ๋์ฐ ์ค๊ฑฐ๋๊ฐ ์กฐํ | `lawd_cd`, `deal_ymd`, `property_type` |
| `analyze_location` | ์์น ๋ถ์ (์งํ์ฒ , ํธ์์์ค) | `address`, `lat`, `lon` |
| `evaluate_investment_value` | ํฌ์๊ฐ์น ํ๊ฐ | Property details + preferences |
| `evaluate_life_quality` | ์ถ์์ง๊ฐ์น ํ๊ฐ | Property details + preferences |
| `recommend_property` | ์ข
ํฉ ๋ถ๋์ฐ ์ถ์ฒ | All property details + `user_preference` |
### Location Service Server
| Tool Name | Description | Parameters |
|-----------|-------------|------------|
| `find_nearest_subway_stations` | ๊ฐ์ฅ ๊ฐ๊น์ด ์งํ์ฒ ์ญ ๊ฒ์ | `address`, `lat`, `lon`, `limit` |
| `address_to_coordinates` | ์ฃผ์๋ฅผ ์ขํ๋ก ๋ณํ | `address` |
| `find_nearby_facilities` | ์ฃผ๋ณ ํธ์์์ค ๊ฒ์ | `lat`, `lon`, `category`, `radius` |
| `calculate_location_score` | ์์น ์ ์ ๊ณ์ฐ | `subway_distance`, `facilities_count`, `park_distance` |
## ๐ Evaluation System
### Investment Value Analysis (ํฌ์๊ฐ์น ํ๊ฐ)
| Factor | Weight | Description |
|--------|--------|-------------|
| ๐ท๏ธ Price | 25% | ์์ธ ๋๋น ๊ฐ๊ฒฉ ํฉ๋ฆฌ์ฑ |
| ๐ Area | 20% | ํฌ์ ์ ํธ ๋ฉด์ ๋ (20-35ํ) |
| ๐ข Floor | 15% | ์ค๊ฐ์ธต~์ค์์ธต ์ ํธ๋ |
| ๐ Transportation | 25% | ์งํ์ฒ ์ ๊ทผ์ฑ |
| ๐ฎ Future Value | 15% | ์ฌ๊ฑด์ถ/๊ฐ๋ฐ ๊ฐ๋ฅ์ฑ |
### Quality of Life Analysis (์ถ์์ง๊ฐ์น ํ๊ฐ)
| Factor | Weight | Description |
|--------|--------|-------------|
| ๐ณ Environment | 25% | ๊ณต์, ๋
น์ง ์ ๊ทผ์ฑ |
| ๐ช Convenience | 25% | ํธ์์์ค ๊ฐ์ ๋ฐ ์ ๊ทผ์ฑ |
| ๐ก๏ธ Safety | 20% | ์ธต์, ์น์, ๊ตํต์์ |
| ๐ Education | 15% | ํ๊ต, ํ์๊ฐ ์ ๊ทผ์ฑ |
| ๐ญ Culture | 15% | ๋ฌธํ์์ค ์ ๊ทผ์ฑ |
### Grading System
- **A+ (90-100์ )**: ๋งค์ฐ ์ฐ์ - ๊ฐ๋ ฅ ์ถ์ฒ
- **A (80-89์ )**: ์ฐ์ - ์ถ์ฒ
- **B+ (70-79์ )**: ์ํธ - ์กฐ๊ฑด๋ถ ์ถ์ฒ
- **B (60-69์ )**: ๋ณดํต - ์ ์ค ๊ฒํ
- **C (60์ ๋ฏธ๋ง)**: ๊ฐ์ ํ์ - ๋ณด๋ฅ
## ๐๏ธ Architecture
```
๐ A2A-MCP-RealEstate/
โโโ ๐ app/
โ โโโ ๐ mcp/ # FastMCP Servers
โ โ โโโ ๐ real_estate_recommendation_mcp.py # Main recommendation server
โ โ โโโ ๐ location_service.py # Location analysis server
โ โโโ ๐ routes/ # Web API Routes
โ โ โโโ ๐ web_routes.py # Web interface routes
โ โ โโโ ๐ง mcp_routes.py # MCP API routes
โ โโโ ๐ utils/ # Utilities
โ โ โโโ ๐ mcp_client.py # MCP client utilities
โ โ โโโ โ๏ธ config.py # Configuration management
โ โ โโโ ๐ logger.py # Logging utilities
โ โโโ ๐ templates/ # HTML Templates
โ โ โโโ ๐ index.html # Home page
โ โ โโโ ๐งช mcp_test.html # MCP testing interface
โ โ โโโ ๐ค agent_test.html # Agent testing interface
โ โ โโโ ๐ result templates # Result display templates
โ โโโ ๐ main.py # FastAPI application
โโโ ๐ runner.py # Application runner
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ task.md # Development tasks
โโโ ๐ README.md # This file
```
## ๐ฑ Web Interface
### Home Page
- ์์คํ
๊ฐ์ ๋ฐ ์ฃผ์ ๊ธฐ๋ฅ ์๊ฐ
- MCP ํ
์คํธ์ Agent ํ
์คํธ๋ก์ ์ง์ ๋งํฌ
### MCP Testing Interface
- ์ค๊ฑฐ๋๊ฐ ์กฐํ ๋๊ตฌ ํ
์คํธ
- ์งํ์ฒ ์ญ ๊ฒ์ ๋๊ตฌ ํ
์คํธ
- ํธ์์์ค ๊ฒ์ ๋๊ตฌ ํ
์คํธ
- ์์น ์ ์ ๊ณ์ฐ ๋๊ตฌ ํ
์คํธ
### Agent Testing Interface
- ๋ถ๋์ฐ ์ ๋ณด ์
๋ ฅ ํผ
- ์ค์๊ฐ ํฌ์๊ฐ์น ๋ฐ ์ถ์์ง ๋ถ์
- ์ข
ํฉ ์ถ์ฒ ๊ฒฐ๊ณผ ์๊ฐํ
- ์์ธ ํ๊ฐ ๋ฆฌํฌํธ
## ๐ง API Keys Setup
### 1. ๊ตญํ ๊ตํต๋ถ ๊ณต๊ณต๋ฐ์ดํฐํฌํธ
1. [๊ณต๊ณต๋ฐ์ดํฐํฌํธ](https://www.data.go.kr/) ํ์๊ฐ์
2. "์ํํธ ์ค๊ฑฐ๋๊ฐ ์ ๋ณด" ํ์ฉ์ ์ฒญ
3. ์น์ธ๋ API ํค๋ฅผ `MOLIT_API_KEY`์ ์ค์
### 2. ๋ค์ด๋ฒ ํด๋ผ์ฐ๋ ํ๋ซํผ
1. [๋ค์ด๋ฒ ํด๋ผ์ฐ๋ ํ๋ซํผ](https://www.ncloud.com/) ํ๋ก์ ํธ ์์ฑ
2. "Application > Maps" ์๋น์ค ์ ์ฒญ
3. ํด๋ผ์ด์ธํธ ID๋ฅผ `NAVER_CLIENT_ID`์ ์ค์
4. ํด๋ผ์ด์ธํธ ์ํฌ๋ฆฟ์ `NAVER_CLIENT_SECRET`์ ์ค์
## ๐ Usage Examples
### CLI Example (MCP Server)
```bash
# Start the MCP server
python app/mcp/real_estate_recommendation_mcp.py
# The server will be available for MCP clients
# Example tools: get_real_estate_data, recommend_property, etc.
```
### Web Interface Example
```bash
# Start web server
python runner.py
# Navigate to http://localhost:8080/web/
# 1. Go to "MCP ํ
์คํธ" for data query testing
# 2. Go to "Agent ํ
์คํธ" for property recommendation
```
### API Example
```python
import httpx
# Get apartment trade data
response = await httpx.post("http://localhost:8080/web/api/mcp/test", json={
"tool_name": "get_real_estate_data",
"parameters": {
"lawd_cd": "11680", # Gangnam-gu, Seoul
"deal_ymd": "202401", # January 2024
"property_type": "์ํํธ"
}
})
```
## ๐ค Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- **FastMCP**: FastMCP framework for rapid MCP server development
- **๊ตญํ ๊ตํต๋ถ**: Real estate transaction data via public data portal
- **์นด์นด์ค**: Location and mapping services
- **FastAPI**: Modern web framework for building APIs
- **Bootstrap**: Frontend framework for responsive web design
## ๐ Support
- ๐ง Issues: [GitHub Issues](https://github.com/your-username/A2A-MCP-RealEstate/issues)
- ๐ Documentation: See `/docs` endpoint when running the server
- ๐ฌ Discussions: [GitHub Discussions](https://github.com/your-username/A2A-MCP-RealEstate/discussions)
---
**๐ A2A MCP Real Estate** - Making Korean real estate investment decisions smarter with AI and MCP technology.This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo issues