## How to authenticate

Add the UseAgents MCP server to your agent’s config with the API key in headers:

```
{
  "mcpServers": {
    "useagents": {
      "url": "https://mcp.useagents.site/mcp",
      "headers": {
        "x-api-key": "YOUR_API_KEY"
      }
    }
  }
}
```

Replace `YOUR_API_KEY` with the API key from your [dashboard](/content/dashboard/index.html).

## Verify the connection

After saving the config:

1. Restart the MCP-compatible client if needed.
2. Confirm the `useagents` server is available in the client.
3. Ask the agent to use `search_tools` with a simple query.
4. Confirm you receive results instead of an authentication error.

## Get an API key

1. Go to [useagents.site](/content/site-root.html) and sign in.
2. Create or select an organization.
3. Open **Settings** → **API Keys**.
4. Create a new API key and copy it immediately. You will not be able to see it again.

API keys are organization-scoped. Use the same key for all tools in that organization.

## Client-specific setup

For step-by-step instructions for Cursor, Claude Desktop, Windsurf, and similar clients, see [Connecting the MCP Server](/content/docs/mcp/connecting/index.html).

## Security

- **Store keys securely**: Never commit API keys to version control.
- **Rotate if exposed**: Create a new key and revoke the old one if you suspect exposure.
- **Use separate keys**: Consider different keys for development and production.

## Troubleshooting

- **Authentication failed**: Check that the header name is exactly `x-api-key`.
- **No tools appear**: Restart the client after editing the MCP configuration.
- **Still failing**: Generate a new key and replace the old one in your config.
