Skip to main content

Local-first MCP server giving AI agents contextual knowledge about the people in your life

Project description

people-context

CI codecov OpenSSF Scorecard PyPI PyPI downloads Python License

A local-first MCP server that gives AI coding agents and personal agent systems durable, user-owned context about the people they mention.

Why

A model can recognize a name but does not know who that person is in the user's life. people-context keeps identity, aliases, relationships, roles, durable facts, concise interactions, communication preferences, and follow-ups in a local SQLite file, then exposes narrow tools that resolve identity and disclose only what a request needs.

Status

M7 — relationship graph & vault export delivered. Relationship types are data-backed and canonicalized, relationship reads add perspective display_type, two bounded read-only graph tools are available, and the CLI can generate a deterministic marker-owned Obsidian vault. Existing field meanings, resolution behavior, JSON export envelope, and M6 sync capture remain compatible. The merge_people result intentionally adds the duplicate_relationships_removed field, reporting how many overlapping relationship edges were collapsed; callers that ignore unknown response fields require no changes.

Features

  • explainable exact/normalized/FTS/fuzzy identity resolution with aliases and ambiguity handling;
  • bounded person context with sensitivity and purpose gates;
  • canonical relationship vocabulary, synonyms, inverse pairs, symmetric types, and uncategorized extensions;
  • minimal-disclosure relationship graph and shortest-path MCP tools with explicit caps/truncation;
  • organizations and time-aware affiliations;
  • separate facts, observations, traits, and concise interaction summaries;
  • communication guidance grounded in traits, interaction friction, reminders, and user-authored philosophy;
  • reviewable email/mbox/vCard/agent-candidate imports without retaining raw source content;
  • optional pinned multilingual Model2Vec + sqlite-vec semantic retrieval;
  • atomic audit plus replay changelog/HLC capture for every durable write;
  • merge, forget/redaction, unchanged JSON export, and safe Obsidian vault export;
  • stdio by default and explicit unauthenticated loopback-only Streamable HTTP.

Quick start

Requires Python 3.11+ and uv.

Install the published distribution, then start either the MCP server or the human-operated CLI:

uv tool install people-context
people-context-mcp
people-context --help

For a one-off server launch without a persistent installation:

uvx --from people-context people-context-mcp

PyPI migration: the distribution was renamed from people-context-mcp to people-context. The people-context-mcp console command remains stable. A legacy people-context-mcp distribution is retained as a compatibility shim that depends on people-context; new installations should use people-context directly.

For local development:

git clone https://github.com/JinyangWang27/people-context.git
cd people-context
uv sync
uv run people-context-mcp

Loopback HTTP is opt-in:

uv run people-context-mcp --http --host 127.0.0.1 --port 8765

The endpoint is http://127.0.0.1:8765/mcp. It is unauthenticated and must be treated as accessible to other local processes. Prefer stdio.

Example: graph-aware context and vault

After recording people and relationships through MCP, inspect structure with get_relationship_graph or find_connection, then create a human-browsable vault:

uv run people-context export-vault --output ~/PeopleVault

The directory is accepted only when nonexistent, empty, or already marked with .people-context-vault. Re-export is byte-deterministic over unchanged data. Sensitive/restricted facts require the explicit --include-sensitive flag; exported files are outside server disclosure controls.

MCP client configuration

Claude Code:

claude mcp add people-context -- uvx --from people-context people-context-mcp

Generic stdio configuration:

{
  "mcpServers": {
    "people-context": {
      "command": "uvx",
      "args": ["--from", "people-context", "people-context-mcp"]
    }
  }
}

Security model

This project executes local Python with the launching user's filesystem permissions. The database is plaintext SQLite; rely on filesystem permissions and full-disk encryption. Ordinary MCP discovery excludes elevated sensitive context and full export. Operator-gated tools require process environment flags; models cannot enable them through arguments. Vault export is intentionally CLI-only.

Optional semantic search

The base install downloads nothing. Opt in explicitly:

uv sync --extra semantic
uv run people-context reindex --semantic

Only that reindex command may download the pinned multilingual model. Server startup/search are cache-only.

Database location

Server and CLI use the first available source:

  1. explicit --db/server argument;
  2. PEOPLE_CONTEXT_DB;
  3. db_path in the XDG config file;
  4. OPENCLAW_WORKSPACE or ~/.openclaw/workspace;
  5. the XDG data fallback.

Inspect the selected path with uv run people-context db-path -v.

CLI overview

uv run people-context db-path [-v]
uv run people-context list [--all]
uv run people-context search <query>
uv run people-context show <person>
uv run people-context export [--output FILE]
uv run people-context relationship-types
uv run people-context relationship-types add TYPE --category C [--inverse T | --symmetric]
uv run people-context normalize-relationships [--apply]
uv run people-context export-vault --output DIR [--include-sensitive]
uv run people-context edit PERSON [--name NAME] [--summary TEXT]
uv run people-context add-alias PERSON VALUE [--kind KIND]
uv run people-context set communication_philosophy VALUE
uv run people-context delete PERSON [--yes]
uv run people-context sync-log [--limit N] [--entity ID] [--payloads]
uv run people-context reindex [--semantic]

See docs/cli.md.

Architecture

The codebase follows ports and adapters:

adapters (SQLite, MCP, filesystem, imports, CLI)
        ↓ implement
ports (narrow Protocols)
        ↑ used by
app (use cases and policy)
        ↓ operates on
domain (entities and values)

Dependencies point inward. Vocabulary normalization and graph caps live in app/domain; recursive SQL and file writing live in adapters. One composition root wires both stdio and HTTP.

Documentation

Document Contents
docs/architecture.md Layering, dependency rule, entrypoint wiring
docs/data-model.md Schema including migrations 002/003 and display_type
docs/relationship-graph.md Vocabulary, normalization, perspective, traversal, curation
docs/vault-export.md Layout, marker safety, determinism, sensitivity
docs/mcp-interface.md MCP tools and stable response contracts
docs/cli.md CLI commands and DB resolution
docs/design/sync.md Sync design and M6 local foundations
docs/releasing.md PyPI migration, trusted publishing, Codecov, and release procedure
docs/privacy-and-safety.md Disclosure, audit, forget, threat model
docs/roadmap.md M0 through M7 delivered; M8 through M15 planned
docs/specs One implementation spec per planned M8–M15 milestone

Contributing

  • Keep domain/app independent of SQLite, MCP, and filesystem adapters.
  • Use narrow Protocol ports and fake-port tests for app behavior.
  • Run uv run ruff check . and uv run pytest -q.
  • Line length is 120.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

people_context-0.1.1.tar.gz (403.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

people_context-0.1.1-py3-none-any.whl (145.1 kB view details)

Uploaded Python 3

File details

Details for the file people_context-0.1.1.tar.gz.

File metadata

  • Download URL: people_context-0.1.1.tar.gz
  • Upload date:
  • Size: 403.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for people_context-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5a7c3c276ae29ed2e3023952a0932124766259dd4d18008665cccbf942c045c8
MD5 52d3cbef1fc5c85fbcf6fb10ca54b3b4
BLAKE2b-256 38dd743f0be98745c806fbacefda0237e3140bb345fa06acfc7c09ae3fa3f934

See more details on using hashes here.

Provenance

The following attestation bundles were made for people_context-0.1.1.tar.gz:

Publisher: release.yml on JinyangWang27/people-context

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file people_context-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: people_context-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 145.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for people_context-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4e9405a2e1f4bb2f542b1456158c842665404080aa978f89128c262830e1117
MD5 c82df02d21991044e3fb6ecd4d33bd3b
BLAKE2b-256 455bfdb05b3191f8301069dd3781c4c0fe8a13452bbca5270e772f07a348b223

See more details on using hashes here.

Provenance

The following attestation bundles were made for people_context-0.1.1-py3-none-any.whl:

Publisher: release.yml on JinyangWang27/people-context

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page