affinity-mcp-workflows

affinity-mcp-workflows is a skill for Claude Code from yaniv-golan/affinity-sdk. It costs 52 tokens per session (3,321 once invoked), scanned B, original, MIT.

A primary workflow for accessing Affinity CRM data through its MCP tools, which let an agent discover and use the CRM's available commands.

In plain words
What is it for?
Discovering CRM commands, reading or writing records, running queries, and assembling detailed information about people, companies, or interactions.
Why use it?
It checks the current data model and command syntax before querying or changing data, reducing errors caused by outdated assumptions or commands.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Part of the affinity-crm-mcp-unofficial plugin — 3 skills, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/yaniv-golan/affinity-sdk/affinity-mcp-workflows
Any agent
npx skills add yaniv-golan/affinity-sdk --skill affinity-mcp-workflows
Clone the repo
git clone --depth 1 https://github.com/yaniv-golan/affinity-sdk

Made for: Claude Code.

Or install affinity-crm-mcp-unofficial, the plugin that ships this one along with the rest of its 3 skills, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for affinity-mcp-workflows

README.md
[![agentmods](https://agentmods.dev/badge/skills/yaniv-golan/affinity-sdk/affinity-mcp-workflows.svg)](https://agentmods.dev/skills/yaniv-golan/affinity-sdk/affinity-mcp-workflows)
Your own site
<a href="https://agentmods.dev/skills/yaniv-golan/affinity-sdk/affinity-mcp-workflows"><img src="https://agentmods.dev/badge/skills/yaniv-golan/affinity-sdk/affinity-mcp-workflows.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,321 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.03321
Opus 5 $0.00026 $0.01661
Sonnet 5 $0.00010 $0.00664
Haiku 4.5 $0.00005 $0.00332

Measured 5d ago against content hash da407c2bc387, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

affinity-mcp-workflows scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

**Before proceeding to execute any commands:**
mcp/.claude-plugin/skills/affinity-mcp-workflows/SKILL.md · 293 lines

How it starts

The opening of the file, as written. The whole thing — 293 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Affinity MCP Workflows

Prerequisites

The MCP server requires the xaffinity CLI to be installed:

pip install "affinity-sdk[cli]"

The CLI must be configured with an API key before the MCP server will work.

⚠️ REQUIRED WORKFLOW - Do Not Skip Steps

You MUST complete steps 1-2 before running ANY queries or commands.

Skipping these steps leads to incorrect or inefficient queries because:

  • Command syntax may have changed since this skill was written
  • New flags (like --with-interaction-dates) may exist that you don't know about
  • You may use deprecated syntax that returns incomplete data
  • The data model has nuances (e.g., list export vs company ls) that you'll miss

Mandatory Pre-Flight Checklist

Before proceeding to execute any commands:

  1. ✅ Read xaffinity://data-model using read-xaffinity-resource
  2. ✅ Run discover-commands for your specific task
  3. ✅ State what you learned from each step before continuing

Example:

"I read the data-model resource and learned that list entries have custom fields
accessed via fields.<Name>. I ran discover-commands for 'interaction' and found
that interaction ls supports --type all to fetch all types in one call, and
--days to limit the time range. Now I'll proceed with..."

IMPORTANT: Write Operations Only After Explicit User Request

Only use tools or prompts that modify CRM data when the user explicitly asks to do so.

Write operations include:

  • Tools: execute-write-command
  • Prompts: log-interaction-and-update-workflow, change-status, log-call, log-message

Read-only operations (search, lookup, briefings) can be used proactively to help the user. But never create, update, or delete CRM records unless the user specifically requests it.

Full Scan Protection

The MCP gateway enforces pagination limits to prevent unbounded data scans:

Limit Value Description
Default 1000 records Applied when no --max-results specified
Maximum 10000 records Higher values are capped with a warning
--all flag BLOCKED Use --max-results or cursor pagination instead

Read the full file on GitHub · 293 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 293 lines · 52 tokens per session scan B da407c2bc387

Subscribe to this mod's changes

affinity-mcp-workflows is a skill published in the GitHub repository yaniv-golan/affinity-sdk (0 stars, last pushed 1mo ago), licensed MIT. It adds 52 tokens to every session and 3,321 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (unrestricted tool access). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

merit-lhv

How to pull an LHV bank statement straight into Merit Aktiva without touching a file export — LHV's own MCP server returns camt.053 XML, which is exactly what Merit's bank-statement import accepts. Covers connecting LHV (OAuth2 + Smart-ID, read-only), the 31-day window, the multi-currency trap, and where the statement…

Elnora-AI/elnora-merit-aktiva · 227 tokens

merit-payments-bank

How to record payments and reconcile the bank statement correctly in Merit Aktiva (maksed / pank) via the elnora-merit CLI. The core skill is choosing the right transaction type for each line — customer receipt, vendor/tax payment, other income, or other expenditure — plus bank-statement import, settlements…

Elnora-AI/elnora-merit-aktiva · 215 tokens

merit-stripe

How Stripe payments must be set up and recorded in Merit Aktiva — the canonical clearing-account method. Stripe is a payment intermediary, not your bank: never book the bank deposit as revenue (it arrives NET of fees). Each Stripe payout is booked as ONE summary GL batch — gross card sales as revenue + output VAT…

Elnora-AI/elnora-merit-aktiva · 201 tokens

merit-tsd

The Estonian TSD (tulu- ja sotsiaalmaksu deklaratsioon) annexes that are NOT payroll: lisa 5 (gifts, donations, entertainment/vastuvõtukulud) and lisa 6 (expenses unrelated to business — fines, sunniraha, tax-authority interest). Covers what makes a TSD mandatory for a month, the 22/78 gross-up, the exact e-MTA form…

Elnora-AI/elnora-merit-aktiva · 298 tokens

merit-vat-kmd

How VAT and the Estonian VAT return (käibedeklaratsioon / KMD) work in Merit Aktiva, and how to get them right from the elnora-merit CLI. Covers the tax-code model, paying the VAT, what feeds each KMD line, time-of-supply, and pulling supporting VAT figures. The KMD itself is generated and filed in the Merit UI — the…

Elnora-AI/elnora-merit-aktiva · 213 tokens

merit-palk-employees

How to onboard employees and maintain contracts, contacts, and base salary agreements in Merit Palk via elnora-merit palk. Covers the sendemployees-vs-sendpayterms distinction, required import codes, and reading the employee / agreement lists. Use when: adding a new employee, creating a first contract, setting or…

Elnora-AI/elnora-merit-aktiva · 159 tokens