Skip to main content
The Affinity MCP Server authenticates using your Affinity API key, passed as an environment variable.

Obtaining Your API Key

  1. Log in to your Affinity account
  2. Navigate to SettingsManage Apps
  3. Click New App and enter a name (e.g. John’s MCP) and a description (e.g. API key for my MCP server connected to Claude). API version and IP Allowlist can be left blank.
  4. Copy the generated API key
Add New App dialog in Affinity Settings

Troubleshooting Auth Errors

”Authentication failed” or 401 errors

  • Cause: The AFFINITY_API_KEY is missing, invalid, or has extra spaces/quotes.
  • Fix: Double-check the environment variable value in your client config. The key should be a plain string with no surrounding quotes or whitespace.