# Connect Claro to an MCP client

> **Casafari is the AI agent-native real estate data intelligence platform.** The most complete property index in Europe: a deduplicated, cleaned property graph of residential and commercial property, for sale and for rent, in 16 countries. Every property is one record with its full price and market history. [How the property graph is built](/docs/property-graph).

Claro AI is a platform product. Its MCP server is at `https://platform.casafari.com/mcp/claro`: Streamable HTTP with JSON responses, stateless, tools only. It signs in with a platform API key or the platform's OAuth, so a client that handles OAuth (claude.ai, ChatGPT) needs only the URL, and any other client sends the key in an `Authorization` header. The platform meters each tool call in platform units and forwards it to Claro unchanged; Claro's `Claro-Version` header and error bodies pass through. Create a platform API key in your account on [platform.casafari.com](https://platform.casafari.com). In every block below, replace `$CASAFARI_API_KEY` with your key, or keep it in an environment variable or the client's secret store; never commit it. What Claro is: [Claro AI](/docs/claro). The Casafari MCP gateway has its own page: [Connect an MCP client](/docs/connect).

## Claude Code

```bash
claude mcp add --transport http claro https://platform.casafari.com/mcp/claro --header "Authorization: Bearer $CASAFARI_API_KEY"
```

Then run `/mcp` inside Claude Code: `claro` is listed with its tools. To sign in with OAuth instead of a key, leave out `--header` and authenticate from `/mcp`.

## Claude desktop and claude.ai

A custom connector in claude.ai (**Settings → Connectors → Add custom connector**) takes a URL and signs in with OAuth. Through the platform's OAuth it can reach Claro: paste `https://platform.casafari.com/mcp/claro` and sign in with your platform account. Claude desktop uses the same connectors.

## ChatGPT

In ChatGPT's settings turn on **Developer mode** (Apps & Connectors, advanced settings), create a connector, paste `https://platform.casafari.com/mcp/claro` as the MCP server URL and sign in with the platform's OAuth. From your own code, the OpenAI Responses API sends the key for you:

```json
{
  "model": "gpt-5",
  "input": "burger restaurant, corner unit 120-250 m², smoke outlet, busy street, Madrid, rent under 8,000 a month",
  "tools": [
    {
      "type": "mcp",
      "server_label": "claro",
      "server_url": "https://platform.casafari.com/mcp/claro",
      "authorization": "$CASAFARI_API_KEY",
      "require_approval": "never"
    }
  ]
}
```

## Cursor

Add to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project):

```json
{
  "mcpServers": {
    "claro": {
      "url": "https://platform.casafari.com/mcp/claro",
      "headers": { "Authorization": "Bearer ${env:CASAFARI_API_KEY}" }
    }
  }
}
```

## VS Code

Add to `.vscode/mcp.json`. VS Code asks for the key once and keeps it in its secret store:

```json
{
  "inputs": [{ "type": "promptString", "id": "casafari-key", "description": "Casafari platform API key", "password": true }],
  "servers": {
    "claro": {
      "type": "http",
      "url": "https://platform.casafari.com/mcp/claro",
      "headers": { "Authorization": "Bearer ${input:casafari-key}" }
    }
  }
}
```

## Any other client

Point the client at `https://platform.casafari.com/mcp/claro` and have it send `Authorization: Bearer $CASAFARI_API_KEY` with every request. To check the connection by hand:

```bash
curl -X POST "https://platform.casafari.com/mcp/claro" \
  -H "Authorization: Bearer $CASAFARI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
```

The answer lists the 9 tools: [`search_premises`](/docs/claro/search_premises), [`refine_search`](/docs/claro/refine_search), [`get_premises`](/docs/claro/get_premises), [`compare_premises`](/docs/claro/compare_premises), [`market_snapshot`](/docs/claro/market_snapshot), [`explain_location`](/docs/claro/explain_location), [`brief_from_file`](/docs/claro/brief_from_file), [`search_plots`](/docs/claro/search_plots), [`get_plot`](/docs/claro/get_plot). Without a valid platform key or token the platform answers `401`.

## Check it works

Ask your assistant: *"burger restaurant, corner unit 120-250 m², smoke outlet, busy street, Madrid, rent under 8,000 a month"* It should call [`search_premises`](/docs/claro/search_premises) and answer with counts, the criteria it understood and the premises that match, each with the sentence it rests on and the agency's own page.
