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

@mohantn/gate-keeper

v2.3.8

Published

Real-time code quality gates & dependency graph for AI-assisted development. MCP server for Claude Code, GitHub Copilot, and any MCP-compatible agent.

Readme


What it is

Gate Keeper is a pure MCP tool server that analyzes code (TypeScript/JS via SonarJS, C# via SonarAnalyzer.CSharp), assigns quality ratings (0–10), and exposes a live dependency graph through 7 MCP tools and a web dashboard.

The AI agent (Claude Code, Copilot, Cline, etc.) calls the MCP tools to understand code quality before editing and verify quality after edits. Gate Keeper provides the analysis — how the AI uses it is up to the agent and its tool-use policy.


Install

npm install -g @mohantn/gate-keeper

Installs two CLI commands: gate-keeper and gk.


Quick Start

gate-keeper setup            # Install deps, build, start daemon
gate-keeper daemon           # Start the daemon (ports 5378 / 5379)
gate-keeper mcp              # Start MCP server (stdio JSON-RPC)
gate-keeper dashboard        # Open http://localhost:5378/viz
gate-keeper status           # Check daemon health

| Command | Description | |---------|-------------| | gate-keeper setup | First-time setup: install deps, build, start daemon | | gate-keeper daemon | Start the daemon (ports 5378 / 5379) | | gate-keeper mcp | Start the MCP server (stdio JSON-RPC, consumed by AI agents) | | gate-keeper dashboard | Open the live dashboard in browser | | gate-keeper status | Check daemon health | | gk <command> | Short alias for any command |


MCP Tools — 7 Tools

All tools are available via a single MCP server: gate-keeper mcp

| Tool | Input | Output | When to use | |------|-------|--------|-------------| | register_repo | repo_path (required) | { repo, isNew, scanTriggered } | Session start — register the repo with the daemon | | get_quality_rules | None | Scoring thresholds and deduction rules (static) | Session start — understand what's enforced | | get_file_context | file_path (required), from_cache (optional, default false) | Full quality dossier: rating, violations, imports, dependents, trend | Before AND after editing a file | | get_method_context | file_path (required), method_name (optional) | Method-level blast radius: calls, dependents, all methods | Before editing a specific method | | get_dependency_graph | repo (optional) | Full graph in compact LLM-optimized format | Architecture analysis, full repo context | | get_graph_summary | repo (optional) | Pre-computed analytics: hotspots, worst files, coupling | Session start — codebase overview | | get_codebase_health | directory (optional), max_files (optional) | Avg rating, distribution, worst files, fix order | After bulk changes (3+ files) |

Key Behavioral Details

  • register_repo — Only triggers a scan if the repo is new (no cached data). Safe to call multiple times.
  • get_file_context — When from_cache=true fetches cached data from SQLite (fast). Default (false) runs a full analysis. External hook scripts should pass from_cache=true for pre-edit context and omit it for post-edit verification.
  • get_dependency_graph — Returns the full graph which may be large. Use get_graph_summary for pre-computed analytics instead.

VS Code / Copilot / Cline Setup

Create .vscode/mcp.json in your project:

{
  "servers": {
    "gate-keeper": {
      "command": "gate-keeper",
      "args": ["mcp"]
    }
  }
}

Works with both global install and local clone — gate-keeper is always on PATH.


Architecture

AI Agent (Claude Code / Copilot / Cline)
    │
    ├── MCP tools via stdio JSON-RPC
    │     └── gate-keeper mcp
    │           └── 7 tools: register_repo, get_file_context, etc.
    │
    ▼
┌──────────────────────────────────────────────────────────────┐
│                     Daemon (port 5378 + 5379)                │
│                                                              │
│  IPC endpoints:  /repo-register, /analyze, /repos, /health  │
│  API endpoints:  /api/graph, /api/file-detail, /api/trends, │
│                  /api/cycles, /api/hotspots, /api/scan, ... │
│  WebSocket:      Live updates to dashboard clients           │
│                                                              │
│  UniversalAnalyzer pipeline:                                 │
│    readFile → MetricsExtractor → DependencyExtractor         │
│            → SonarJS/CSharpAnalyzer → CoverageAnalyzer       │
│            → RatingCalculator → SqliteCache → WebSocket      │
│                                                              │
└──────────────────────────────────────────────────────────────┘
    │
    ▼
┌──────────────────────────────────────────────────────────────┐
│               SQLite Cache (~/.gate-keeper/cache.db)         │
│  Tables: analyses, rating_history, repositories, positions   │
└──────────────────────────────────────────────────────────────┘

C# Analysis

Gate Keeper analyzes C# files (.cs) through a dual-mode system:

| Mode | When used | Capabilities | |------|-----------|-------------| | Roslyn | dotnet 8+ SDK detected | Full AST analysis: violations, type resolution, method calls | | Regex fallback | No dotnet SDK | Structural analysis: dependencies, metrics, method extraction |

Build the Roslyn analyzer:

npm run build:csharp

Quality Workflow

At session start:

// AI agent calls via MCP:
register_repo({ repo_path: "/path/to/project" })
get_quality_rules({})
get_graph_summary({})

Before editing a file:

get_file_context({ file_path: "/path/to/file.ts", from_cache: true })
get_method_context({ file_path: "/path/to/file.ts", method_name: "myFunction" })

After editing a file:

get_file_context({ file_path: "/path/to/file.ts" })
// ↑ This triggers re-analysis and returns the new rating

After bulk changes (3+ files):

get_codebase_health({ directory: "/path/to/project" })

Troubleshooting

| Symptom | Cause | Fix | |---------|-------|-----| | Daemon won't start | Missing runtime dependency or port conflict | Run npm install -g @mohantn/gate-keeper again, or kill processes on 5378/5379 | | Agent can't call MCP tools | MCP server not configured | Add .vscode/mcp.json or configure Claude Code settings | | get_file_context returns no data | Repo hasn't been registered yet | Call register_repo first to trigger initial scan | | Dashboard shows no data | Daemon not running or repo not scanned | Run gate-keeper daemon then call register_repo |


License

MIT — see LICENSE.