Skip to main content

Model Context Protocol server for Neruva — typed agentic memory (Records: decisions, mistakes, llm_turns, tool_calls), knowledge graph with 4 engines (Hadamard / OPB / multi-shard / quorum / feature-bundle) + raw-text ingest + N-hop matrix-power derive + customizable context blocks, Pearl's do-operator, HD analogy, plus self-introspection (wallet, op stats, op log, keys). Drop-in for any MCP host.

Project description

neruva-mcp

Model Context Protocol server for Neruva -- typed agentic memory (Records substrate) plus an HD-native substrate (knowledge graphs, analogy, causal do-operator). Drop into any MCP host. Python mirror of the TypeScript @neruva/mcp package; same tool surface.

What's new in 0.7.0

Four self-introspection tools so an agent can answer "what did I just do, and what's it costing me?" without leaving the loop:

Tool What it does
neruva_wallet_status Current credit / usage / plan for the active key
neruva_op_stats Per-tool call counts + latency stats for this agent
neruva_keys_list List API keys visible to the active account
neruva_op_log Recent op log entries (tool, latency, ts) for audit

These mirror the substrate's own audit surface back to the agent -- the same data the dashboard sees, available inline at sub-ms.

Install

The killer path -- one shot, every Claude Code session is auto-recorded:

pip install neruva-record && neruva-record-install

That installs the Claude Code hook + the Records SDK; every session you run after that lands in your Neruva account, secrets-redacted, queryable later.

For the MCP server itself:

pip install neruva-mcp
export NERUVA_API_KEY=...        # from https://app.neruva.io

Or zero-install via uvx:

uvx neruva-mcp@latest

Wire into a client

Claude Code

claude mcp add neruva --scope user \
  --env NERUVA_API_KEY=nv_... \
  -- uvx neruva-mcp@latest

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "neruva": {
      "command": "uvx",
      "args": ["neruva-mcp@latest"],
      "env": { "NERUVA_API_KEY": "..." }
    }
  }
}

Codex (~/.codex/config.toml)

[mcp_servers.neruva]
command = "uvx"
args = ["neruva-mcp@latest"]
env = { NERUVA_API_KEY = "..." }

Gemini CLI (~/.gemini/settings.json)

{
  "mcpServers": {
    "neruva": {
      "command": "uvx",
      "args": ["neruva-mcp@latest"],
      "env": { "NERUVA_API_KEY": "..." }
    }
  }
}

Or run directly:

NERUVA_API_KEY=YOUR_KEY neruva-mcp

The 4-layer substrate

  • Records = typed agentic memory. Every event has kind, tags[], ts, meta, auto-embedded at D=1024. Filter on any dimension. GDPR-native via records_forget. Portable as .neruva.
  • KG = mutable structured state. Sharded (K=16 by default), deterministic from a seed, batched cleanup. Deploy state, project status, refactor tracking.
  • Causal = "if I do X, what happens?" -- Pearl's do-operator as native HD substitution.
  • Analogy = a:b::c:? pattern transfer in HD feature space, sub-ms, n_feat up to 20.

A 5th legacy layer -- Memory Index -- exposes raw vector upsert/query at /v1/indexes/* for users migrating from generic vector stores. Kept for back-compat; new agents should reach for Records first.

Cost wedge

~3,125x cheaper per recall than context-stuffing with Opus 4.7 (records_query at $2/M input vs context-stuff at ~$0.00625/turn). See /benchmarks on the site for the measured run.

Tools

Records -- typed agentic memory (flagship)

Tool What it does
records_append Append a typed event (kind, tags, ts, meta, text) -- auto-embedded
records_query Filter on any combo of kind / tags / time range / semantic similarity
records_fetch Fetch records by id
records_forget GDPR-native delete (tombstoned, excluded from query + export)
records_export Export to portable .neruva container -- your data is yours
records_import Import a .neruva blob
records_compact Compact tombstones, rebuild index

HD-native substrate

Tool What it does
hd_kg_add_fact Add (subject, relation, object) to a KG (sharded K=16)
hd_kg_query Query KG for object of (subject, relation)
hd_kg_delete_fact Cancel a previously-added fact (mutable state)
hd_analogy Four-term analogy in HD space (n_feat up to 20)
hd_causal_add_worlds Add worlds to a structural causal model
hd_causal_query Observational or interventional (Pearl do-operator)

Self-introspection (new in 0.7.0)

Tool What it does
neruva_wallet_status Current credit / usage / plan
neruva_op_stats Per-tool call counts + latency stats
neruva_keys_list API keys visible to the active account
neruva_op_log Recent op log entries for audit

Memory index -- vector upsert/query (legacy compat surface)

Tool What it does
memory_embed Encode texts to D=1024 vectors via the server-side static-MRL encoder. No BYOE.
memory_upsert_text Embed and upsert text in one call
memory_query_text Embed a text query and search in one call
memory_create_index Create a vector index
memory_list_indexes List your indexes
memory_describe_index Describe one index
memory_stats Per-namespace vector counts
memory_upsert Insert/update raw vectors
memory_query Cosine top-K search (raw vectors)
memory_fetch Fetch vectors by id
memory_update In-place edit values/metadata
memory_delete Delete by id
memory_export Portable .nmm export
memory_import .nmm import
memory_bind_role Bind a role atom for compound queries
memory_read_roles Recover bound role atoms

Auto-record (opt-in, 0.4.0+)

Set NERUVA_AUTO_RECORD=<index>/<namespace> and every tool call the agent makes is auto-upserted into that namespace as a side-effect.

# single-agent
NERUVA_AUTO_RECORD=brain/main

# multi-agent: one namespace per agent
NERUVA_AUTO_RECORD=brain/support-bot
NERUVA_AUTO_RECORD=brain/research-agent

Each record carries metadata {kind: "tool_call", tool, latency_ms, ts}. memory_* and records_* reads are excluded to prevent loops. Fire-and-forget: never blocks or breaks the call. ~1.2 KB per tool call.

For Claude Code specifically, prefer the one-shot installer:

pip install neruva-record && neruva-record-install

Env

Variable Default
NERUVA_API_KEY required
NERUVA_URL https://api.neruva.io
NERUVA_AUTO_RECORD optional <index>/<namespace> to enable auto-record

License

MIT -- Clouthier Simulation Labs.

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

neruva_mcp-0.16.0.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

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

neruva_mcp-0.16.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file neruva_mcp-0.16.0.tar.gz.

File metadata

  • Download URL: neruva_mcp-0.16.0.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for neruva_mcp-0.16.0.tar.gz
Algorithm Hash digest
SHA256 1f56d5c0a2f9348e964bc1499b494484783f70202aea26c20093244f3a71c443
MD5 b4023e3a6aac5402a3638e2a7162dbcd
BLAKE2b-256 1df0fe35fd1de804bd432a0379754b952121cbc08ea9795a703ac5c99691d7f3

See more details on using hashes here.

File details

Details for the file neruva_mcp-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: neruva_mcp-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for neruva_mcp-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 783fcce8ae6a1f4a7ff284e00edd6f534eb3f08c5a87495d570dda523b9f4363
MD5 3ab381b4514f2050204a2acaf1b3b848
BLAKE2b-256 0b241b5a001eaa5b947d428f8c85961039d4d662c162e0fb41e372f749324bad

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