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

claude-code-compact-mcp

v1.1.0

Published

MCP server for compacting Claude Code conversations into Navigate Chat visualizations

Readme

Claude Code Compact MCP

npm version npm downloads License: MIT

An MCP (Model Context Protocol) server that helps compact Claude Code conversations into Navigate Chat-compatible visualizations.

Overview

This lightweight MCP server provides utility tools for:

  • Parsing conversations from Claude Code CLI, Claude Desktop, or Claude Web
  • Exporting visualization JSON to local files
  • Pushing visualizations to Navigate Chat API

Supported Formats:

  • Claude Code CLI (.jsonl transcripts)
  • Claude Desktop/Web (copy/paste Human:/Assistant: format)

Key Design: Claude Code generates the visualization JSON directly using the included skill.md prompt. No external LLM API calls needed.

Installation

Via npm (Recommended)

npm install -g claude-code-compact-mcp

Or run directly with npx:

npx claude-code-compact-mcp

From Source

git clone https://github.com/Asar007/claude-code-compact-mcp.git
cd claude-code-compact-mcp
npm install
npm run build

Quick Start

1. Add to Claude Desktop

Add this to your Claude Desktop config:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "claude-code-compact": {
      "command": "npx",
      "args": ["-y", "claude-code-compact-mcp"]
    }
  }
}

1b. Add to Claude Code CLI

Add this to your Claude Code MCP settings:

  • macOS/Linux: ~/.claude.json
  • Windows: %USERPROFILE%\.claude.json
{
  "mcpServers": {
    "claude-code-compact": {
      "command": "npx",
      "args": ["-y", "claude-code-compact-mcp"]
    }
  }
}

2. (Optional) Configure Navigate Chat API

Only needed if you want to push visualizations to Navigate Chat:

{
  "mcpServers": {
    "claude-code-compact": {
      "command": "npx",
      "args": ["claude-code-compact-mcp"],
      "env": {
        "NAVIGATE_CHAT_API_URL": "http://localhost:8000",
        "NAVIGATE_CHAT_EMAIL": "your-email",
        "NAVIGATE_CHAT_PASSWORD": "your-password"
      }
    }
  }
}

3. Use It

In Claude Desktop:

/compact

or

/compact type:sequence

Claude will automatically read the entire conversation and create a visualization.

In Claude Code CLI:

compact this conversation

Visualization Types:

  • mindmap (default) - Hierarchical topic breakdown
  • sequence - Process flow diagram
  • knowledge_graph - Entity relationships
  • timeline - Chronological events

The tool auto-detects the format and extracts key information. Visualizations are saved to ~/.claude-code-compact/visualizations/.

Tools

| Tool | Description | |------|-------------| | compact_conversation | Parse JSONL transcript → extract topic, key points, entities, actions | | export_json | Save visualization JSON to ~/.claude-code-compact/visualizations/ | | push_to_navigate | Push visualization to Navigate Chat API |

compact_conversation

Extracts structured information from any Claude conversation.

// Input - JSONL file (Claude Code CLI)
{ source: "path/to/transcript.jsonl" }

// Input - Plain text (Claude Desktop/Web)
{
  source: "Human: How do I create a React component?\n\nAssistant: Here's how to create a React component...",
  isFilePath: false
}

// Output
{
  topic: "Main discussion topic",
  keyPoints: ["point1", "point2"],
  entities: ["file.ts", "ComponentName"],
  actions: ["created X", "fixed Y"],
  messageCount: 42
}

export_json

Saves visualization to a local file.

// Input
{
  visualization: { /* mindmap/sequence/graph/timeline JSON */ },
  type: "mindmap"
}

// Output
{
  filePath: "/home/user/.claude-code-compact/visualizations/mindmap_topic_2024-01-15.json",
  filename: "mindmap_topic_2024-01-15.json"
}

push_to_navigate

Pushes visualization to Navigate Chat.

// Input
{ visualization: { /* JSON */ } }

// Output
{
  threadId: "abc-123",
  threadUrl: "http://navigatechat.com/chat/abc-123",
  success: true
}

Visualization Types

The skill.md file contains complete instructions for generating:

Mindmap

Hierarchical topic exploration with root → categories → leaves.

Sequence Diagram

Process flows showing interactions between participants.

Knowledge Graph

3-level tree structure for entity relationships.

Timeline

Chronological events with dates and descriptions.

Project Structure

claude-code-compact-mcp/
├── src/
│   ├── index.ts                 # Entry point
│   ├── server.ts                # MCP server setup
│   ├── tools/
│   │   ├── compact-conversation.ts
│   │   ├── export-json.ts
│   │   └── push-to-navigate.ts
│   ├── services/
│   │   ├── conversation-extractor.ts
│   │   ├── file-service.ts
│   │   └── navigate-api-client.ts
│   ├── schemas/                 # Zod validation
│   └── types/
├── skill.md                     # LLM prompt for generating visualizations
├── package.json
└── tsconfig.json

Development

# Install dependencies
npm install

# Development mode (with hot reload)
npm run dev

# Build for production
npm run build

# Type check
npm run typecheck

How It Works

  1. User asks Claude Code to "compact this conversation"
  2. Claude Code reads skill.md to understand the JSON formats
  3. Claude Code analyzes the conversation and generates appropriate visualization JSON
  4. Claude Code calls export_json to save locally
  5. Optionally calls push_to_navigate to upload to Navigate Chat
┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   Claude Code   │────▶│   skill.md      │────▶│  Generate JSON  │
│   (User asks)   │     │   (Instructions)│     │  (No API call)  │
└─────────────────┘     └─────────────────┘     └────────┬────────┘
                                                         │
                        ┌────────────────────────────────┼────────────────────────────────┐
                        ▼                                ▼                                ▼
               ┌─────────────────┐              ┌─────────────────┐              ┌─────────────────┐
               │  export_json    │              │ push_to_navigate│              │  Return to user │
               │  (Save file)    │              │  (Upload API)   │              │  (Display JSON) │
               └─────────────────┘              └─────────────────┘              └─────────────────┘

Requirements

  • Node.js 18+
  • Claude Code with MCP support

License

MIT

Related