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

ubp

v1.2.0

Published

Documentation-as-Code Middleware — Markdown docs to Document Graph for AI agents

Readme

日本語

UBP - Unified Blueprint

npm version CI License: MIT Node.js

Documentation-as-Code middleware that structures Markdown documents into a Document Graph, providing semantic search, graph traversal, and full-text search for AI agents.

UBP parses your Markdown documentation, builds a graph of inter-document relationships, generates local embeddings, and exposes a hybrid search API via the Model Context Protocol (MCP). AI coding assistants like Claude Code and Claude Desktop can query your docs directly through the MCP interface.

Features

  • 3-Way Hybrid Search -- Vector similarity + graph proximity + FTS5 full-text search with unified scoring
  • Document Graph -- Manage inter-document links via WikiLinks ([[target]]) and standard Markdown links ([text](./path.md))
  • Local Embeddings -- Bilingual (English/Japanese) support via Xenova/multilingual-e5-large with no external API required
  • MCP Server -- Directly usable from Claude Code, Claude Desktop, and Cursor
  • Real-Time Sync -- File watcher with incremental updates
  • Staleness Detection -- Check document-to-source-code consistency via source_refs

Prerequisites

  • Node.js >= 18.0.0
  • C++ compiler toolchain (required by better-sqlite3 native addon)
    • macOS: Xcode Command Line Tools (xcode-select --install)
    • Linux: build-essential (apt install build-essential)
    • Windows: Visual Studio Build Tools or npm install -g windows-build-tools

Installation

npm install -g ubp

Quick Start

1. Initialize your project

ubp init --docs-dir docs

This parses Markdown files under docs/, splits them into sections, resolves links, generates embeddings, and stores everything in .ubp/ubp.db.

2. Search

# Semantic search (hybrid)
ubp search "how the search algorithm works"

# Full-text search (FTS5)
ubp search "trigram" --fulltext

3. Start the MCP server

ubp serve --no-lock

MCP Integration

Configuration snippets are displayed when you run ubp init.

Claude Code:

claude mcp add ubp -- node dist/main.js serve --no-lock

Claude Desktop (~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "ubp": {
      "command": "npx",
      "args": ["-y", "ubp", "serve", "--no-lock"],
      "cwd": "/path/to/project"
    }
  }
}

MCP Tools

| Tool | Description | |---|---| | ubp_search | Semantic search (3-way hybrid) | | ubp_get_page | Retrieve full document content | | ubp_get_context | Retrieve a document with its related documents | | ubp_fulltext_search | Keyword full-text search (FTS5) | | ubp_list_pages | List all documents | | ubp_get_graph | Document link graph |

CLI Commands

| Command | Description | |---|---| | ubp init | Initialize project (parse and generate embeddings) | | ubp serve | Start file watcher + MCP server | | ubp search <query> | Hybrid search / full-text search | | ubp get-page <filepath> | Retrieve full document content with links | | ubp get-context <filepath> | Retrieve a document with its related documents | | ubp list-pages | List all documents | | ubp get-graph | Document link graph | | ubp status | Show database statistics | | ubp stale | Detect stale documents | | ubp reindex | Reindex all documents | | ubp suggest-links | Suggest link candidates | | ubp version | Show version |

Global options: --cwd <path>, --json, --verbose, --quiet

Using CLI as an alternative to MCP

When MCP server integration is not available, AI agents can use the CLI with --json flag to get structured output equivalent to MCP tools. See AGENTS.md for detailed instructions.

Markdown Notation

Frontmatter

---
title: Document Title
tags: [design, architecture]
source_refs:
  - src/core/engine.ts
  - src/data/database-manager.ts
---

WikiLinks

See [[architecture]] for details.
Link to a specific section: [[database-schema#FTS5-config]]
With alias: [[search-algorithm|How search works]]

Standard Markdown Links

Standard Markdown links are automatically captured as references-type links. There is no need to manually add WikiLinks -- existing Markdown links are reflected in the Document Graph as-is.

See [Architecture Design](./designs/architecture.md) for details.
  • Only relative links to internal .md files are captured (external URLs, anchor-only links, and non-.md files are ignored)
  • When both a WikiLink and a Markdown link point to the same target, the WikiLink takes precedence and duplicates are removed

Configuration

Customize settings in .ubp/config.json:

{
  "docs_dir": "docs",
  "source": {
    "include": ["**/*.md"],
    "exclude": []
  },
  "embedding": {
    "model": "Xenova/multilingual-e5-large",
    "dimensions": 1024,
    "batch_size": 32
  },
  "search": {
    "alpha": 0.7,
    "default_limit": 10,
    "max_depth": 2
  },
  "staleness": {
    "threshold_days": 7
  }
}

search.alpha controls the score weight distribution:

score = alpha * vector + beta * graph + gamma * fts5
beta = (1 - alpha) * 0.67,  gamma = (1 - alpha) * 0.33

Architecture

Interface Layer     CLI (commander.js) / MCP Server (stdio)
        |
Core Layer          UbpEngine <- Parser, Search, Graph, Staleness, Watcher
        |
Data Layer          DatabaseManager, Repositories, VectorIndex, FTS5
        |
Embedding Layer     LocalEmbeddingProvider (ONNX Runtime)

Development

git clone https://github.com/sert-xx/unified-blueprint.git
cd unified-blueprint
npm install
npm test              # Run tests
npm run test:watch    # Watch mode
npm run typecheck     # Type checking
npm run build         # Build

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT