{
  "markdown": "# Real Estate Capitale — MCP Server\n\nMCP server for real estate search, property valuation, market analysis, and lead management in Rabat, Salé, and Témara, Morocco.\n\n## Quick Start\n\n```bash\n# Install\nnpm install\n\n# Set database URL\ncp .env.example .env\n# Edit .env with your PostgreSQL connection string\n\n# Start stdio server (for Claude Desktop, opencode, Cursor)\nnpm start\n\n# Or start HTTP/SSE server\nnpm start:http\n```\n\n## 17 Tools\n\n| Tool | Description |\n|------|-------------|\n| `search_listings` | Search properties with filters (type, location, budget, surface, rooms) |\n| `get_listing` | Get full listing details by ID |\n| `estimate_property` | Estimate property value by quartier and surface |\n| `get_market_trends` | Price trends over time by quartier |\n| `get_quartier_stats` | Aggregated stats per quartier (price/m², count) |\n| `list_quartiers` | List all available quartiers |\n| `list_villes` | List all available cities |\n| `create_lead` | Create a lead (contact client) |\n| `get_comparables` | Find similar listings for valuation |\n| `get_investor_alerts` | Identify undervalued properties |\n| `get_price_analytics` | Price/m² analysis with distribution |\n| `get_rental_yield` | Rental yield by quartier |\n| `get_market_predictions` | 90-day price predictions |\n| `get_quartier_comparison` | Compare two quartiers side-by-side |\n| `get_suspicious_listings` | Detect outlier pricing |\n| `get_liquidity` | Market liquidity index |\n| `get_agency_leaderboard` | Agency ranking by volume |\n\n## Transports\n\n### stdio (local)\n\n```bash\nnode bin/mcp-server\n```\n\nFor Claude Desktop, opencode, Cursor — reads JSON-RPC from stdin, writes to stdout.\n\n### HTTP/SSE (remote)\n\n```bash\nnode bin/mcp-server-http\n# Listens on port 3001\n```\n\nEndpoints:\n- `GET /` — Server info (Streamable HTTP discovery)\n- `POST /` — Synchronous JSON-RPC\n- `GET /sse` — SSE stream\n- `POST /messages?sessionId=...` — SSE session messages\n- `GET /health` — Health check\n\n## Configuration\n\n### Claude Desktop\n\nCopy `config/claude-desktop.json` to your Claude Desktop MCP config, or add to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"realestatecapitale\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/rabatrealestate/bin/mcp-server\"],\n      \"env\": {\n        \"DATABASE_URL\": \"postgresql://user:pass@localhost:5432/mubawab\"\n      }\n    }\n  }\n}\n```\n\n### opencode\n\n```json\n{\n  \"mcp\": {\n    \"realestatecapitale\": {\n      \"type\": \"local\",\n      \"command\": [\"node\", \"bin/mcp-server\"],\n      \"env\": { \"DATABASE_URL\": \"...\" }\n    }\n  }\n}\n```\n\n### Remote (HTTP)\n\n```json\n{\n  \"mcp\": {\n    \"realestatecapitale\": {\n      \"type\": \"remote\",\n      \"url\": \"https://realestatecapitale.ma/mcp\"\n    }\n  }\n}\n```\n\n## Query Tool\n\n```bash\n# List tools\nnode bin/query \"tools/list\"\n\n# Call a tool\nnode bin/query 'tools/call {\"name\":\"list_villes\",\"arguments\":{}}'\n\n# Query remote server\nMCP_URL=https://realestatecapitale.ma/mcp node bin/query \"tools/list\"\n```\n\n## Testing\n\n```bash\nnpm test\n```\n\n## Architecture\n\n```\n┌─────────────┐     stdio      ┌──────────────┐\n│ Claude Desktop│ ◄──────────── │ bin/mcp-server│\n│ opencode     │               │ (stdio)       │\n└─────────────┘               └──────┬───────┘\n                                      │\n┌─────────────┐     HTTP/SSE  ┌──────┴───────┐\n│ Remote AI   │ ◄──────────── │ bin/mcp-     │\n│ clients     │               │ server-http  │\n└─────────────┘               │ (port 3001)  │\n                              └──────┬───────┘\n                                     │\n                              ┌──────┴───────┐\n                              │ src/core/     │\n                              │ mcp-core.js   │\n                              │ (17 tools)    │\n                              └──────┬───────┘\n                                     │\n                              ┌──────┴───────┐\n                              │ PostgreSQL    │\n                              │ (mubawab)     │\n                              └──────────────┘\n```\n\n## License\n\nMIT\n",
  "bytes": 3989,
  "sha": "cd6854c304e8a418e97c29596e03aceb0ee8f524e31fa0001b2b829785b1c333",
  "repo_slug": "allamiwayl-27/rabatrealestate",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_allamiwayl_27_rabatrealestate__49511fdf/readme"
}