crm
Affinity MCP, CLI, and Lua Integration for AI Agents
Affinity integration docs for AI agents: MCP gateway setup, Affinity CLI commands, Lua API reference, credentials, and function schemas.
8 functions 6 read 2 write API key auth
Affinity for agents
Credentials can be configured manually in web or CLI hosts.
Use this integration from Lua code mode, the headless integrations CLI, or the KosmoKrator MCP gateway. The same package metadata powers all three surfaces.
Machine-Readable Metadata
- integration_slug
affinity- route_slug
affinity- package
affinity- auth_strategy
api_keyAPI key- cli_setup_supported
true- cli_runtime_supported
true- mcp_gateway_supported
true- lua_supported
true- supports_multi_account
true
Quick Links
Lua APIAgent-facing namespace and function reference. Affinity CLIHeadless setup and direct function calls. Affinity MCPMCP gateway setup for external clients. Submit feedbackReport missing tools, auth problems, wrong docs, or runtime issues. ContributeAdd tools or improve metadata in the integrations repo.
Affinity MCP Client Matrix
Use these pages when a specific agent client or framework needs copy-pasteable MCP setup for Affinity.
Claude Code Affinity MCP setup for Claude Code. Cursor Affinity MCP setup for Cursor. Codex Affinity MCP setup for Codex. OpenAI Agents Affinity MCP setup for OpenAI Agents SDK. Claude Agent SDK Affinity MCP setup for Claude Agent SDK. Vercel AI SDK Affinity MCP setup for Vercel AI SDK. LangChain Affinity MCP setup for LangChain. LangGraph Affinity MCP setup for LangGraph. CrewAI Affinity MCP setup for CrewAI. MCP clients Affinity MCP setup for Generic MCP Clients.
Affinity CLI Matrix
Use these pages for direct Affinity CLI workflows in scripts, CI, cron, and agent wrappers.
CI Affinity CLI for CI. Cron Jobs Affinity CLI for cron jobs. Shell Scripts Affinity CLI for shell scripts. Headless Automation Affinity CLI for headless automation. Coding Agents Affinity CLI for coding agents.
Function Catalog
| Function | Type | Parameters | Description |
|---|---|---|---|
affinity.affinity_list_contacts | Read read | 2 | List contacts from Affinity CRM. Returns contact names, emails, phone numbers, and associated organizations. Use pagination to retrieve large result sets. |
affinity.affinity_get_contact | Read read | 1 | Get details for a specific contact in Affinity by its ID. Returns the contact's full profile including name, emails, phone numbers, organization, and custom fields. |
affinity.affinity_create_contact | Write write | 4 | Create a new contact in Affinity CRM. Provide at least a first name or last name. Optionally include email addresses. |
affinity.affinity_list_organizations | Read read | 2 | List organizations from Affinity CRM. Returns organization names, domains, and details. Use pagination to retrieve large result sets. |
affinity.affinity_get_organization | Read read | 1 | Get details for a specific organization in Affinity by its ID. Returns the organization's full profile including name, domain, people, and custom fields. |
affinity.affinity_create_organization | Write write | 2 | Create a new organization in Affinity CRM. Provide a name (required) and optionally a domain. |
affinity.affinity_list_lists | Read read | 0 | List all lists in Affinity CRM. Returns list names, types (contact or organization), and ownership details. |
affinity.affinity_get_current_user | Read read | 0 | Get the currently authenticated Affinity user's profile. Useful for verifying API credentials and identifying the active account. |