loading…
Search for a command to run...
loading…
MCP server for querying Israeli government real estate data, enabling property deal searches, market trend analysis, and address retrieval.
MCP server for querying Israeli government real estate data, enabling property deal searches, market trend analysis, and address retrieval.
A Python-based Mission Control Program (MCP) for interacting with the Israeli government's public real estate data API (Govmap). This project provides both a Python library and an MCP server that allows real estate agents, professionals, and AI agents to query recent property deals, analyze market trends, and retrieve detailed real estate information.
This project provides a comprehensive Python interface to the Israeli government's Govmap API, enabling users to:
Clone the repository:
git clone <repository-url>
cd nadlan-mcp
Create a virtual environment:
python -m venv venv
Activate the virtual environment:
venv\Scripts\activate
source venv/bin/activate
Install the package:
pip install -e .
Or for development with all dev dependencies:
pip install -e .[dev]
The project includes an MCP (Model Context Protocol) server that allows AI agents to access Israeli real estate data. The server provides multiple deployment options:
NEW: Using FastMCP for better compatibility and reliability
python run_fastmcp_server.py
This starts the FastMCP server which resolves compatibility issues with the standard MCP library.
For testing and demonstration purposes:
python simple_mcp_server.py
This runs an interactive demo where you can test the tools directly in the terminal.
For testing and demonstrations:
python simple_mcp_server.py
This runs an interactive demo where you can test the tools directly in the terminal.
You can also run the server directly:
python -m nadlan_mcp.simple_fastmcp_server
NEW: HTTP transport for deploying to Render, Railway, Docker, and other cloud platforms
For production deployment to cloud platforms, use the HTTP server:
python run_http_server.py
This starts the FastMCP server with HTTP transport, listening on port 8000 by default (configurable via PORT environment variable).
Using Docker:
Build and run the container:
# Build the Docker image
docker build -t nadlan-mcp .
# Run the container
docker run -p 8000:8000 nadlan-mcp
# Or with custom port
docker run -p 8080:8080 -e PORT=8080 nadlan-mcp
Environment Variables:
PORT - HTTP server port (default: 8000)HOST - Bind address (default: 0.0.0.0)Endpoints:
http://localhost:8000/mcp - MCP protocol endpointhttp://localhost:8000/health - Health check endpointFor detailed deployment instructions to Render, Railway, or other platforms, see DEPLOYMENT.md.
To connect to the server from MCP clients, use the following configuration:
For Claude Desktop or other MCP clients (FastMCP - Recommended):
Add to your MCP client configuration:
{
"servers": {
"nadlan-mcp": {
"command": "python",
"args": ["/path/to/nadlan-mcp/run_fastmcp_server.py"],
"env": {}
}
}
}
For development with stdio transport (FastMCP):
import asyncio
from mcp.client.stdio import stdio_client
async def main():
async with stdio_client(["python", "run_fastmcp_server.py"]) as client:
# List available tools
result = await client.list_tools()
print("Available tools:", result.tools)
# Call a tool
result = await client.call_tool("find_recent_deals_for_address", {
"address": "סוקולוב 38 חולון",
"years_back": 2
})
print("Results:", result)
asyncio.run(main())
FastMCP Server provides these 7 tools:
find_recent_deals_for_address - Main comprehensive analysis toolget_deals_by_radius - Find deals within a radius of coordinatesget_street_deals - Get deals for a specific street polygonget_neighborhood_deals - Get deals for a specific neighborhood polygonautocomplete_address - Address search and validationanalyze_market_trends - Analyze market trends and price patternscompare_addresses - Compare multiple addressesAll Tools Details:
find_recent_deals_for_addressMain comprehensive analysis tool
address (required): The address to search for (Hebrew or English)years_back (optional): Number of years to look back (default: 2)Example usage:
{
"address": "בן יהודה 1 תל אביב",
"years_back": 3
}
analyze_market_trendsMarket trend analysis with price insights
address (required): The address to analyzeyears_back (optional): Number of years to analyze (default: 2)Example usage:
{
"address": "דיזנגוף 50 תל אביב",
"years_back": 5
}
compare_neighborhoodsCompare multiple areas
addresses (required): List of addresses to compareyears_back (optional): Number of years to analyze (default: 2)Example usage:
{
"addresses": ["סוקולוב 38 חולון", "בן יהודה 1 תל אביב", "דיזנגוף 50 תל אביב"],
"years_back": 2
}
autocomplete_addressAddress search and validation
search_text (required): The address text to search forExample usage:
{
"search_text": "רוטשילד תל אביב"
}
You can test the server using the interactive demo:
python simple_mcp_server.py
This will start an interactive session where you can:
The server provides detailed logging. To see debug information:
# Set logging level before running
export PYTHONPATH=/path/to/nadlan-mcp
python -c "import logging; logging.basicConfig(level=logging.DEBUG)" run_mcp_server.py
Connection Issues:
pip install -e .Tool Execution Issues:
Performance:
years_back values (2-5 years recommended)from nadlan_mcp.govmap import GovmapClient
# Initialize the client
client = GovmapClient()
# Search for recent deals for a specific address
address = "רוטשילד 1 תל אביב"
deals = client.find_recent_deals_for_address(address, years_back=2)
print(f"Found {len(deals)} deals for {address}")
for deal in deals[:5]: # Show first 5 deals
print(f"Address: {deal.address_description}")
print(f"Date: {deal.deal_date}")
print(f"Price: ₪{deal.deal_amount:,.0f}")
print("---")
The examples/ directory contains practical examples:
Run any example:
python examples/basic_search.py
python examples/market_analysis.py
See examples/README.md for detailed usage instructions.
from nadlan_mcp import GovmapClient
client = GovmapClient()
# Search for an address
result = client.autocomplete_address("בן יהודה 1 תל אביב")
if result['results']:
best_match = result['results'][0]
print(f"Found: {best_match.get('displayName')}")
print(f"Coordinates: {best_match.get('point')}")
# Get coordinates from address first
autocomplete_result = client.autocomplete_address("דיזנגוף 50 תל אביב")
point = tuple(autocomplete_result['results'][0]['point'])
# Get block and parcel info
gush_helka = client.get_gush_helka(point)
print(f"Block/Parcel info: {gush_helka}")
# Find deals within 100 meters of a point
point = (3870923.95, 3766288.07) # Example coordinates
deals = client.get_deals_by_radius(point, radius=100)
print(f"Found {len(deals)} deals within 100m")
for deal in deals:
print(f"- {deal.get('address')}: {deal.get('price')}")
# Get detailed street deals for a specific polygon
polygon_id = "52190246"
street_deals = client.get_street_deals(
polygon_id,
limit=10,
start_date="2023-01",
end_date="2024-01"
)
print(f"Found {len(street_deals)} street deals")
# Get neighborhood deals
neighborhood_deals = client.get_neighborhood_deals(
polygon_id="52282030",
limit=20,
start_date="2023-01",
end_date="2024-01"
)
print(f"Found {len(neighborhood_deals)} neighborhood deals")
The project includes a main example script that demonstrates basic usage:
python -m nadlan_mcp.main
Or run it directly:
python nadlan_mcp/main.py
The main class for interacting with the Govmap API.
__init__(base_url: str = "https://www.govmap.gov.il/api/")Initialize the client with the base API URL.
autocomplete_address(search_text: str) -> Dict[str, Any]Search for addresses using autocomplete functionality.
search_text: The address to search for (Hebrew or English)requests.RequestException, ValueErrorget_gush_helka(point: Tuple[float, float]) -> Dict[str, Any]Get block (Gush) and parcel (Helka) information for coordinates.
point: Tuple of (longitude, latitude)requests.RequestException, ValueErrorget_deals_by_radius(point: Tuple[float, float], radius: int = 50) -> List[Dict[str, Any]]Find deals within a specified radius of a point.
point: Tuple of (longitude, latitude)radius: Search radius in meters (default: 50)requests.RequestExceptionget_street_deals(polygon_id: str, limit: int = 10, start_date: Optional[str] = None, end_date: Optional[str] = None) -> List[Dict[str, Any]]Get detailed deals for a specific street.
polygon_id: The polygon ID for the streetlimit: Maximum number of deals to return (default: 10)start_date: Start date in 'YYYY-MM' formatend_date: End date in 'YYYY-MM' formatrequests.RequestExceptionget_neighborhood_deals(polygon_id: str, limit: int = 10, start_date: Optional[str] = None, end_date: Optional[str] = None) -> List[Dict[str, Any]]Get deals within the same neighborhood.
polygon_id: The polygon ID for the arealimit: Maximum number of deals to return (default: 10)start_date: Start date in 'YYYY-MM' formatend_date: End date in 'YYYY-MM' formatrequests.RequestExceptionfind_recent_deals_for_address(address: str, years_back: int = 2) -> List[Dict[str, Any]]Main function: Find all relevant deals for an address (combines all other methods).
address: The address to search foryears_back: How many years back to search (default: 2)ValueError, requests.RequestExceptionThis project uses the following Govmap API endpoints:
POST /search-service/autocompletePOST /layers-catalog/entitiesByPointGET /real-estate/deals/{point}/{radius}GET /real-estate/street-deals/{polygon_id}GET /real-estate/neighborhood-deals/{polygon_id}https://www.govmap.gov.il/api/
The client includes comprehensive error handling:
The project uses Python's built-in logging module. To enable debug logging:
import logging
logging.basicConfig(level=logging.DEBUG)
Nadlan-MCP has comprehensive test coverage with 304 tests achieving 84% code coverage.
# Run all fast tests (default - excludes API health checks)
pytest tests/ -m "not api_health"
# Result: 303 passed, 1 skipped in ~12s
# Run with coverage report
pytest tests/ -m "not api_health" --cov=nadlan_mcp --cov-report=term-missing
# Run API health checks (weekly monitoring)
pytest -m api_health -v
See TESTING.md for detailed testing documentation.
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is for educational and professional use only. Please respect the Govmap API terms of service and rate limits. The authors are not responsible for any misuse of this tool.
For issues, questions, or contributions, please create an issue in the repository.
Note: This project is not officially affiliated with the Israeli government or Govmap. It is an independent tool created to facilitate access to public real estate data.
Выполни в терминале:
claude mcp add israel-real-estate-mcp -- npx Безопасность
Низкий рискАвтоматическая эвристика по публичным данным — не гарантия безопасности.