crm
Affinity MCP Integration for OpenAI Agents SDK
Connect Affinity to OpenAI Agents SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.
Connect Affinity to OpenAI Agents SDK
Attach KosmoKrator integration tools to OpenAI Agents SDK workflows through a local MCP gateway.
Start the KosmoKrator MCP gateway locally and point the OpenAI Agents SDK MCP tool at that process or wrapper. The gateway is local, scoped to this integration, and starts with
--write=deny so OpenAI Agents can inspect read-capable tools without receiving write access by default.
Affinity MCP Config for OpenAI Agents SDK
Use headless JSON commands for CI-style execution and MCP for agent tool discovery.
{
"mcpServers": {
"kosmokrator-affinity": {
"type": "stdio",
"command": "kosmo",
"args": [
"mcp:serve",
"--integration=affinity",
"--write=deny"
]
}
}
} Run the Gateway Manually
kosmokrator mcp:serve --integration=affinity --write=deny Why Use KosmoKrator Here
Expose only Affinity instead of a broad multi-service tool list.
Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.
Start read-only, then opt into ask or allow for trusted workspaces.
Affinity Tools Visible to OpenAI Agents
OpenAI Agents sees stable MCP tool names generated from the Affinity integration catalog.
| MCP tool | Source function | Type | Description |
|---|---|---|---|
integration__affinity__affinity_list_contacts | affinity.affinity_list_contacts | Read | List contacts from Affinity CRM. Returns contact names, emails, phone numbers, and associated organizations. Use pagination to retrieve large result sets. |
integration__affinity__affinity_get_contact | affinity.affinity_get_contact | Read | 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. |
integration__affinity__affinity_create_contact | affinity.affinity_create_contact | Write | Create a new contact in Affinity CRM. Provide at least a first name or last name. Optionally include email addresses. |
integration__affinity__affinity_list_organizations | affinity.affinity_list_organizations | Read | List organizations from Affinity CRM. Returns organization names, domains, and details. Use pagination to retrieve large result sets. |
integration__affinity__affinity_get_organization | affinity.affinity_get_organization | Read | Get details for a specific organization in Affinity by its ID. Returns the organization's full profile including name, domain, people, and custom fields. |
integration__affinity__affinity_create_organization | affinity.affinity_create_organization | Write | Create a new organization in Affinity CRM. Provide a name (required) and optionally a domain. |
integration__affinity__affinity_list_lists | affinity.affinity_list_lists | Read | List all lists in Affinity CRM. Returns list names, types (contact or organization), and ownership details. |
integration__affinity__affinity_get_current_user | affinity.affinity_get_current_user | Read | Get the currently authenticated Affinity user's profile. Useful for verifying API credentials and identifying the active account. |