# GhostPaw Affinity MCP server

> Manages a local social CRM for contacts, relationships, commitments, and recurring dates using a SQLite database.

- Repository: https://github.com/GhostPawJS/affinity
- Page: https://hostedmcp.org/servers/ghostpawjs/affinity
- Transport: stdio
- Stars: 1
- License: MIT
- Latest version: 0.7.2

## Install

### Claude Code

```sh
claude mcp add affinity -- npx -y @ghostpaw/affinity
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "affinity": {
      "command": "npx",
      "args": [
        "-y",
        "@ghostpaw/affinity"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "affinity": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@ghostpaw/affinity"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"affinity","type":"stdio","command":"npx","args":["-y","@ghostpaw/affinity"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "affinity": {
      "command": "npx",
      "args": [
        "-y",
        "@ghostpaw/affinity"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add affinity -- npx -y @ghostpaw/affinity
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.affinity]
command = "npx"
args = ["-y", "@ghostpaw/affinity"]
```

### Gemini CLI

```sh
gemini mcp add -s user affinity npx -- -y @ghostpaw/affinity
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "affinity": {
      "command": "npx",
      "args": [
        "-y",
        "@ghostpaw/affinity"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `GHOSTPAW_AFFINITY_DB` | no | no | SQLite database path (default: ~/.ghostpaw/affinity.db) |

## Tools (12)

- `search_affinity`
- `review_affinity`
- `inspect_affinity_item`
- `manage_contact`
- `merge_contacts`
- `manage_duplicate_dismissal`
- `manage_identity`
- `manage_relationship`
- `record_event`
- `manage_commitment`
- `manage_date_anchor`
- `manage_attribute`

## FAQ

### Where is the data stored?

Contacts and relationship data are stored in a single SQLite file, which defaults to ~/.ghostpaw/affinity.db.

### How do I run this as an MCP server?

You can start the stdio server using the command `ghostpaw-affinity mcp` or via npx using `npx -y @ghostpaw/affinity mcp`.

### Can I use this in a sandboxed environment?

Yes, but you should place the database inside a writable root by using the --db flag or setting the GHOSTPAW_AFFINITY_DB environment variable to avoid permission errors.
