> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hostreach.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Use Hostreach inside Cursor, Claude Desktop, and Codex via the Model Context Protocol.

The Hostreach MCP server exposes 49 structured tools for campaigns, leads, extractions, messaging, webhooks, templates, valuations, fichas, and scheduling. Your AI agent can call them directly without writing any code.

## Auto-configure (easiest)

Install the CLI and run one command to configure your agent:

```bash theme={null}
npm install -g @hostreach/cli
hostreach auth login          # save your API key

hostreach agent add cursor    # writes .cursor/mcp.json in the current project
hostreach agent add claude    # writes ~/.claude/claude_desktop_config.json
hostreach agent add codex     # writes ~/.codex/mcp.json
```

Restart the agent after adding the server.

## Manual configuration

Add to your agent's MCP config file (`~/.cursor/mcp.json`, `claude_desktop_config.json`, etc.):

```json theme={null}
{
  "mcpServers": {
    "hostreach": {
      "command": "npx",
      "args": ["-y", "--package=@hostreach/cli", "hostreach-mcp"],
      "env": {
        "HOSTREACH_API_KEY": "hr_live_your_key_here"
      }
    }
  }
}
```

<Note>
  The MCP server runs via `npx` — no global install needed. It reads `HOSTREACH_API_KEY` from the environment.
</Note>

## Available tools

| Group           | Tools                                                                                                                   |
| --------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **Identity**    | `get_me`, `get_usage`                                                                                                   |
| **Platforms**   | `list_platforms`, `get_platform_filters`, `search_locations`                                                            |
| **Extractions** | `start_extraction`, `get_extraction`, `list_extractions`, `get_extraction_leads`                                        |
| **Campaigns**   | `list_campaigns`, `get_campaign`, `create_campaign`, `update_campaign_status`, `execute_campaign`, `get_campaign_stats` |
| **Leads**       | `list_leads`, `get_lead`, `update_lead_status`, `add_lead_note`, `get_lead_notes`                                       |
| **Messaging**   | `send_message`, `get_conversations`                                                                                     |
| **Webhooks**    | `list_webhooks`, `create_webhook`, `update_webhook`, `delete_webhook`, `test_webhook`                                   |
| **Templates**   | `list_templates`, `create_template`, `update_template`, `delete_template`                                               |
| **Accounts**    | `list_accounts`, `create_account`, `delete_account`                                                                     |
| **Valuations**  | `list_valuations`, `create_valuation`, `get_valuation`, `get_valuation_comparables`, `delete_valuation`                 |
| **Fichas**      | `list_fichas`, `generate_ficha`, `get_ficha`, `delete_ficha`                                                            |
| **Scheduling**  | `list_event_types`, `get_availability`, `list_appointments`, `cancel_appointment`                                       |

## Example prompt

Once the MCP server is connected, try asking your agent:

> "Extract 50 rental leads from Valencia on Idealista and update my leads list."

The agent will call `search_locations`, `start_extraction`, poll `get_extraction` until complete, and then `list_leads` automatically.
