Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developer.affinity.co/llms.txt

Use this file to discover all available pages before exploring further.

Prerequisites

  • An Affinity account with API access (Scale, Advanced, or Enterprise)
  • An MCP-compatible AI assistant (e.g., Claude Desktop, Copilot, Gemini CLI)
  • An Affinity API key. See the Authentication page for help obtaining one
  • UV Python package manager
Switching to the hosted MCP server? If you currently run Affinity locally and want to move to the hosted server, first remove the existing affinity-mcp configuration from your AI client (consult your client’s documentation for steps), then follow the appropriate guide under Setup by Client.
Run the following command with your API key filled in. The --scope user flag registers the server for your user account so it’s available in all your projects.
claude mcp add affinity-mcp \
    --scope user \
    --transport stdio \
    --env AFFINITY_API_KEY=your_api_key_here \
    -- uvx affinity-mcp
Omit --scope user to register the server for the current project only.Verify the server is connected:
claude mcp list
You should see:
affinity-mcp: uvx affinity-mcp - ✓ Connected

OpenTelemetry (Optional)

The server supports OpenTelemetry tracing. To export telemetry data to an OTLP-compatible collector, set the OTEL_EXPORTER_OTLP_ENDPOINT environment variable alongside your API key in your client config. Example:
"env": {
  "AFFINITY_API_KEY": "your_api_key_here",
  "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4317"
}
If OTEL_EXPORTER_OTLP_ENDPOINT is not set, telemetry export is disabled and the server operates normally without it.

Other Clients

See MCP Clients for a full list of compatible clients.