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

ra-h-mcp-server

v3.2.4

Published

Connect Claude Code/Desktop to your RA-H knowledge base. Direct SQLite access to an existing RA-H database.

Readme

RA-H MCP Server

Connect Claude Code, Claude Desktop, Cursor, Codex, and other MCP clients to your RA-H knowledge base. This package talks directly to the local RA-H SQLite database.

Quick Install

npx -y ra-h-mcp-server@latest setup --client claude-code --yes

The setup command creates or verifies the database, prints or writes MCP config for the selected client, and runs doctor.

Other useful commands:

npx -y ra-h-mcp-server@latest setup --client cursor --yes
npx -y ra-h-mcp-server@latest setup --client codex --yes
npx -y ra-h-mcp-server@latest setup --client claude-code,codex --yes --install-rules --target .
npx -y ra-h-mcp-server@latest init-db
npx -y ra-h-mcp-server@latest doctor
npx -y ra-h-mcp-server@latest print-config --client claude-code

--client accepts a single client or comma-separated clients. --yes lets the installer write supported client config automatically. Codex uses TOML config, so the installer writes CODEX_HOME/config.toml or ~/.codex/config.toml.

Important contract:

  • @latest is the default user-facing install path
  • exact versions are only for release/debug reproducibility
  • standalone MCP reads and writes node data directly
  • standalone MCP does not own chunking, embeddings, or live schema migration on an existing DB
  • standalone MCP and the app use SQLite WAL; normal short reads/writes can coexist, while restore/replace/checkpoint/delete-WAL maintenance requires all DB owners to be closed first

Configure Claude Code / Claude Desktop

Prefer the setup command above. Manual config is still available for troubleshooting:

{
  "mcpServers": {
    "ra-h": {
      "command": "npx",
      "args": ["-y", "ra-h-mcp-server@latest"]
    }
  }
}

Restart Claude fully. If you need to freeze behavior for debugging, pin an exact version intentionally and restart the client.

Requirements

  • Node.js 18-22 LTS recommended
  • a RA-H database at the platform default path, created by setup, init-db, or the app

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | RAH_DB_PATH | Platform default app-data path | Database path |

For demos or isolated installs:

npx -y ra-h-mcp-server@latest setup \
  --client claude-code \
  --yes \
  --db "$HOME/Desktop/ra-h_os-demo-data/rah.sqlite"

What To Expect

Once connected, the agent should:

  • use queryNodes for explicit node lookup when the user is trying to find a specific existing thing
  • use retrieveQueryContext when graph context is helpful for a broader task, question, or request
  • use getContext only for orientation when high-level graph state would actually help
  • treat context as optional by default
  • search before creating to avoid duplicates
  • propose likely edges first, then create them only after explicit confirmation
  • read skills for more complex tasks

Source Processing

  • the standalone MCP server stores source text on the node
  • it does not split source into chunks or generate embeddings itself
  • the RA-H app owns chunking and embedding when the app is running
  • if the app is closed, writes still land in nodes.source, and the app processes them later

Recommended Agent Memory Line

If you use external agents through this MCP server, you may add one short instruction line to your agent memory file (AGENTS.md, CLAUDE.md, etc.) as optional reinforcement:

## RA-H Graph Memory

Retrieve relevant RA-H context before substantive work, search before creating, and keep durable writeback prompts brief and confirmation-gated.

Install or refresh that guidance without replacing the rest of the memory file:

npx -y ra-h-mcp-server@latest install-rules --client claude-code,codex --target . --yes

RA-H should still work well without this line. The MCP tools, server instructions, skills, and docs are meant to carry the core behavior on their own.

Do not create contradictory instruction files. Prefer one short reinforcement line over a pile of overlapping guidance.

Available Tools

| Tool | Description | |------|-------------| | getContext | Get graph overview - stats, hub nodes, recent activity | | retrieveQueryContext | Pull relevant graph context for a broader current-turn task | | createNode | Create a new node | | queryNodes | Search nodes by keyword | | getNodesById | Load nodes by ID | | updateNode | Update an existing node | | createEdge | Create a confirmed connection between nodes | | updateEdge | Update an edge explanation after explicit confirmation | | queryEdge | Find edges for a node | | listSkills | List available skills | | readSkill | Read a skill by name | | writeSkill | Create or update a skill | | deleteSkill | Delete a skill | | searchContentEmbeddings | Search through source content | | sqliteQuery | Execute read-only SQL queries (SELECT / WITH / PRAGMA) |

Verification tip:

  • after config changes, fully restart the client and confirm you can see tools like queryNodes, retrieveQueryContext, and createNode
  • run npx -y ra-h-mcp-server@latest doctor to verify package version, DB path, schema health, and node count

Node Metadata Contract

When createNode or updateNode includes metadata, prefer the canonical shape:

{
  "type": "website | youtube | pdf | tweet | note | chat | ...",
  "state": "processed | not_processed",
  "captured_method": "quick_add_note | website_extract | ...",
  "captured_by": "human | agent",
  "source_metadata": {}
}

Rules:

  • source_metadata is for small factual source-specific fields only
  • metadata updates merge with the existing object; they do not replace the full blob
  • use captured_by = "human" for direct user creation and user-requested agent capture
  • reserve captured_by = "agent" for autonomous/background creation only

Writeback Rule

  • do not ask to save every moderately useful point from the conversation
  • only suggest a save when the context is unusually durable and valuable
  • keep the ask terse and concrete, for example: Add "X" as a node?

Edge Rule

  • external agents should propose likely edge candidates first
  • createEdge is the execution tool after explicit user confirmation
  • agent-driven edge creation should always include a clear explanation sentence

Skills

Skills are editable and shared across internal and external agents.

Skills are stored at ~/Library/Application Support/RA-H/skills/ and shared with the main app.

What's NOT Included

This is a lightweight CRUD server. Advanced features are handled by the main app:

  • embedding generation
  • AI-powered edge inference
  • content extraction (URL, YouTube, PDF)
  • real-time SSE events
  • automatic chunking or embedding while the app is closed

Testing

# Test database connection
node -e "const {initDatabase,query}=require('./services/sqlite-client');initDatabase();console.log(query('SELECT COUNT(*) as c FROM nodes')[0].c,'nodes')"

# Test CLI setup path
node index.js init-db --db /tmp/rah-test.sqlite
node index.js doctor --db /tmp/rah-test.sqlite

# Run the server
node index.js