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

@gclift/cxms

v2.1.18

Published

Context Management System — storage, index, search, and context tree for Foundation entities

Readme

CxMS — Context Management System

CxMS gives AI agents structured, persistent memory. Agents store and retrieve knowledge through typed context nodes — tasks, events, notes, people, goals, and any custom type you define. Content lives as human-readable Markdown files with YAML frontmatter in a Foundation directory on disk. CxMS provides BM25 full-text search with Porter stemming, a relationship graph between nodes, token-budgeted context trees for LLM consumption, vault analytics, and both a REST API and an MCP tool server so any agent framework can plug in.

Documentation

| Page | Description | |------|-------------| | How It Works | Architecture, data model, layers, and internals | | Foundation | Foundation directory structure and context files | | Context Types | Schema system, field types, and type management | | REST API | Complete REST endpoint reference with examples | | MCP Tools | All MCP tools with parameters and usage | | Search & Context | BM25 search, context trees, analytics, and real-time context | | Preview-then-Retrieve | Token-efficient retrieval protocol for single and federated CxMS |


Highlights

  • Schema-first — define typed context types with field validation before writing a single node
  • Human-readable storage — every node is a plain .md file you can open, edit, and commit to git
  • BM25 search — full-text search with stemming and weighted fields, no embeddings or external APIs required
  • Relationship graph — edges extracted automatically from @mentions, [[references]], and frontmatter links
  • Token-budgeted context tree — agents load exactly the right memory for a query without blowing their context window
  • Vault analytics — disk usage, file counts, and node counts per type via REST and MCP
  • Dual interface — REST API for any language or framework, MCP tools for Claude Desktop, Cursor, and compatible agents
  • Platform-agnostic — file I/O abstracted so CxMS runs on Node.js, React Native, or any custom runtime

Quick Start

Method 1 — Standalone server

npm install -g @gclift/cxms

# Initialize a Foundation in the current directory
cxms init

# Start the server (default port 3800)
cxms
Foundation: /path/to/my-foundation
Building index...
Indexed 0 nodes, 0 edges

CxMS listening on http://localhost:3800
  REST API:  http://localhost:3800/cx/health
  MCP:       http://localhost:3800/mcp
  Token:     cxms_a3b8f1...

Connect Claude Desktop or any MCP client:

{
  "mcpServers": {
    "cxms": {
      "url": "http://localhost:3800/mcp"
    }
  }
}

Use the REST API from any language:

TOKEN=$(cxms token)

# Create a task
curl -X POST http://localhost:3800/cx/context-types/task \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"title": "Review Q3 report", "tags": ["work"], "status": "open"}'

# Full-text search
curl -X POST http://localhost:3800/cx/search \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "quarterly review"}'

Method 2 — Embedded in your project

npm install @gclift/cxms
import http from 'http';
import {
  setPlatform, createNodePlatform, setFoundationRoot,
  handleCxRoute, handleMcpRoute, getEntityIndex,
} from '@gclift/cxms';

setPlatform(createNodePlatform());
setFoundationRoot('/path/to/my-foundation');

const index = getEntityIndex();
await index.build();

const server = http.createServer(async (req, res) => {
  const url = new URL(req.url!, `http://${req.headers.host}`);
  if (url.pathname.startsWith('/cx/')) { await handleCxRoute(req, res, url); return; }
  if (url.pathname === '/mcp') { await handleMcpRoute(req, res); return; }
  res.writeHead(404); res.end('Not found');
});

server.listen(3800);

Or call the library directly, with no HTTP layer:

import {
  setPlatform, createNodePlatform, setFoundationRoot,
  getEntityIndex, searchEntities, writeEntity, generateNodeId, ensureEntityDir, nodeFilename,
} from '@gclift/cxms';

setPlatform(createNodePlatform());
setFoundationRoot('/path/to/foundation');
await getEntityIndex().build();

const results = await searchEntities('quarterly review', 'task');

const id = generateNodeId();
const dir = await ensureEntityDir('note');
await writeEntity(`${dir}/${nodeFilename('Agent memory snapshot', id)}`, {
  id, title: 'Agent memory snapshot', entityType: 'note',
  created: new Date().toISOString(), tags: ['agent', 'memory'],
}, 'Key observations from today...');

CLI Reference

cxms                              Start the server
cxms init                         Initialize a Foundation in the current directory
cxms token                        Print the bearer token
cxms token --regenerate           Regenerate the bearer token

--port,        -p <port>          Port (default: 3800)
--foundation,  -f <path>          Foundation root directory
--no-auth                         Disable bearer token authentication

System config lives in ~/.cxms/config.json{ "foundationRoot": "...", "port": 3800 }.


License

MIT