npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mindmorass/mcp-phantom-brain

v1.0.0

Published

MCP phantom brain — unified memory, reasoning, and validation server

Readme

mcp-phantom-brain

A Model Context Protocol server that gives Claude a structured, validated long-term memory backed by an Obsidian vault on disk.

Unlike a simple note-taking tool, phantom-brain doesn't just store what you tell it — it validates claims before committing them. The host LLM evaluates each incoming claim for logical fallacies, source quality, and contradictions with existing knowledge before anything is written to memory.

How it works

Memory storage is a two-phase protocol:

  1. brain_remember — runs Layer 1 server-side checks (coherence, source tier, near-duplicate detection) and returns a structured evaluation package to the host LLM, including relevant existing atoms and a structured prompt covering 12 fallacy checks, 6 philosophical razors, and a contradiction scan.

  2. brain_commit — the host LLM calls this with its verdict (store, reject, or ask). Accepted claims become atoms in Memory/. Rejected claims are logged with full reasoning to _log/rejections.jsonl.

The server never reasons — all epistemic judgment happens in the host LLM's context. The server enforces structure and provides the reference material.

Tools

| Tool | Purpose | |---|---| | brain_recall | Hybrid FTS5 + vector search over Memory atoms and Wiki pages | | brain_remember | Layer 1 validation; returns evaluation package for host LLM | | brain_commit | Commits the host LLM's verdict: store, reject, or ask | | brain_reflect | Maintenance pass: prunes stale atoms | | brain_why_rejected | Query the rejection log by topic, fallacy, or claim content |

Vault structure

The vault is a directory of Markdown files with YAML frontmatter.

<vault>/
  Memory/       ← atoms: short factual claims, one per file
  Wiki/
    HowTos/
    Runbooks/
    References/ ← seed pages: logical fallacies, razors, philosophical logic
    Scratch/
  Input/        ← raw source material (immutable after ingest)
  Output/       ← deliverables
  _index/       ← SQLite FTS5 + vector index
  _log/         ← rejection log (rejections.jsonl)

On first startup, three reference Wiki pages are seeded:

  • Logical Fallacies — 12-fallacy taxonomy used in Layer 2 evaluation
  • Philosophical Razors — Occam, Hitchens, Sagan, Hanlon, Hume, Popper
  • Philosophical Logic — fallback frameworks for ambiguous claims (modal logic, fuzzy logic, etc.)

Search

brain_recall uses hybrid RRF (Reciprocal Rank Fusion) combining BM25 full-text search and cosine vector similarity when Ollama is available. Falls back to FTS5-only otherwise. Memory atoms and Wiki pages are ranked together in the same result set.

Setup

Prerequisites: Node.js ≥ 18. Optionally Ollama with nomic-embed-text for vector search.

git clone https://github.com/mindmorass/mcp-phantom-brain
cd mcp-phantom-brain
npm install
cp .env.example .env  # edit BRAIN_VAULT_PATH
npm run build

Claude Code / Claude Desktop — add to your MCP config:

{
  "phantom-brain": {
    "command": "node",
    "args": ["/path/to/mcp-phantom-brain/dist/index.js"],
    "env": {
      "BRAIN_VAULT_PATH": "/path/to/your/vault"
    }
  }
}

Note: Do not use nested shell fallback syntax (${VAR:-${OTHER}}) in the MCP env block — Claude Code partially expands it, leaving a trailing }. Use plain ${VAR} references only.

Configuration

| Var | Default | Purpose | |---|---|---| | BRAIN_VAULT_PATH | ~/...memory | Vault root directory | | OLLAMA_BASE_URL | http://localhost:11434 | Embeddings endpoint | | EMBEDDING_MODEL | nomic-embed-text | Ollama model name | | EMBEDDING_DIMS | 768 | Vector dimensions | | MCP_BRAIN_LOG_LEVEL | info | Log verbosity (debug\|info\|warn\|error) |

Development

npm run dev       # run with tsx (no build required)
npm run typecheck # type-check without emitting
npm run build     # compile to dist/

There are no tests. npm run typecheck is the primary verification step.

License

MIT