Skip to main content
Prerequisites Before you begin, create an account and get your API Key.

Getting started

Connect to Affinity CRM to manage relationships, track deals, and organize contacts through AI agents.
  • API
  • UI
  • Open Source
1

Install the SDKs (optional)

pip install klavis
2

Create a Strata MCP Server with Affinity

from klavis import Klavis
from klavis.types import McpServerName

klavis_client = Klavis(api_key="YOUR_API_KEY")

# Create a Strata MCP server with Affinity
response = klavis_client.mcp_server.create_strata_server(
    servers=[McpServerName.AFFINITY],
    user_id="user123"
)

API Reference

Full Strata API endpoints
3

Authenticate with API Key

klavis_client.mcp_server.set_strata_auth(
    strata_id=response.strata_id,
    server_name=McpServerName.AFFINITY,
    auth_data={
        "api_key": "YOUR_AFFINITY_API_KEY"
    }
)
Get your Affinity API key from your Affinity Settings.
🎉 Your Affinity MCP Server is ready! Once authentication is complete, you can use your MCP server URL with any MCP-compatible client.

Available Tools

Tool NameDescription
affinity_get_current_userGet current user information from Affinity
affinity_get_all_list_entries_on_a_listGet all List Entries on a List
affinity_get_metadata_on_all_listsGet metadata on all Lists
affinity_get_metadata_on_a_single_listGet metadata on a single List
affinity_get_metadata_on_a_single_list_fieldsGet metadata on a single List’s Fields
affinity_get_a_single_list_entry_on_a_listGet a single List Entry on a List
affinity_get_all_personsGet all Persons in Affinity
affinity_get_single_personGet a single Person by ID
affinity_get_person_fields_metadataGet metadata on Person Fields
affinity_get_person_listsGet a Person’s Lists
affinity_get_person_list_entriesGet a Person’s List Entries
affinity_get_all_companiesGet all Companies in Affinity with basic information and field data
affinity_get_single_companyGet a single Company by ID with basic information and field data
affinity_get_company_fields_metadataGet metadata on Company Fields
affinity_get_company_listsGet all Lists that contain the specified Company
affinity_get_company_list_entriesGet List Entries for a Company across all Lists with field data
affinity_get_all_opportunitiesGet all Opportunities in Affinity
affinity_get_single_opportunityGet a single Opportunity by ID
affinity_search_personsSearch for persons in Affinity. Search term can be part of an email address, first name, or last name
affinity_search_organizationsSearch for organizations / companies in Affinity. Search term can be part of organization name or domain
affinity_search_opportunitiesSearch for opportunities in Affinity. Search term can be part of opportunity name
affinity_get_all_notesGet all Notes in Affinity
affinity_get_specific_noteGet a specific note by ID
For more details about tool input schema, use the get_tools API.

Next Steps

I