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

@bentlyr/midown

v2.0.11

Published

Headless local context engine and CLI to map codebase dependencies for AI consumption.

Downloads

4,802

Readme

Midown CLI

Architect Your Systems. Let AI Understand Them.

Midown is a headless local context engine and CLI built for developers. It maps your entire codebase into a structured node graph, visualizes the architecture locally, and exposes it via Model Context Protocol (MCP) to any AI coding assistant — keeping your prompt context hyper-efficient and intelligent.

By analyzing the Abstract Syntax Trees (AST) and generating semantic summaries of your files, Midown enables your AI tools (like Claude Desktop, Cursor, or VS Code Copilot) to intrinsically understand your repository layout without exhausting context window limits.


🚀 Installation

Install Midown globally using npm to ensure the CLI is available across all your projects:

npm i -g @bentlyr/midown

📖 Basic Workflow

To get Midown working with your codebase, follow this simple 4-step workflow:

1. Pin your project

Navigate to your project directory and run the add command to set the target workspace.

cd /path/to/your/project
midown add .

2. Setup Your Local or Cloud Model (Recommended: Use Local model with huge context window)

Setup your AI provider via the interactive set command. Download your local models first via Ollama, or grab a cloud API key from your provider.

midown set

// [1] Local-based (Ollama)  |  [2] Cloud-based (OpenAI, Google, Anthropic, OpenRouter)

// [Local]  → Automatically fetches all downloaded Ollama models
// [Cloud]  → Enter API key → Fetches available models from the provider

// Select your model

// 🧠 The max context window for <model> is <N> tokens.  ← shown automatically
// Enter the max context window to use (or press Enter to accept the default)

For local models, Midown auto-detects the exact context window from Ollama's model metadata. For cloud models, it shows a well-known estimate based on the selected model (e.g. Gemini 1.5 Pro = 2M, GPT-4o = 128K, Claude 3.5 = 200K). You can always override the value with your own budget.

3. Index your workspace

Process and parse the codebase. Midown builds a massive local spatial edge index, mapping files, functions, and relational databases.

midown push

4. Start the Context Engine (MCP)

Start the background server process, making the indexed graph available to AI tools on stdio.

midown start

🧠 AI Engine Features

Midown uses an advanced ingestion engine designed to seamlessly handle massive codebases without crashing:

  • Resilient Cloud Indexing: Implements automatic exponential backoff to handle intermittent 500 errors and rate limits from cloud providers (OpenAI, Google, Anthropic).
  • Strict Local LLM Jailbreaking: Optimized specifically for local inference (Ollama, Qwen, Llama). Prevents local models from leaking their internal "Chain of Thought" processing into your database summaries via strict prompt constraints.
  • Flawless Console Output: Background progress bars and processing warnings execute cleanly via smart ANSI line-clearing.

🎨 Interactive Visualization

Midown comes with a stunning built-in visualizer. Once you've indexed your codebase using midown push, you can launch a local dashboard to explore the topological node network visually!

midown visualize

This opens a premium, interactive web dashboard on http://localhost:3456 where you can:

  • Search for any file, function, or database schema.
  • Filter between raw code components and data flows.
  • Interact dynamically: Drag file nodes and watch all associated child functions logically follow them through the physics simulation.
  • Inspect node relationships, abstract syntax connections, and AI semantic summaries in real-time.

🛠️ CLI Commands Reference

  • midown add [directory] - Pins a folder structure to the engine memory map. Defaults to the current working directory.
  • midown set - Interactively configures your AI provider, selects a model, and sets the max context window budget (auto-detected for local Ollama models).
  • midown push - Processes and indexes the directory node-edges natively via AST & Semantic Summaries.
  • midown start - Starts the background MCP server process over standard input/output.
  • midown visualize - Launches a local web-app visualization tool to let you explore the network visually.
  • midown switch <directory> - Changes the active operational environment context to a different folder path.

🤖 MCP Integration

Once Midown is indexing a project, you can attach it to any MCP-compliant AI assistant. For example, to configure Claude Desktop, add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "midown": {
      "command": "midown",
      "args": ["start"]
    }
  }
}

Now, your AI can automatically query the get_codebase_graph, search_nodes, and get_file_context tools provided by Midown!


🔗 Links