# Connect Searchata

You are configuring the current AI agent to use Searchata's remote MCP server.
Searchata gives the agent read-only access to the user's connected Google Search
Console properties and Bing Webmaster Tools sites.

Public setup, tool, security, privacy, and support documentation is available at
https://searchata.com/docs.

## Rules

- Identify whether the current host is Codex, Claude Code, or Cursor.
- Configure only the current host. If you cannot identify it, ask the user.
- Use the native remote MCP OAuth flow below.
- Do not install extra software.
- Do not request, display, or paste credentials.
- For Codex and Claude Code, do not edit configuration files directly.
- For Cursor, edit only the MCP configuration described below.

## Codex

1. Inspect the current connection:

   ```bash
   codex mcp get searchata
   ```

2. If the command reports that `searchata` is not found, add the remote server:

   ```bash
   codex mcp add searchata --url https://searchata.com/mcp
   ```

3. If an existing `searchata` entry uses a different URL, ask the user before
   you replace it.
4. Start browser authorization:

   ```bash
   codex mcp login searchata
   ```

5. Ask the user to approve the read-only Searchata request in the browser.

## Claude Code

1. Inspect the current connection:

   ```bash
   claude mcp get searchata
   ```

2. If the command reports that `searchata` is not found, add the remote server:

   ```bash
   claude mcp add --transport http --scope user searchata https://searchata.com/mcp
   ```

3. If an existing `searchata` entry uses a different URL, ask the user before
   you replace it.
4. Start browser authorization:

   ```bash
   claude mcp login searchata
   ```

5. Ask the user to approve the read-only Searchata request in the browser.

## Cursor

Use these steps in the Cursor desktop app. Cursor uses `mcp.json` to configure
MCP servers. It uses OAuth to let the user authorize access in the browser.
See the [Cursor MCP documentation](https://cursor.com/docs/mcp).

1. Inspect `~/.cursor/mcp.json` and the current project's `.cursor/mcp.json`,
   if they exist. Do not display credentials from existing entries. A project
   entry takes priority over a global entry with the same name.
2. If `searchata` already uses `https://searchata.com/mcp`, keep that entry.
   If it uses a different URL or a local command, ask the user before replacing
   it. Do not create a duplicate entry in another configuration file.
3. If `searchata` is absent, add it to `mcpServers` in `~/.cursor/mcp.json`.
   This makes it available in all projects. Use `.cursor/mcp.json` instead if
   the user requests setup for the current project only. Create the file and
   parent directory if needed. Preserve all existing servers and settings.
   For a new file, use:

   ```json
   {
     "mcpServers": {
       "searchata": {
         "url": "https://searchata.com/mcp"
       }
     }
   }
   ```

4. Save valid JSON. Ask the user to open Cursor's MCP controls under
   **Customize > MCPs** and enable `searchata`. If the entry does not appear,
   ask the user to restart Cursor.
5. Ask the user to follow Cursor's authentication prompt. The user must sign
   in to Searchata and approve the read-only request in the browser.
6. Wait until Cursor reports successful authorization. If you cannot inspect
   the connection status, ask the user to confirm it. A saved configuration
   alone does not confirm a connection. Then continue with **Finish** below.

## Finish

- For Codex and Claude Code, wait until the login command succeeds.
- For Cursor, wait until browser authorization succeeds and the server is enabled.
- Tell the user that Searchata is connected.
- Before the first tool call, direct the user to https://searchata.com/onboarding/trial
  to add a card and start the seven-day trial. Existing active subscribers and
  lifetime-plan holders can continue without another trial.
- Wait for the user to complete trial setup. If a tool returns
  `subscription_required`, show its `action_url` and wait for billing setup before
  retrying. Do not repeatedly call a tool while billing setup is incomplete.
- If the Searchata tools are not available in this session, ask the user to
  start a new agent session.
- In a session with the tools loaded, call `google_search_console_list_properties`
  before the first Google data request.
- Call `bing_webmaster_tools_list_sites` before the first Bing data request.
