affinity-sdkBLOCK
Unofficial strongly-typed Python SDK for the Affinity CRM API - full read/write coverage, Pydantic v2, MCP server included. For when you need more than Affinity's official MCP
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://github.com/yaniv-golan/affinity-sdk/actions/workflows/ci.yml) [](https://codecov.io/gh/yaniv-golan/affinity-sdk) [](https://pypi.org/project/affinity-sdk/) [](https://pypi.org/project/affinity-sdk/) [](https://opensource.org/licenses/MIT) [](https://mypy-lang.org/) [](https://docs.pydantic.dev/) [](https://yaniv-golan.github.io/affinity-sdk/latest/) [](https://yaniv-golan.github.io/affinity-sdk/latest/mcp/) [](https://github.com/yaniv-golan/mcp-bash-framework) [](https://yaniv-golan.github.io/affinity-sdk/latest/guides/claude-code-plugins/) [](https://github.com/yaniv-golan/skill-creator-plus)
A modern, strongly-typed Python wrapper for the Affinity CRM API.
Disclaimer: This is an unofficial community project and is not affiliated with, endorsed by, or sponsored by Affinity. “Affinity” and related marks are trademarks of their respective owners. Use of the Affinity API is subject to Affinity’s Terms of Service.
Maintainer: GitHub: yaniv-golan
Documentati
4b00ae256703OBSERVED · 2026-10-10Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add affinity-sdk --env AFFINITY_API_KEY=${AFFINITY_API_KEY} --env AFFINITY_API_KEY_COMMAND=${AFFINITY_API_KEY_COMMAND} --env AFFINITY_API_KEY_COMMAND_TIMEOUT=${AFFINITY_API_KEY_COMMAND_TIMEOUT} --env AFFINITY_API_KEY_FILE=${AFFINITY_API_KEY_FILE} -- uvx affinity-sdk{
"mcpServers": {
"affinity-sdk": {
"command": "uvx",
"args": [
"affinity-sdk"
],
"env": {
"AFFINITY_API_KEY": "${AFFINITY_API_KEY}",
"AFFINITY_API_KEY_COMMAND": "${AFFINITY_API_KEY_COMMAND}",
"AFFINITY_API_KEY_COMMAND_TIMEOUT": "${AFFINITY_API_KEY_COMMAND_TIMEOUT}",
"AFFINITY_API_KEY_FILE": "${AFFINITY_API_KEY_FILE}"
}
}
}
}Trust audit
BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | FAIL |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (2 observation(s))
- Network
- declared (7 observation(s))
- Shell
- declared (2 observation(s))
- Dependencies
- pinned
- Secrets in source
- found
Findings (18)
script = "eval (env _XAFFINITY_COMPLETE=fish_source xaffinity)\n"
".env" ... httpx.
skipped and the flag that fetches it. Never tell the user a record "has no lists" or "empty fields"
secret = "super-secret-api-key"
.pre-commit-config.yaml
.env.test.example
key_hash = hashlib.md5(key.encode()).hexdigest()[:8]
"xaffinity://../../x",
@app.post("/webhooks/affinity/{secret}")The CLI Gateway provides full access to the xaffinity CLI:
The CLI Gateway provides full access to the xaffinity CLI with minimal token overhead:
**Read the API key from 1Password.** `AFFINITY_API_KEY_FILE` (and `--api-key-file`) accept a
read the API key from that file at startup. Supports `~` expansion. File
credential helper conventions (`op read ...`, `security find-generic-password -w`,
Optional (local dev): load `.env` automatically:
# Recommended: read the API key from the environment (AFFINITY_API_KEY)
# Add to ~/.bashrc or ~/.zshrc
Gates applied: instruction_override, no_behavioural_pass.
4b00ae256703full audit observations/trust-audit/mcp-server/yaniv-golan__affinity-sdk.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-10 | 4b00ae256703 | BLOCK | D | 69 | first audit |
Questions
What is the affinity-sdk MCP server?
Unofficial strongly-typed Python SDK for the Affinity CRM API - full read/write coverage, Pydantic v2, MCP server included. For when you need more than Affinity's official MCP
Is affinity-sdk safe to connect to an agent?
No — not without reading the findings first. The audit graded it D (69/100) and found 3 critical or high issues in the source. Each one is listed on this page with the file and line it is on.
What credentials does affinity-sdk need?
It reads AFFINITY_API_KEY, AFFINITY_API_KEY_COMMAND, AFFINITY_API_KEY_COMMAND_TIMEOUT and AFFINITY_API_KEY_FILE from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does affinity-sdk run?
It speaks stdio, so it runs as a local process your client starts. It is published on PyPI as affinity-sdk.
How current is this page?
The grade is for one exact copy of the source (4b00ae256703), read on 2026-10-10. The repository is watched and re-audited when it changes.