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, GitHub Copilot, Gemini CLI)
  • An Affinity API key — see the Authentication page for help obtaining one
  • UV Python package manager
The local MCP server runs on your machine via STDIO using your Affinity API key. Looking for the hosted (no-install) option? See the Hosted Setup guide.
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.