Affinity

Live

BEARER TOKEN

CRM

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_list_entries_get
Get list entries
Fetch entries (deals, people, companies) in a specific list.
Parameters
Name
Type
Required
Description
list_id
integer
Required
Affinity list ID
page_size
integer
Optional
Max entries per page
affinity_persons_get
Get persons
affinity_organizations_get
Get organizations
affinity_opportunities_get
Get opportunities
affinity_notes_create
Create note
affinity_lists_get
List lists
Build your Agent
Drop the toolkit in, point it at the user, and your deal flow agent can use Affinity from the first run.
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
CRM AI agent
Log calls, update opportunity stages, and surface stalled deals across HubSpot or Salesforce. No manual data entry.
SALES
Deal intelligence agent
Combine Gong, Attio, and Slack signals to surface deal risks and next-best actions. Updated after every call.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
Other connector libraries treat auth as a demo afterthought. Scalekit starts with user identity, scope enforcement, and audit.
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
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?
Can I limit what the agent is allowed to do in Affinity?
What happens when a user revokes Affinity access?
Does the agent respect Affinity list-level permissions?
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""
}
}
}