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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@putao520/gcode

v0.13.0

Published

Advanced code search and project understanding tool with four-layer indexing - MCP Server for Code Intelligence

Readme

GCode - MCP Server for Zero-Error AI Code Development

Rust License: MIT Platform Version

🚨 BREAKTHROUGH: First MCP server that enables 100% error-free AI code development through intelligent constraints and architectural guidance.

🎯 Core Mission

GCode prevents AI assistants from making architectural and implementation errors before they happen.

Unlike traditional code analysis tools, GCode operates as a development plan constraint generator that provides AI assistants with the context they need before coding begins.

✅ What GCode Guarantees

Through MCP protocol enforcement, GCode ensures 100% elimination of:

  • 🚫 Architectural Errors - Wrong patterns, broken layering, incompatible tech stack choices
  • 🚫 Implementation Errors - Duplicate code, inconsistent patterns, ignored existing components
  • 🚫 Breaking Changes - Modified public APIs, broken dependencies, compatibility issues
  • 🚫 Redundant Development - Reimplementing existing functionality, wasted effort

🏗️ Architecture Overview

UPSG 7-Layer Intelligence Model

┌─────────────────────────────────────────────────────┐
│                  MCP Protocol Layer                  │
│            AI-Friendly Tool Descriptions             │
├─────────────────────────────────────────────────────┤
│           Tool Implementation (2 tools)              │
│    • pre_plan         • project_overview   │
├─────────────────────────────────────────────────────┤
│              Query Engine                             │
│    • BM25 Search     • Vector Search      • UPSG      │
├─────────────────────────────────────────────────────┤
│            Storage Layer                              │
│    • SurrealDB (Embedded) • UPSG Data Model          │
├─────────────────────────────────────────────────────┤
│           Analysis Pipeline                           │
│    • Tree-sitter Parsers • 5-Perspective Extractors   │
│    • 18 Framework Adapters                          │
└─────────────────────────────────────────────────────┘

Zero-Abstraction Data Model

| Layer | Data Type | Purpose | |-------|-----------|---------| | L1 | Module | Crates, packages, logical groups | | L2 | File | Source code files | | L3 | Symbol | Functions, classes, types | | L4 | Statement | Code statements | | L5 | Reference | Symbol references and relationships | | L6 | Quality | Code quality metrics and analysis | | L7 | Analysis | Import cycles, test mappings, coupling |

🛠️ MCP Tools: Simplicity + Power

GCode provides exactly two tools to maintain simplicity while delivering comprehensive intelligence:

Tool 1: project_overview - Complete Project Understanding

🎯 Purpose: Understand the project's architecture, patterns, and conventions before coding.

🚨 AI TRIGGER WORDS:

  • "implement", "add", "create", "build", "develop"
  • "review", "analyze", "understand", "explain"
  • "fix", "debug", "optimize", "refactor"

Returns:

  • 📊 Architecture patterns (MVC, Clean Architecture, etc.)
  • 🏗️ Framework usage (React, Vue, Angular, etc.)
  • 📈 Code quality metrics and technical debt
  • 🧪 Test coverage analysis
  • ♻️ Reusable components and utilities
  • 🔗 Module dependencies and coupling analysis

Tool 2: pre_plan - Task-Specific Development Constraints

🎯 Purpose: Get detailed context for specific development tasks to prevent errors.

🚨 AI TRIGGER WORDS:

  • Any task-specific keywords ("user", "auth", "payment", "dashboard")
  • "how to", "where is", "best way to", "should I use"
  • "modify", "update", "extend", "enhance"

Parameters:

  • keywords: Task-specific keywords for exact matching
  • description: Natural language task description
  • max_depth: Relationship traversal depth (default: 2)

Returns:

  • 🎯 Task-specific context and constraints
  • ♻️ Reusable components and existing implementations
  • ⚠️ Risk assessments and potential breaking changes
  • 🧪 Test requirements and coverage gaps
  • 📋 Implementation recommendations following project patterns

🌐 Comprehensive Framework Support

Frontend Framework Ecosystem (18 Frameworks)

JavaScript/TypeScript Frameworks:

  • React - Components, Hooks, Server Actions, JSX/TSX
  • Vue.js - Vue 2/3, Options API, Composition API, script setup
  • Angular - @Component/@Injectable, DI, RxJS
  • Svelte - .svelte compiler, Reactivity system, Store patterns
  • Next.js - App/Pages Router, SSR/SSG, Server/Client Components
  • Nuxt.js - Vue-based SSR, Auto-imports, Middleware, Nitro
  • Remix - Full-stack React, Loader actions, Route conventions
  • Solid.js - Fine-grained reactivity, JSX, CreateSignal
  • Astro - Content-focused, Island architecture, Multi-UI
  • Qwik - Resumable, Lazy loading, No hydration
  • Preact - Lightweight React alternative, 10kb bundle
  • Alpine.js - Minimalist, Reactive declarative syntax
  • Lit - Web components, Declarative templates, Scoped styles

Cross-Platform Frameworks:

  • Flutter - Widget tree, State management, Material/Cupertino
  • Qt - QObject hierarchy, Signals/slots, Meta-object system
  • React Native - Native components, Bridge, Platform-specific
  • Electron - Main/Renderer process, IPC, Native APIs
  • Tauri - Rust backend, WebView IPC, Small bundles

Programming Language Support

13 production languages with tree-sitter AST parsing:

  • Rust, TypeScript, JavaScript, Python
  • Go, Java, C/C++, C#, Ruby
  • Dart, Zig, and more...

🚀 Quick Start

Prerequisites

  • Rust 1.70+ (for building from source)
  • Claude Code or any MCP-compatible AI assistant

Installation

# Option 1: Install from crates.io
cargo install gcode

# Option 2: Build from source
git clone https://github.com/gcode/gcode.git
cd gcode
cargo build --release

MCP Configuration

Add to your Claude Code configuration (~/.claude/claude_desktop_config.json):

{
  "mcpServers": {
    "gcode": {
      "command": "gcode",
      "args": []
    }
  }
}

💪 Usage Examples

Example 1: Adding User Authentication

# AI Assistant Workflow:
User: "Implement user authentication with JWT"

# Step 1: AI calls project_overview automatically
# -> Discovers project uses React + TypeScript + Material-UI
# -> Finds existing AuthContext in src/auth/
# -> Identifies JWT utils already implemented

# Step 2: AI calls pre_plan with keywords
# -> Gets reusable LoginButton component
# -> Understands existing API integration patterns
# -> Knows test requirements (80% coverage policy)

# Step 3: AI implements following constraints
# -> Uses existing patterns, avoids duplication
# -> Maintains architectural consistency
# -> Adds appropriate tests

Example 2: Vue.js Feature Enhancement

# AI Assistant Workflow:
User: "Add shopping cart functionality to our Vue app"

# Step 1: project_overview
# -> Detects Vue 3 + Composition API + Pinia
# -> Finds existing ProductCard component
# -> Identifies Vue Router setup

# Step 2: pre_plan(["cart", "shopping", "Pinia"])
# -> Discovers existing CartStore in stores/
# -> Finds reusable useCart composable
# -> Understands component testing patterns

# Result: 100% error-free implementation following Vue best practices

📊 Performance Specifications

Response Times

  • Tool queries: < 200ms (95th percentile)
  • 🔄 Index updates: < 5s per 1000 files
  • 📁 Full reindex: < 60s for projects < 100k files

Resource Usage

  • 💾 Memory: ~100MB base + ~10MB per 10k files
  • 🗄️ Storage: Embedded SurrealDB, ~50MB per project
  • ⚙️ CPU: Minimal impact, background processing

🏢 Platform Support

  • Linux - Full support with pre-built binaries
  • macOS - Full support with universal binaries
  • Windows - Full support (Windows 10+)

🔧 Development

Building

# Debug build
cargo build

# Release build (optimized)
cargo build --release

# Run tests
cargo test

# Run with logging
RUST_LOG=debug cargo run -- --help

Project Commands

# Reset all indexed data
gcode reset

# Show version
gcode --version

📁 Project Structure

gcode/
├── src/
│   ├── mcp/              # MCP server implementation
│   │   ├── server.rs     # Main MCP server with enhanced tool descriptions
│   │   └── tools/        # pre_plan and project_overview implementations
│   ├── storage/          # SurrealDB storage layer
│   ├── upsg/             # Universal Program Structure Graph (7-layer)
│   ├── pipeline/         # Unified analysis pipeline
│   ├── extractors/       # Data extractors (5 perspectives)
│   └── library/          # Framework adapters (18 frameworks)
├── SPEC/                 # Complete architecture specifications
├── tests/                # Comprehensive test suites
└── Cargo.toml           # Project configuration

📚 Documentation

🤝 Contributing

We welcome contributions! Please see our Development Guidelines for details.

Code Style

  • Follow Rust standard conventions
  • Use cargo fmt for formatting
  • Use cargo clippy for linting
  • Write tests for new features

📄 License

MIT License - see LICENSE file for details.

🔗 Related Projects


🎯 Why GCode is Different

Traditional tools: Help you fix errors after they happen GCode: Prevents errors from happening in the first place

By providing AI assistants with comprehensive project context and development constraints before coding begins, GCode enables a new paradigm of zero-error AI code development.

GCode - The intelligent constraint system that makes AI code development error-proof.