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

kartograph

v1.0.0

Published

Kartograph scans your JS/TS codebase, generates a structured codemap, and exposes it via an MCP server.

Readme

Kartograph

Kartograph scans your JS/TS codebase, generates a structured codemap, and exposes it via an MCP server so AI coding agents can understand your entire codebase structure in one query instead of crawling files.

The Problem

You're using AI coding agents (Cursor, Claude Code, Copilot) daily. They work great—until they don't. Your agent keeps making wrong assumptions about your codebase because it has no structural context:

  • Hallucinations: Agent invents function signatures that don't exist
  • Missed utilities: Duplicates logic that already lives elsewhere in the codebase
  • Inefficient searches: Makes 6+ file reads to find something that should take 1 query
  • Wasted iterations: Wrong assumptions → wrong code → manual fixes → iterate again

The Solution

Give your AI agent a complete, structured map of your codebase that it can query in a single call.

Instead of your agent blindly reading files, it calls search_types("Order") and instantly gets:

  • The exact Order interface definition
  • Its properties and types
  • Which file it lives in
  • Which endpoints/functions use it

Result: Fewer hallucinations, fewer agent iterations, more accurate code generation.

When to Use Kartograph

  • Onboarding to a new codebase: Index your project once, give your AI agent the full picture
  • In CI/CD: Keep the codemap fresh on every commit, so your agent always has current context

Requirements

  • Node.js 18+
  • Works with both JavaScript and TypeScript codebases
  • TypeScript projects should use a project tsconfig.json for best results

How It Works

  1. Compile: npx kartograph compile-for-ai scans your JS/TS codebase and builds the codemap artifacts
  2. Write: Outputs a structured codemap.json plus human-readable map files in .codemap/
  3. Serve: npx kartograph mcp exposes the codemap through an MCP (Model Context Protocol) server
  4. Sync: npx kartograph watch keeps the codemap fresh as files change (local dev or CI workflows)

Installation

Use one of these two options:

  1. Run directly with npx (no install):
npx kartograph compile-for-ai
  1. Install globally for repeated local usage:
npm install -g kartograph

Usage

npx kartograph compile-for-ai
npx kartograph watch
npx kartograph mcp

What It Generates

Kartograph writes the following artifacts to your repository:

  • .codemap/overview.md - High-level project summary (modules, major flows, and key entry points).
  • .codemap/types.md - Consolidated type and interface index with links to source locations.
  • .codemap/endpoints.md - HTTP/API endpoint inventory with handler mappings and related types.
  • .codemap/architecture.md - Component-level architecture view and service/module relationships.
  • .codemap/codemap.json - Machine-readable source of truth used by MCP tools.
  • .codemap/dashboard.html - Human-friendly visual dashboard for browsing codemap insights.
  • .vscode/mcp.json - MCP server configuration for local agent/editor integration.

Integration with AI Agents

Once running, Kartograph exposes MCP tools that agents can call:

  • get_overview - Returns a project-wide summary so agents can reason about structure before editing.
  • search_types - Finds matching types/interfaces by name and returns where they are defined.
  • get_type_details - Expands a specific type with fields, signatures, and related references.
  • get_endpoints - Lists API endpoints, methods, routes, and linked handlers.
  • get_architecture - Provides module/service dependency topology and high-level flow information.
  • get_file_context - Returns focused structural context for one file without full-file crawling.
  • get_diagnostics - Surfaces codemap/build diagnostics so agents can avoid broken assumptions.
  • get_dependencies - Shows dependency relationships between files/modules/packages.

License

MIT