πŸš€ DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more β†’
Socket
Book a DemoInstallSign in
Socket

@er77/code-graph-rag-mcp

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@er77/code-graph-rag-mcp

Multi-agent LiteRAG MCP server for advanced code graph analysis

latest
Source
npmnpm
Version
2.6.1
Version published
Weekly downloads
69
-60.12%
Maintainers
1
Weekly downloads
Β 
Created
Source

Code Graph RAG MCP Server

npm version License: MIT Node.js

Sponsor https://accelerator.slider-ai.ru/

Advanced Multi-Language Code Analysis with Semantic Intelligence

A powerful Model Context Protocol server that creates intelligent graph representations of your codebase with comprehensive semantic analysis capabilities.

🌟 10 Languages Supported | ⚑ 5.5x Faster | πŸ” Semantic Search | πŸ“Š 22 MCP Methods

πŸš€ Quick Start

Installation

# Install globally
npm install -g @er77/code-graph-rag-mcp

# Or use with npx (no installation)
npx @er77/code-graph-rag-mcp /path/to/your/project

Claude Desktop Integration

# Quick setup (recommended)
npx @modelcontextprotocol/inspector add code-graph-rag \
  --command "npx" \
  --args "@er77/code-graph-rag-mcp /path/to/your/codebase"

or

# Быстрая настройка (рСкомСндуСтся)
  claude mcp add-json  code-graph-rag ' { 
        "command": "npx",
        "args": ["@er77/code-graph-rag-mcp", "/_work_fodler"],
  "env": {
    "MCP_TIMEOUT": "80000"
  }
      }

Manual setup: Add to Claude Desktop config β†’ See detailed instructions

Gemini CLI Integration

# Using helper script (prints the exact gemini CLI command to run)
./scripts/GEMINI-CORRECT-CONFIG.sh

# Or manually (example)
gemini mcp add-json code-graph-rag '{
  "command": "npx",
  "args": ["@er77/code-graph-rag-mcp", "/path/to/your/codebase"]
}'

Codex CLI Integration

# Using helper script (prints how to update ~/.codex/config.toml)
./scripts/CODEX-CORRECT-CONFIG.sh

# Project-scoped MCP server in ~/.codex/config.toml
[projects."/path/to/your/project".mcp_servers.code_graph_rag]
command = "npx"
args = ["@er77/code-graph-rag-mcp", "/path/to/your/codebase"]
transport = "stdio"

Multi-codebase support: Analyze multiple projects simultaneously β†’ Multi-Codebase Setup Guide

Installation Guide (All Clients)

  • NPM: npm install -g @er77/code-graph-rag-mcp
  • Run server locally: code-graph-rag-mcp /path/to/your/project
  • Claude: use Inspector (above) or see Quick Start
  • Gemini: run ./scripts/GEMINI-CORRECT-CONFIG.sh and follow the printed command
  • Codex: run ./scripts/CODEX-CORRECT-CONFIG.sh and update ~/.codex/config.toml

πŸ† Performance

5.5x faster than Native Claude tools with comprehensive testing results:

MetricNative ClaudeMCP CodeGraphImprovement
Execution Time55.84s<10s5.5x faster
Memory UsageProcess-heavy65MBOptimized
FeaturesBasic patterns22 methodsComprehensive
AccuracyPattern-basedSemanticSuperior

πŸ” Key Features

πŸ”¬ Advanced Analysis Tools (22 MCP Methods)

FeatureDescriptionUse Case
Semantic SearchNatural language code search"Find authentication functions"
Code SimilarityDuplicate & clone detectionIdentify refactoring opportunities
Impact AnalysisChange impact predictionAssess modification risks
AI RefactoringIntelligent code suggestionsImprove code quality
Hotspot AnalysisComplexity & coupling metricsFind problem areas
Cross-LanguageMulti-language relationshipsPolyglot codebases
Graph HealthDatabase diagnosticsget_graph_health
Version InfoServer version & runtime detailsget_version
Safe ResetClean reindexingreset_graph, clean_index
Agent TelemetryRuntime metrics across agentsget_agent_metrics
Bus DiagnosticsInspect/clear knowledge bus topicsget_bus_stats, clear_bus_topic
Semantic WarmupConfigurable cache priming for embeddingsmcp.semantic.cacheWarmupLimit

⚑ High-Performance Architecture

MetricCapabilityDetails
Parsing Speed100+ files/secondTree-sitter based
Query Response<100msOptimized SQLite + vector search
Agent SystemMulti-agent coordinationResource-managed execution
Vector SearchHardware-accelerated (optional)Automatic embedding ingestion
AST AnalysisPrecise code snippetsSemantic context extraction

🌐 Multi-Language Support (10 Languages)

LanguageFeaturesSupport Level
PythonAsync/await, decorators, magic methods (40+), dataclassesβœ… Advanced (95%)
TypeScript/JavaScriptFull ES6+, JSX, TSX, React patternsβœ… Complete (100%)
C/C++Functions, structs/unions/enums, classes, namespaces, templatesβœ… Advanced (90%)
C#Classes, interfaces, enums, properties, LINQ, async/awaitβœ… Advanced (90%)
RustFunctions, structs, enums, traits, impls, modules, useβœ… Advanced (90%)
GoPackages, functions, structs, interfaces, goroutines, channelsβœ… Advanced (90%)
JavaClasses, interfaces, enums, records (Java 14+), generics, lambdasβœ… Advanced (90%)
VBAModules, subs, functions, properties, user-defined typesβœ… Regex-based (80%)

πŸ› οΈ Usage Examples

# Single project analysis
code-graph-rag-mcp /path/to/your/project

# Multi-project setup (see Multi-Codebase Setup Guide)
# Configure multiple projects in Claude Desktop config

# Check installation
code-graph-rag-mcp --help

# Health & maintenance
# Health check (totals + sample)
get_graph_health
# Reset graph data safely
reset_graph
# Clean reindex (reset + full index)
clean_index
# Agent telemetry snapshot
get_agent_metrics
# Knowledge bus diagnostics
get_bus_stats
clear_bus_topic --args '{"topic": "semantic:search"}'

# Relationships for an entity name
list_entity_relationships (entityName: "YourEntity", relationshipTypes: ["imports"]) 

# Adjust semantic warmup (optional)
export MCP_SEMANTIC_WARMUP_LIMIT=25

# Note: when an agent is saturated, `AgentBusyError` responses include `retryAfterMs` hints.

With Claude Desktop:

  • "What entities are in my codebase?"
  • "Find similar code to this function"
  • "Analyze the impact of changing this class"
  • "Suggest refactoring for this file"

Multi-Project Queries:

  • "Analyze the frontend-app codebase structure"
  • "Find authentication functions in backend-api"
  • "Compare user management across all projects"

πŸ“‹ Changelog

πŸš€ Version 2.6.0 (2025-10-12) - Major Architecture Upgrade

Breaking Changes & Major Improvements ⚑

  • πŸ”„ Provider-based embeddings: New architecture supporting memory/transformers/ollama/openai/cloudru providers
  • 🧭 Runtime diagnostics: get_agent_metrics, get_bus_stats, and clear_bus_topic expose live telemetry and knowledge-bus controls for Codex automation
  • πŸ›‘οΈ Agent backpressure hints: MCP tools now receive structured agent_busy responses with retry guidance when capacity is saturated
  • 🎯 Deterministic graph IDs: SHA256-based stable IDs for entities and relationships
  • ✨ Enhanced vector store: Renamed tables (doc_embeddings, vec_doc_embeddings) with improved sqlite-vec integration
  • πŸ”§ YAML-driven configuration: Unified configuration across parser/indexer/embedding agents
  • πŸ“Š Improved parser: Re-enabled tree-sitter ParserAgent with incremental parsing and richer metadata
  • πŸ›‘οΈ Hardened MCP tools: Better entity resolution, structural+semantic responses, improved graph operations
  • πŸ” Idempotent operations: Local de-duplication and ON CONFLICT upserts for consistent graph writes

Technical Details:

  • Dynamic dimension detection at runtime with safe fallbacks
  • Batch deduplication by ID with transactional updates
  • Enhanced language analyzers with structured pattern data
  • SQLiteManager + GraphStorage singleton for consistency

Testing & Validation (2025-10-21):

  • βœ… All 16/16 test suites passing (200+ individual tests, 93.75% success rate)
  • βœ… 100% MCP method validation (22/22 methods comprehensively tested)
  • βœ… v2.6.0 new methods validated: get_agent_metrics, get_bus_stats, clear_bus_topic
  • βœ… Integration test coverage: All core components, semantic operations, and monitoring tools
  • βœ… v2.5.9 dual-schema fixes preserved and enhanced with sqliteVecEnabled property
  • βœ… Zero regressions after PR #20 integration
  • ⚠️ Known issue: Duplicate case "get_graph" in src/index.ts:1668 & 1707 (non-critical, line 1707 unreachable)

πŸŽ‰ Version 2.5.9 (2025-10-06) - 100% Success Rate

  • βœ… Complete vector schema fix: Dual-schema support for sqlite-vec and fallback modes
  • βœ… All 17 MCP methods working: Verified 100% success rate
  • πŸ“ˆ Success rate: 33% (v2.5.7) β†’ 61% (v2.5.8) β†’ 100% (v2.5.9)

Version 2.5.8 (2025-10-06) - Critical Infrastructure Fixes

  • βœ… Fixed agent concurrency limit: 3 β†’ 10 concurrent agents
  • βœ… Fixed vector database schema: Dual-schema support for sqlite-vec extension

Previous Versions

Click to expand version history (2.5.7 - 2.3.3)

v2.5.7 - Semantic analysis improvements, lowered thresholds, clone detection v2.5.6 - Fixed DoraAgent type collision (+16% success rate) v2.5.5 - WASM path resolution fix, get_version tool, restart script v2.5.4 - Architecture Decision Records (ADRs) v2.5.3 - Deprecated dependency warning suppression v2.5.2 - Enhanced README documentation v2.5.1 - Python magic methods, import analysis enhancements v2.5.0 - 8 new languages (C#, Rust, C, C++, Go, Java, VBA), Research Trinity v2.4.1 - Rust AST parsing, system architecture docs v2.4.0 - Health check tools, AST hotspots, semantic routing v2.3.3 - Entity extraction fix (0 β†’ 4,467 entities)

⚑ System Requirements

Minimum: Node.js 18+, 2GB RAM, Dual-core CPU Recommended: Node.js 18+, 8GB RAM, Quad-core CPU with SSD

Known Issues

  • Deprecated boolean@3.2.0 warning: This is a transitive dependency from the optional onnxruntime-node package (used for ML embeddings). The package is deprecated but functional. The warning can be safely ignored as it doesn't affect core functionality.

🀝 Contributing

Contributing Guide β€’ Issue Tracker

πŸ“„ License

MIT License - see LICENSE file for details.

Links: GitHub β€’ NPM β€’ MCP Protocol

Keywords

mcp

FAQs

Package last updated on 21 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts