Skip to main content

NeuroDock cognitive graph MCP server — persistent entity memory and recall.

Project description

neurodock-mcp-cognitive-graph

Persistent entity memory for the NeuroDock substrate, exposed as an MCP server. Externalises the user's working memory of people, projects, decisions, and concepts so a hyperfocused or context-switched session does not start from zero.

This is v0.0.1 — the first working slice. Vector recall, fastembed embeddings, and sqlite-vec are deferred to v0.0.2; see CHANGELOG.md.

Quickstart

# From the workspace root.
uv sync --all-packages

# Start the server on stdio (Claude Desktop / Claude Code MCP config).
uv run neurodock-mcp-cognitive-graph

The server stores its graph at ~/.neurodock/cognitive-graph.sqlite by default. Override with the NEURODOCK_GRAPH_DB_PATH environment variable.

Tools (v0.0.1)

Tool Purpose
recall_entity(name_or_alias) Look up a person/project/decision/concept. Returns the entity, its facts (capped at 500), first-degree neighbours (capped at 20), and a resolution diagnostic.
record_fact(subject, predicate, object, source?, confidence?) Persist a typed-edge fact. Auto-creates entities by (type, name). Enforces the v0.1.0 eight-predicate vocabulary.
recall_decisions(project, since?) Return decisions for a project, ordered by date desc, capped at 200.
weekly_rollup(project?) Server-templated activity summary for the trailing seven UTC days. No LLM call (vendor boundary).

The full input/output contract is in schemas/. The Pydantic v2 models in src/neurodock_mcp_cognitive_graph/types.py mirror those schemas.

Predicate vocabulary

The eight predicates in v0.1.0 are: mentioned_in, decided_in, reports_to, depends_on, resolved_by, blocked_by, tagged, belongs_to. Unknown predicates raise PREDICATE_NOT_IN_VOCABULARY. Extension predicates land via the v0.2 type_extensions mechanism — see ADR 0002 — cognitive-graph tool design.

Privacy

  • Local-first. No network access. No telemetry.
  • source strings are stored verbatim and never fetched by the server.
  • User content (entity names, decision titles, fact text) is never logged. Error logs include only the structured error code.

Storage

SQLite. One file. Migrations live as numbered .sql files in src/neurodock_mcp_cognitive_graph/migrations/ and are applied on first connect. The schema is described in migrations/0001_init.sql.

Architecture

src/neurodock_mcp_cognitive_graph/
├── server.py            FastMCP wiring + CLI entrypoint
├── types.py             Pydantic v2 models (mirror of the JSON Schemas)
├── config.py            Resolves the SQLite path
├── clock.py             SystemClock / FixedClock
├── errors.py            ToolError envelope
├── resolution.py        Entity name/alias cascade (exact, alias only in v0.0.1)
├── rollup.py            Heuristic decision/blocker/next-action assembly
├── storage/
│   ├── base.py          Storage Protocol + row dataclasses
│   ├── memory.py        InMemoryStorage (used by tests)
│   └── sqlite.py        SQLiteStorage (production backing)
├── tools/
│   ├── recall_entity.py
│   ├── record_fact.py
│   ├── recall_decisions.py
│   └── weekly_rollup.py
└── migrations/
    └── 0001_init.sql

ADR pointers

Tests

uv run pytest packages/mcp-cognitive-graph/tests/ -v

25 tests covering: per-tool unit tests, a FastMCP protocol-conformance suite that exercises every tool and validates the response against the JSON Schema using jsonschema, and an end-to-end test that runs against a real file-backed SQLite store.

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

neurodock_mcp_cognitive_graph-0.0.3.tar.gz (50.2 kB view details)

Uploaded Source

Built Distribution

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

neurodock_mcp_cognitive_graph-0.0.3-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

Details for the file neurodock_mcp_cognitive_graph-0.0.3.tar.gz.

File metadata

  • Download URL: neurodock_mcp_cognitive_graph-0.0.3.tar.gz
  • Upload date:
  • Size: 50.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for neurodock_mcp_cognitive_graph-0.0.3.tar.gz
Algorithm Hash digest
SHA256 fd5b23c797a7a1f6a86179347d8d43a408cbd968f5a0600fc7533c03e0d9f83e
MD5 d702186846ecc01cbf43bc57b25e5807
BLAKE2b-256 3bab5c58d9d9f21c1d91b8e6332a06af484fa8d0d54e10e0a7851769a77d12c9

See more details on using hashes here.

File details

Details for the file neurodock_mcp_cognitive_graph-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: neurodock_mcp_cognitive_graph-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 42.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for neurodock_mcp_cognitive_graph-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b8be58b109d68ccb68eac33aa1ef5e17e09dbdf1a8681782900f756d276678e1
MD5 c5daed9c03edea50d47a05bbb2fc6f7b
BLAKE2b-256 711986954109f87296c1154c8115ca04e0c5c8fb50a8f1fc799ed834e5fad0c6

See more details on using hashes here.

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