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

pi-dense-mem

v0.1.1

Published

Pi extension that exposes dense-mem MCP tools as native Pi tools. Replaces pi-mcp-adapter proxy for dense-mem only.

Readme

pi-dense-mem

Pi extension that exposes dense-mem production MCP tools as native Pi tools. Replaces the pi-mcp-adapter proxy for dense-mem with a direct JSON-RPC client and eliminates the per-call discovery/formatting round-trip.

Status

v0.1.0 — production tool set (7 tools), 89 tests passing, strict TypeScript with exactOptionalPropertyTypes and noUncheckedIndexedAccess.

Install

pi install npm:[email protected]

(Published as pi-dense-mem on npm; can also be installed as a regular npm package: npm install pi-dense-mem.)

Configure

Set PI_DENSE_MEM_URL (default http://127.0.0.1:8080/mcp) and any other env vars you need.

Tools

| Pi name | Server method | Read/Write | |---|---|---| | dense_mem_recall_memory | recall_memory | R | | dense_mem_remember | remember | W | | dense_mem_get_submission_status | get_submission_status | R | | dense_mem_retract_evidence | retract_evidence | W | | dense_mem_correct_relationship | correct_relationship | W | | dense_mem_trace_memory | trace_memory | R | | dense_mem_export_memory_pack | export_memory_pack | R |

Tool registration is dynamic: tools/list runs on session_start and only the tools the server actually exposes are registered. The server catalog is the source of truth.

Architecture

┌─────────────────────┐
│ Pi extension        │
│ (this package)      │
├─────────────────────┤
│ extension.ts        │  ← factory + lifecycle, calls buildExtension
│ config/schema.ts    │  ← TypeBox-validated env > file > defaults
│ log/logger.ts       │  ← JSON to stderr, no deps
│ jsonrpc/client.ts   │  ← JSON-RPC 2.0 over fetch, stdlib only
│ client/             │  ← high-level, retry, error translation
│ ready/wait.ts       │  ← exponential backoff, abortable
│ tools/production.ts │  ← 7 production tools, TypeBox schemas
│ tools/create-tool.ts│  ← shared wrapper: validation + serialization
│ errors.ts           │  ← DenseMemError taxonomy
│ retry.ts            │  ← exponential backoff with jitter
└─────────────────────┘
        │
        │ HTTP POST /mcp (JSON-RPC 2.0)
        ▼
┌─────────────────────┐
│ dense-mem server    │
│ (Docker, port 8080) │
└─────────────────────┘

Zero runtime dependencies beyond @sinclair/typebox (which is a pure type-level library; the runtime cost is zero). All HTTP, retry, JSON-RPC, and logging are implemented on top of Node 20+ stdlib.

Development

npm install
npm test           # 89 tests, no network required
npm run typecheck  # tsc --noEmit, strict
npm run build      # tsc -p tsconfig.build.json → dist/

Tests use vitest. No real dense-mem server is needed — the JSON-RPC client takes a fetch implementation that you can mock.

TDD

Every module was written test-first:

test/errors.test.ts       → src/errors.ts
test/retry.test.ts        → src/retry.ts
test/jsonrpc.test.ts      → src/jsonrpc/client.ts
test/client.test.ts       → src/client/dense-mem-client.ts
test/config.test.ts       → src/config/schema.ts
test/logger.test.ts       → src/log/logger.ts
test/ready.test.ts        → src/ready/wait.ts
test/tools.test.ts        → src/tools/create-tool.ts
test/production-tools.test.ts → src/tools/production.ts
test/extension.test.ts    → src/extension.ts

License

MIT. See LICENSE.