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

# Connecting MCP Clients

> Connect Claude Desktop, Claude Code, and Cursor to the Afriex MCP server

Connect your MCP client to the Afriex MCP server at `https://mcp.afriex.com/mcp`.

There are two ways to provide your API key:

* **HTTP headers**: pass your API key directly in the client config. The server stores these values for the session and uses them for all Business API calls. Recommended when your client supports custom headers.
* **`authenticate` tool**: call the `authenticate` tool as your first action after connecting. Works with all clients.

<AccordionGroup>
  <Accordion title="Claude Desktop">
    Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):

    **With HTTP headers (recommended):**

    ```json theme={null}
    {
      "mcpServers": {
        "afriex": {
          "url": "https://mcp.afriex.com/mcp",
          "headers": {
            "x-afriex-api-key": "your-api-key",
            "x-afriex-environment": "production"
          }
        }
      }
    }
    ```

    **With `authenticate` tool:**

    ```json theme={null}
    {
      "mcpServers": {
        "afriex": {
          "url": "https://mcp.afriex.com/mcp"
        }
      }
    }
    ```

    Restart Claude Desktop. The Afriex tools will appear in the tools menu. Then call the `authenticate` tool:

    ```json theme={null}
    {
      "apiKey": "your-api-key",
      "environment": "production"
    }
    ```
  </Accordion>

  <Accordion title="Claude Code">
    **With HTTP headers (recommended):**

    Add to `.claude/settings.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "afriex": {
          "url": "https://mcp.afriex.com/mcp",
          "headers": {
            "x-afriex-api-key": "your-api-key",
            "x-afriex-environment": "production"
          }
        }
      }
    }
    ```

    **With `authenticate` tool:**

    ```bash theme={null}
    claude mcp add afriex --transport http https://mcp.afriex.com/mcp
    ```

    Or add manually to `.claude/settings.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "afriex": {
          "url": "https://mcp.afriex.com/mcp"
        }
      }
    }
    ```

    Then call the `authenticate` tool:

    ```json theme={null}
    {
      "apiKey": "your-api-key",
      "environment": "production"
    }
    ```
  </Accordion>

  <Accordion title="Cursor">
    **With HTTP headers (recommended):**

    Add to `.cursor/mcp.json` in your project root:

    ```json theme={null}
    {
      "mcpServers": {
        "afriex": {
          "url": "https://mcp.afriex.com/mcp",
          "headers": {
            "x-afriex-api-key": "your-api-key",
            "x-afriex-environment": "production"
          }
        }
      }
    }
    ```

    **With `authenticate` tool:**

    Go to **Cursor Settings → MCP → Add new MCP Server**, select **Type: URL**, and enter `https://mcp.afriex.com/mcp`.

    Or add manually to `.cursor/mcp.json`:

    ```json theme={null}
    {
      "mcpServers": {
        "afriex": {
          "url": "https://mcp.afriex.com/mcp"
        }
      }
    }
    ```

    Then call the `authenticate` tool:

    ```json theme={null}
    {
      "apiKey": "your-api-key",
      "environment": "production"
    }
    ```
  </Accordion>
</AccordionGroup>
