Affinity logo

Affinity

by @ghostpaw

Local SQLite relationship intelligence for contacts, social links, events, commitments, recurring dates, and contactability checks.

Install Affinity

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "ghostpaw-affinity": {
      "command": "npx",
      "args": [
        "-y",
        "@ghostpaw/affinity",
        "mcp"
      ],
      "env": {
        "GHOSTPAW_AFFINITY_DB": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Claude Code command
claude mcp add --env GHOSTPAW_AFFINITY_DB=YOUR_VALUE_HERE --transport stdio ghostpaw-affinity -- npx -y @ghostpaw/affinity mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Install not yet sandbox-tested— the server itself is confirmed live (we called its tools/list endpoint). The stdio install command is a separate, ongoing check.

Overview

@ghostpaw/affinity is a local social CRM and MCP server for maintaining contacts, identities, relationships, journal events, commitments, and recurring dates in one SQLite database. Its tools support both graph-aware search and targeted management of people, links, events, and metadata. Reach for it when an agent needs durable relationship context, duplicate handling, promise tracking, or reminders about important dates. It runs as a self-contained binary or through the zero-runtime-dependency npm package.

Use cases

  • Search relationship history before contacting someone
  • Track promises and resolve completed commitments
  • Record social events and recurring dates
  • Merge duplicate contacts without losing graph context
  • Check do-not-contact constraints through organizational ties

Key features

  • SQLite-backed local relationship store
  • Token-based search across contacts and events
  • Identity, relationship, event, and commitment management
  • Duplicate detection and contact merging
  • Recurring date anchors
  • Contactability checks through structural ties

Tools14

What Affinity lets your agent do. Expand a tool for its parameters.

Verified live~16.1k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

8/8 checks healthy over the last 31d

What it can do

From the 14 tools this server returned when we ran it; 14 declare their own safety hints.

Can delete or modify data · 8Makes changes · 10Handles credentials · 1Read-only tools · 4
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceSigned build
Package age253 days
Maintainers1

Observed 2026-12-02 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 16d ago via OSV.dev · @ghostpaw/affinity (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads1.7kPackage downloads in the last 30 days.
Last commit10d agoMost recent push to the default branch.
Tools exposed14Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Affinity works

What @ghostpaw/affinity does

@ghostpaw/affinity stores relationship data for an agent in a SQLite file. The model covers contacts, routing identities, social links, journal events, commitments, recurring date anchors, custom attributes, duplicate candidates, and relationship graph state. It is suited to personal or agent-managed relationship records rather than a general-purpose customer database.

The server exposes MCP operations for finding people, inspecting stored records, maintaining the graph, and checking whether a contact can be approached. Search can match names, identities, attributes, link roles, bonds, and event text. By default, dormant and lost contacts are omitted from search results.

How it works

The command-line binary runs against a database located at ~/.ghostpaw/affinity.db by default. Use --db <path> or GHOSTPAW_AFFINITY_DB to select another file; relative database paths are resolved from the current working directory. The npm package requires Node.js 24 or newer and has no runtime dependencies.

The data model distinguishes identities from ordinary attributes. Emails, phone numbers, social handles, and URLs belong in identity records because they can locate a person. Other custom metadata belongs in attributes. Relationships can be seeded when first mentioned, while events, promises, and recurring dates provide additional context over time.

Setup and configuration

Install the latest platform binary for Linux x64, Linux arm64, macOS Apple silicon, macOS Intel, or Windows x64. The release archives are checked against SHA256SUMS. Linux installs to ~/.local/bin, macOS installs to /usr/local/bin, and Windows installs to %LOCALAPPDATA%\\Programs\\ghostpaw\\bin; the installers also handle PATH updates for those locations.

For npm-based environments, run npx -y @ghostpaw/affinity --help or install the package globally with npm install -g @ghostpaw/affinity. A library installation is also available with npm install @ghostpaw/affinity.

Initialize an owner with ghostpaw-affinity contact create '{"name":"Owner","kind":"agent"}' --bootstrap-owner. The command-line interface also includes search and skill commands for querying records and viewing the tool reference.

Tools and capabilities

  • search_affinity searches across contact and relationship context, with options to include dormant or lost contacts.
  • review_affinity reviews contacts, journals, link queues, commitments, dates, graph state, or merge history.
  • inspect_affinity_item retrieves a specific owner, contact, or link record.
  • Contact tools create, revise, export, delete, merge, and dismiss duplicate candidates.
  • Identity, relationship, event, commitment, date-anchor, and attribute tools maintain different parts of the model.
  • check_contactable evaluates do-not-contact flags through works_at and member_of ties.

Limitations and notes

Search requires every whitespace-separated token to match. Creating a contact should follow a search_affinity lookup because duplicates can damage the graph. Permanent contact and event deletion require confirmation; deleting the owner is prohibited, while a lost contact is handled as a soft deletion. Exporting without naming a contact exports the complete database. The owner is automatically added to participants for applicable interactions, milestones, transactions, and commitments, but third-party observations may omit the owner.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Affinity

@ghostpaw/affinity is an MCP server that connects an AI agent to a local SQLite relationship database. Its main tools search and review contacts, inspect records, manage identities and relationships, record events and commitments, handle duplicates, track recurring dates, and check contactability through organizational ties.

Install a platform binary from the latest release or use `npx -y @ghostpaw/affinity --help`. Binary archives are available for Linux x64 and arm64, macOS Intel and Apple silicon, and Windows x64, with SHA256 checksum verification. npm-based environments require Node.js 24 or newer.

By default, it stores data in `~/.ghostpaw/affinity.db`. Set `GHOSTPAW_AFFINITY_DB` or pass `--db <path>` to choose another SQLite file. Relative paths are interpreted from the current working directory.

Run `search_affinity` before creating a contact, then use `merge_contacts` when two records represent the same person. Duplicate candidate pairs can also be dismissed or restored with `manage_duplicate_dismissal` so they are controlled in contact review.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewAffinity AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ghostpaw-affinity?style=directory)](https://allmcps.com/mcp/ghostpaw-affinity)
HTML Embed
<a href="https://allmcps.com/mcp/ghostpaw-affinity"><img src="https://allmcps.com/api/badge/ghostpaw-affinity?style=directory" alt="Affinity on AllMCPs" /></a>