Skip to main content

Hebbrix MCP server — long-term memory and knowledge graph for any MCP-compatible agent (Claude Desktop, Cline, Cursor, etc.)

Project description

hebbrix-mcp

Long-term memory and a knowledge graph for any MCP-compatible agent.

Your agent forgets everything when the session ends. This server fixes that — and goes further than a plain memory store:

  • Memory — store, search, correct, and version facts across sessions
  • Knowledge graph — entities, relationships, timelines, and "what was true at time X"
  • Reasoning — ask how confident the agent should be before acting, and log outcomes so it improves

Works with Claude Desktop, Claude Code, Cursor, Cline, Continue, and any other MCP client. Backed by Hebbrix.


Quick start (10 seconds, no account)

1. Install

pip install hebbrix-mcp

2. Add to your MCP client — no API key needed:

Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "hebbrix": { "command": "hebbrix-mcp" }
  }
}
Claude Code
claude mcp add hebbrix -- hebbrix-mcp
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "hebbrix": { "command": "hebbrix-mcp" }
  }
}
Cline / Continue / other

Point your MCP servers config at the hebbrix-mcp command (stdio). Same shape as above.

3. Restart the client. Done — your agent now has persistent memory.

What just happened?

On first run with no API key, the server mints a free agent account automatically (no email, no dashboard, ~1 second) and saves the credentials to ~/.hebbrix/config.json. The account includes:

Learning events (writes) 300
Retrievals (searches) 2,000
Expiry 14 days after last activity, if unclaimed

Every tool result includes a hebbrix_usage block (tier, usage, expiry), so the agent always knows where it stands and will tell you when it's time to claim.

Keep it forever (one command)

hebbrix-mcp claim --email you@example.com

You'll get a 6-digit code by email; enter it and the account switches to the free monthly tier with no expiry. Same API key, all memories carry over. Confirming decision outcomes (hebbrix_log_decision) also extends the trial — the system rewards exactly the usage that makes it smarter.


Using your own API key

Already have a Hebbrix account? Get a key at hebbrix.com/dashboard/api-keys and pass it instead:

{
  "mcpServers": {
    "hebbrix": {
      "command": "hebbrix-mcp",
      "env": {
        "HEBBRIX_API_KEY": "mem_sk_...",
        "HEBBRIX_COLLECTION_ID": "your-default-collection-uuid"
      }
    }
  }
}

The env var always wins over saved agent-mode credentials.


Tools

15 tools, one resource, one prompt. A server-level instruction block teaches the model when to reach for each, so a well-behaved agent searches before answering and remembers what matters — without being told.

Memory

Tool What it does
hebbrix_remember(content, tags?, collection_id?, verbatim?) Store a fact, decision, or preference. verbatim=true skips fact-extraction
hebbrix_search(query, limit?, collection_id?) Semantic search (hybrid vector + BM25 + graph retrieval)
hebbrix_get(memory_id) Fetch one memory with metadata
hebbrix_update(memory_id, content?, importance?) Correct a memory in place — old versions are kept
hebbrix_forget(memory_id) Delete a memory
hebbrix_list(limit?, collection_id?) List recent memories
hebbrix_history(memory_id) See how a memory changed over time

Knowledge graph

Reads are available on every tier (including agent mode). Graph writes and inference need a Pro plan.

Tool What it does
hebbrix_search_entities(entity_type?, limit?, collection_id?) List known entities (people, orgs, tools, places)
hebbrix_entity_timeline(entity_name, collection_id?) What was true about an entity, and when
hebbrix_graph_query(query?, entity?, relation_type?, depth?, timestamp?) Query relationships — pass a timestamp to ask about a point in time
hebbrix_contradictions(memory_id?) Surface facts that conflict with each other

Reasoning & account

Tool What it does
hebbrix_confidence(query, collection_id?) How confident should the agent be before acting? Grounded in memory + past outcomes
hebbrix_log_decision(description, outcome?, decision_type?) Record a decision and how it turned out — feeds future confidence
hebbrix_list_collections() List the memory spaces this key can use
hebbrix_account_status() Tier, usage, limits, and expiry

Also: the hebbrix://profile resource and the context prompt inject the user's compiled profile into the conversation.


Running modes

1. Local (default) — stdio

What the quick start above does. One process per client, credentials from env or ~/.hebbrix/config.json.

2. Self-hosted HTTP — one instance, your machines

HEBBRIX_API_KEY=mem_sk_... hebbrix-mcp --transport streamable-http
# serves http://127.0.0.1:8080/mcp
{ "mcpServers": { "hebbrix": { "url": "http://127.0.0.1:8080/mcp" } } }

3. Hosted multi-tenant — one instance, many users

The server holds no key at all; every request authenticates with its own Authorization header:

HEBBRIX_MCP_MULTI_TENANT=1 HEBBRIX_MCP_HOST=0.0.0.0 hebbrix-mcp --transport streamable-http
{ "mcpServers": { "hebbrix": {
  "url": "https://your-host/mcp",
  "headers": { "Authorization": "Bearer mem_sk_..." }
}}}

In this mode there is no default collection — pass collection_id on tool calls.


Configuration

All optional. With nothing set, the server starts in agent mode.

Variable Default Purpose
HEBBRIX_API_KEY (agent mode mints one) Your Hebbrix bearer token
HEBBRIX_COLLECTION_ID (agent mode sets one) Default collection for writes/reads
HEBBRIX_API_BASE https://api.hebbrix.com/v1 API endpoint override
HEBBRIX_CONFIG ~/.hebbrix/config.json Where agent-mode credentials are saved
HEBBRIX_MCP_HOST 127.0.0.1 Bind host (HTTP transports)
HEBBRIX_MCP_PORT 8080 Bind port (HTTP transports)
HEBBRIX_MCP_MULTI_TENANT off Hosted mode: per-request header auth

How it works

┌──────────────────┐   MCP (stdio or HTTP)   ┌─────────────┐    HTTPS     ┌──────────┐
│ Claude / Cursor / │ ───────────────────────→│ hebbrix-mcp │─────────────→│ Hebbrix  │
│ Cline / any agent │      tool calls         │   (this)    │   REST API   │  cloud   │
└──────────────────┘                          └─────────────┘              └──────────┘

This package owns zero state. Tool calls become REST calls against your Hebbrix account; memories, embeddings, the knowledge graph, and retrieval all live in the Hebbrix backend. Delete this package and your memories are still there.

Limits degrade gracefully

Agent-mode accounts never break mid-task. When a limit is reached you get a structured error, not a failure:

Code Meaning What still works
WRITE_LIMIT_REACHED 300 lifetime writes used Reads, searches, confirmations
READ_LIMIT_REACHED 2,000 lifetime retrievals used Claim to continue
SHADOW_READ_ONLY Unclaimed past 14 days Reads (7-day grace window)
SHADOW_EXPIRED Past the grace window Nothing — account is reaped
CLAIM_REQUIRED_FOR_BATCH Batch writes need a claimed account Everything else

Every error carries a resolve field with the exact command to fix it, so agents can relay it to you verbatim.


Troubleshooting

"HTTP 401" on every call — the key is wrong or revoked. Unset HEBBRIX_API_KEY, delete ~/.hebbrix/config.json, and restart to re-provision; or paste a fresh key from the dashboard.

Agent mode won't start (auto-signup unavailable) — signup may be at daily capacity (it's capped) or your network blocks the API. Set HEBBRIX_API_KEY from the dashboard instead.

claim says EMAIL_IN_USE — v1 claiming needs an email with no existing Hebbrix account. Use a fresh address (a you+agent@gmail.com alias works).

A memory doesn't show up in search immediately — indexing is asynchronous; typical convergence is under 30 seconds.

Multi-tenant mode returns errors about collections — there's no default collection in hosted mode; pass collection_id explicitly.


Development

git clone https://github.com/Hebbrix/hebbrix-mcp
cd hebbrix-mcp
./quick_setup.sh            # venv + editable install
source venv/bin/activate
pytest tests/ -q            # 11 offline tests, no network needed
hebbrix-mcp                 # starts in agent mode on stdio

See CHANGELOG.md for release history and CONTRIBUTING.md for how to contribute.

License

MIT — see LICENSE.

Related

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

hebbrix_mcp-0.3.1.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

hebbrix_mcp-0.3.1-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file hebbrix_mcp-0.3.1.tar.gz.

File metadata

  • Download URL: hebbrix_mcp-0.3.1.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for hebbrix_mcp-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0985f22ac3b1d22f545efe156f58407c83d2fc64c92c26b9025243ca07b74692
MD5 61619129b29f636790c158441ad565cd
BLAKE2b-256 b0148d4dda24bef849f53ab1e3b5dda832574f014507f01ad72db3a98256fb80

See more details on using hashes here.

File details

Details for the file hebbrix_mcp-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: hebbrix_mcp-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for hebbrix_mcp-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a1998005f193e0494ca21abab10acb727c171a0f3e30523950fc6722568b702
MD5 1cb9cf5253b5d917829a16bd342b7c2f
BLAKE2b-256 220159351e03370930a67b511cfae0b9c73aaa6b7aecbb32c35faf6ca190b3be

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