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

# Connect with an API key

> Connect The Swarm MCP from any client that supports custom HTTP headers, using your team's API key instead of OAuth.

The Swarm MCP accepts your team's API key in an `x-api-key` header, so any client that can send custom headers to a remote MCP server can connect — no OAuth consent screen and no Client ID required.

Use this route for Cursor, Claude Code, VS Code, automation platforms, or your own code. If you're on Claude or ChatGPT, use OAuth instead: [Connect in Claude](/docs/mcp/connect-claude) · [Connect in ChatGPT](/docs/mcp/connect-chatgpt).

## Before you start

* A **Swarm account** with the MCP integration enabled on your plan. If you're not sure, contact [support@theswarm.com](mailto:support@theswarm.com).
* A **team API key**. Generate one under **Team Settings → [API](https://app.theswarm.com/team-settings/api)** — this requires Owner or Admin access. See [Get your API key](/docs/getting-started/quickstart#get-your-api-key).
* An MCP client that supports a **remote (HTTP) server with custom headers**.

## Server details

|                 |                                |
| --------------- | ------------------------------ |
| **URL**         | `https://bee.theswarm.com/mcp` |
| **Transport**   | Streamable HTTP                |
| **Auth header** | `x-api-key: your_api_key_here` |

## Configuration

Most clients read a JSON config file. The shape below is the common one — check your client's docs for the exact file location and key name.

<CodeGroup>
  ```json JSON config theme={null}
  {
    "mcpServers": {
      "theswarm": {
        "url": "https://bee.theswarm.com/mcp",
        "headers": {
          "x-api-key": "your_api_key_here"
        }
      }
    }
  }
  ```

  ```bash Claude Code theme={null}
  claude mcp add --transport http theswarm https://bee.theswarm.com/mcp \
    --header "x-api-key: your_api_key_here"
  ```

  ```bash curl theme={null}
  curl -X POST https://bee.theswarm.com/mcp \
    -H "x-api-key: your_api_key_here" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json, text/event-stream" \
    -d '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "tools/list"
    }'
  ```
</CodeGroup>

<Info>
  Some clients store headers under a different key (`requestInit.headers`, `env`, or a dedicated headers field in the UI). If yours doesn't expose headers at all, use OAuth — or email us to have a Client ID registered for it.
</Info>

## Verify the connection

Open a new chat in your client and check the tools list — you should see The Swarm's tools. Try a quick prompt:

> "Find VP-level product leaders at Series B SaaS companies in London."

The `curl` example above is the fastest way to confirm the key and endpoint work on their own, independently of any client.

See [Tools & prompts](/docs/mcp/tools-and-prompts) for the full tool list and more examples.

## Credits and permissions

Billing is identical for both authentication methods — 1 credit per successful search on `find_profiles`, `find_companies`, and `partner_network_mapper`, with empty results free. See [Credits and cost](/docs/mcp/overview#credits-and-cost).

The connection is read-only and scoped to the team the key belongs to.

## Rotate or revoke

Generate a new key under **Team Settings → [API](https://app.theswarm.com/team-settings/api)**, then update the header in your client config. Revoking a key immediately cuts off every client using it.

## Troubleshooting

* **401 / unauthorized** — the key is wrong, or it was rotated. Copy it again from Team Settings → API and confirm the header name is exactly `x-api-key`.
* **Server connects but no tools appear** — restart the client so it re-runs discovery. If it still fails, run the `curl` call above: if that returns tools, the problem is in your client config.
* **Client sends no headers** — check the config field name, or confirm your client supports custom headers on remote MCP servers at all.
* **Plan or permission errors** — confirm your Swarm plan includes MCP access, and that the key was generated by an Owner or Admin.

## Need help?

Contact [support@theswarm.com](mailto:support@theswarm.com) and include your client (Cursor, Claude Code, etc.) and a description of what you were trying to do. Don't send us your API key.
