Affinity

Live

BEARER TOKEN

CRM

CRM & Sales

Every deal, relationship, and pipeline signal your team tracks lives in Affinity. Affinity MCP gives your agent authenticated access to deal flow scoped to the user who authorized it.

  • Acts as the user: Access and write actions stay tied to the Affinity account that authorized the agent.
  • Credentials stay vaulted: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: User permissions enforced. 90-day audit trail.
Affinity
agent · Acme Q3
Run
Which deals in our active pipeline have had no contact in the last 14 days?
S
affinity_list_entries_get
84ms
Deal flow agent
4 deals at risk: Acme Series B ($2.5M, last touch 18d), Globex Seed ($800K, 16d), Initech Bridge ($1.2M, 21d), Stark Pre-A ($600K, 15d).
Sources: 4 opportunities, 1 pipeline
affinitymcp
4 deals
18:29
Message Claude...

Tools your deal flow agent reaches for on Affinity, scoped per user.

CALL ANY TOOL
Search lists, persons, organizations, and opportunities. Create notes and track touchpoints.
affinity_add_to_list
List add to
Add a person or organization to an Affinity list by creating a new list entry. Use this to add a founder to a deal pipeline, add a company to a watchlist, or track a new contact in a relationship list. Provide either entity_id for persons/organizations.
Parameters
Name
Type
Required
Description
entity_id
integer
Required
ID of the person or organization to add to the list
list_id
integer
Required
ID of the Affinity list to add the entity to
affinity_create_note
Create note
affinity_create_organization
Create organization
affinity_delete_opportunity
Delete opportunity
affinity_delete_person
Delete person
affinity_get_opportunity
Get opportunity
affinity_get_organization
Get organization
affinity_get_relationship_strength
Get relationship strength
affinity_list_lists
List lists
affinity_list_opportunities
List opportunities
affinity_note_update
Update note
affinity_search_organizations
Search organizations
affinity_search_persons
Search persons
affinity_update_opportunity
Update opportunity
affinity_update_person
Update person
affinity_v2_get_company
V2 get company
affinity_v2_get_company_field_value
V2 get company field value
affinity_v2_get_current_user
V2 get current user
affinity_v2_get_person_field_dropdown_options
V2 get person field dropdown options
affinity_v2_list_companies
V2 list companies
affinity_v2_list_company_field_values
V2 list company field values
affinity_v2_list_company_list_entries
V2 list company list entries
affinity_v2_list_company_notes
V2 list company notes
affinity_v2_list_company_relationships
V2 list company relationships
affinity_v2_list_person_field_values
V2 list person field values
affinity_v2_list_person_list_entries
V2 list person list entries
affinity_v2_list_person_lists
V2 list person lists
affinity_v2_list_person_relationships
V2 list person relationships
affinity_v2_search_companies
V2 search companies
affinity_v2_update_company_field_value
V2 update company field value

For more tools, view docs.

Build your Agent
Drop the toolkit in, point it at the user, and your deal flow agent can use Affinity from the first run.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { DynamicStructuredTool } from "@langchain/core/tools";
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import { z } from "zod";

const sk = new ScalekitClient(envUrl, clientId, clientSecret);

const { tools } = await sk.tools.listScopedTools("user_123", {
filter: { connectionNames: ["affinity"], toolNames: ["affinity_lists_get", "affinity_list_entries_get", "affinity_persons_get"] },
pageSize: 100,
});

const lcTools = tools.map((t) => new DynamicStructuredTool({
name: t.tool.definition.name,
description: t.tool.definition.description,
schema: z.object({}).passthrough(),
func: async (args) => {
const { data } = await sk.tools.executeTool({
toolName: t.tool.definition.name,
identifier: "user_123",
params: args,
});
return JSON.stringify(data);
},
}));

const agent = createReactAgent({ llm, tools: lcTools });
import { ScalekitClient } from "@scalekit-sdk/node";
import OpenAI from "openai";

const sk = new ScalekitClient(envUrl, clientId, clientSecret);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
filter: { connectionNames: ["affinity"], toolNames: ["affinity_lists_get", "affinity_list_entries_get", "affinity_persons_get"] },
pageSize: 100,
});

const llmTools = tools.map((t) => ({
type: "function",
function: {
name: t.tool.definition.name,
description: t.tool.definition.description,
parameters: t.tool.definition.input_schema,
},
}));

const resp = await openai.responses.create({
model: "gpt-4o", input: prompt, tools: llmTools,
});
import { ScalekitClient } from "@scalekit-sdk/node";
import Anthropic from "@anthropic-ai/sdk";

const sk = new ScalekitClient(envUrl, clientId, clientSecret);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
filter: { connectionNames: ["affinity"], toolNames: ["affinity_lists_get", "affinity_list_entries_get", "affinity_persons_get"] },
pageSize: 100,
});

const llmTools = tools.map((t) => ({
name: t.tool.definition.name,
description: t.tool.definition.description,
input_schema: t.tool.definition.input_schema,
}));

const msg = await anthropic.messages.create({
model: "claude-sonnet-4-6", max_tokens: 1024,
tools: llmTools,
messages: [{ role: "user", content: prompt }],
});
import { Agent } from "@google/adk/agents";
import {
MCPToolset, StreamableHTTPConnectionParams,
} from "@google/adk/tools/mcp";

const toolset = new MCPToolset({
connectionParams: new StreamableHTTPConnectionParams({
url: "https://mcp.scalekit.com/affinity",
headers: { Authorization: `Bearer ${userScopedToken}` },
}),
});

const agent = new Agent({
name: "agent", model: "gemini-2.0-flash",
tools: await toolset.getTools(),
});
Try these prompts
Paste any prompt into your agent to start using Affinity.
Search & recall
Copy the prompt
Copied
List all deals in the [pipeline name] list.
Copy the prompt
Copied
Find all persons at [company name].
Copy the prompt
Copied
Which organizations are in our active pipeline?
Copy the prompt
Copied
Get last touchpoint for [deal name].
Action & updates
Copy the prompt
Copied
Add a note to [person]: [note text].
Copy the prompt
Copied
Update the stage on [deal name] to [stage].
Copy the prompt
Copied
Create an opportunity for [company] at [$amount].
Copy the prompt
Copied
Tag [organization] with [list name].
Pipeline & reporting
Copy the prompt
Copied
Which deals have had no contact in 14+ days?
Copy the prompt
Copied
List all opportunities closing this quarter.
Copy the prompt
Copied
Show me top 10 persons by interaction count.
Copy the prompt
Copied
What deals are in the [stage] stage right now?
SEE HOW AUTH WORKS
Users authorize Affinity once. Their credentials stay vaulted, every call is checked, and every action is logged.
1
Authorize
Your user connects
Affinity
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Affinity
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Affinity
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Affinity
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
Same per-user auth pattern across other deal flow agents and MCP connectors. Working code, live demos, fork what fits.
GTM and RevOps Teams
CRM AI agent
Reads the Granola transcript after every call, extracts next steps and updates the HubSpot record, drafts the follow-up in Gmail, and confirms in Slack, all on the rep's own delegated OAuth.
GTM and RevOps Teams
Deal intelligence agent
Pulls recent Gong calls, scores deal risk with an LLM, cross-references the record in Attio, and DMs each owner their at-risk deals in Slack. Every read is scoped to that rep's own access.
GTM and RevOps Teams
Sales call prep agent
Reads tomorrow's calls from Google Calendar, mines past Granola notes and Attio history for context, and delivers each rep a prep brief in Slack, scoped to the calls that rep actually owns.
GTM and RevOps Teams
Outbound prospecting agent
Searches Apollo for prospects matching your ICP, scores and ranks them, drafts personalized outreach in Gmail, and logs every send to Google Sheets. Mail goes out as the rep, not from a shared inbox.
Test other agents
Same per-user auth pattern across other deal flow agents and MCP connectors. Working code, live demos, fork what fits.
GTM
CRM AI agent
Turn each Granola call transcript into a HubSpot record update, a drafted Gmail follow-up, and a Slack recap.
SALES
Deal intelligence agent
Score Gong call risk with an LLM, cross-reference the Attio record, and DM each owner their at-risk deals in Slack.
SALES
Sales call prep agent
Read tomorrow's calls from Google Calendar, mine Granola notes and Attio history, and deliver each rep a prep brief in Slack.
SALES
Outbound prospecting agent
Search Apollo for ICP matches, rank them, draft personalised Gmail outreach, and log every send to Google Sheets.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Relationship notes logged as a bot
A shared Affinity token looks fine in a demo. In production, every person or deal retrieved looks like it came from a service account. Audit logs break. Per-user scoping breaks. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared bot token
token = "sk_affinity_shared_xxx"
audit → bot_service_account
user_filter → broken

// scalekit · per-user
token = resolve(user_id)
audit → user_abc
scope → enforced ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Affinity today. HubSpot, Salesforce, Attio tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions

Does the agent access Affinity as the user or as a shared key?
As the user. Each workspace member authorizes once and Scalekit resolves their credential at request time. Audit logs attribute every action to that user, not a shared service account.

Where is the Affinity bearer token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. Refresh is automatic. Revocation is a single dashboard action. Tokens never appear in prompts, logs, or LLM context.

Can I limit what the agent is allowed to do in Affinity?
Yes. Pass a tool name filter to listScopedTools so the deal flow agent only sees the subset you authorize. Pre-API-call scope checks block out-of-policy actions before the request reaches Affinity.

What happens when a user revokes Affinity access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.

Does the agent respect Affinity list-level permissions?
Yes. Each tool call runs as the authorizing user with their Affinity role. List-level access, field permissions, and team scoping all apply. Cross-team data stays denied at the Affinity layer.

Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""affinity"": {
""url"": ""https://mcp.scalekit.com/affinity"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.affinity]
url = ""https://mcp.scalekit.com/affinity""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""affinity"": {
""url"": ""https://mcp.scalekit.com/affinity"",
""type"": ""http""
}
}
}