Sign In

@memoryx/codegraph-mcp

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@memoryx/codegraph-mcp

CodeGraph MCP server - Cross-language code intelligence for AI assistants

Source
npmnpm
Version
0.11.2
Version published
Weekly downloads
46
-46.51%
Maintainers
1
Weekly downloads
 
Created
Source

CodeGraph

Cross-language code intelligence for AI agents and developers.

VS Code License

CodeGraph builds a semantic graph of your codebase — functions, classes, imports, call chains — and exposes it through 35 tools, a VS Code extension, and a persistent memory layer. AI agents get structured code understanding instead of grepping through files.

Quick Start

MCP Server (Claude Code, Cursor, any MCP client)

npm install -g @memoryx/codegraph-mcp

Add to ~/.claude.json (or your MCP client config):

{
  "mcpServers": {
    "codegraph": {
      "command": "codegraph-mcp",
      "args": []
    }
  }
}

The server indexes the current working directory automatically — no --workspace flag needed. It also accepts MCP roots from the client for workspace discovery.

Multi-project indexing — index multiple codebases into a single graph:

{
  "mcpServers": {
    "codegraph": {
      "command": "codegraph-mcp",
      "args": [
        "--workspace", "/path/to/frontend",
        "--workspace", "/path/to/backend",
        "--workspace", "/path/to/shared-lib"
      ]
    }
  }
}

Excluding directories — skip custom build artifacts or generated code:

{
  "mcpServers": {
    "codegraph": {
      "command": "codegraph-mcp",
      "args": [
        "--exclude", "cmake-build-debug",
        "--exclude", "bazel-out",
        "--exclude", "generated"
      ]
    }
  }
}

Built-in exclusions (always skipped): node_modules, target, dist, build, out, .git, __pycache__, vendor, DerivedData, tmp, coverage, logs.

VS Code Extension

code --install-extension codegraph-0.11.0.vsix

The extension registers all 35 MCP tools plus 3 additional VS Code-specific tools as Language Model Tools. To steer Copilot toward using them:

// .vscode/settings.json
{
  "github.copilot.chat.codeGeneration.instructions": [
    "When analyzing code structure, callers, callees, dependencies, or complexity, prefer codegraph_* tools over file search. CodeGraph has a pre-built semantic graph that returns structured results instantly."
  ]
}

Tools (35)

Code Analysis (9)

ToolWhat it does
get_ai_contextPrimary context tool. Intent-aware (explain/modify/debug/test) with token budgeting. Returns source, related symbols (full or signature-only), file imports, sibling functions, debug hints, architecture.
get_edit_contextEverything needed before editing: source + callers + tests + memories + git history
get_curated_contextCross-codebase context for a natural language query ("how does auth work?")
get_dependency_graphFile/module import relationships with depth control
get_call_graphFunction call chains (callers and callees)
analyze_impactBlast radius prediction — what breaks if you modify, delete, or rename
analyze_complexityCyclomatic complexity with breakdown (branches, loops, nesting, exceptions, early returns)
find_unused_codeDead code detection with confidence scoring
analyze_couplingModule coupling metrics and instability scores

Code Similarity (4)

Powered by Jina Code V2 embeddings — code-aware semantic search trained on 150M+ code pairs across 30 languages.

ToolWhat it does
find_duplicatesDetect duplicate/near-duplicate functions across the codebase. Threshold 0.7 for clones, 0.9+ for near-exact copies.
find_similarFind functions most similar to a given function. "Does this already exist?"
cluster_symbolsGroup functions by semantic similarity — discovers patterns like "all DB access", "all error handlers"
compare_symbolsDeep comparison of two functions: similarity score, structural diff, shared callers/callees, verdict

Code Navigation (12)

ToolWhat it does
symbol_searchFind symbols by name or natural language (hybrid BM25 + Jina Code V2 semantic search)
get_callers / get_calleesWho calls this? What does it call? (with transitive depth)
get_detailed_symbolFull symbol info: source, callers, callees, complexity
get_symbol_infoQuick metadata: signature, visibility, kind
find_by_importsFind files importing a module (moduleName param)
find_by_signatureSearch by param count, return type, modifiers
find_entry_pointsMain functions, HTTP handlers, tests
find_related_testsTests that exercise a given function
traverse_graphCustom graph traversal with edge/node type filters
cross_project_searchSearch across all indexed projects

Memory (10)

Persistent AI context across sessions — debugging insights, architectural decisions, known issues.

ToolWhat it does
memory_store / memory_get / memory_searchStore, retrieve, search memories (BM25 + semantic)
memory_contextGet memories relevant to a file/function
memory_list / memory_invalidate / memory_statsBrowse, retire, monitor
mine_git_history / mine_git_history_for_fileAuto-create memories from commits
search_git_historySemantic search over commit history

All tool names are prefixed with codegraph_ (e.g. codegraph_get_ai_context).

Languages

17 languages parsed via tree-sitter — all with functions, imports, call graph, complexity metrics, dependency graphs, symbol search, impact analysis, and unused code detection:

TypeScript/JS, Python, Rust, Go, C, C++, Java, Kotlin, C#, PHP, Ruby, Swift, Tcl, Verilog/SystemVerilog, COBOL, Fortran

Architecture

MCP Client (Claude, Cursor, ...)        VS Code Extension
        |                                       |
    MCP (stdio)                            LSP Protocol
        |                                       |
        └───────────┐               ┌───────────┘
                    ▼               ▼
            ┌─────────────────────────────┐
            │  Shared Domain Layer (16 modules)  │
            ├─────────────────────────────┤
            │  17 tree-sitter parsers     │
            │  Semantic graph engine      │
            │  AI query engine (BM25)     │
            │  Memory layer (RocksDB)     │
            │  Jina Code V2 (768d ONNX)  │
            │  HNSW vector index          │
            └─────────────────────────────┘

A single Rust binary serves both MCP and LSP. Both protocols call the same domain layer — identical logic, identical results.

  • Indexing: Sub-10s for 100k LOC. Incremental re-indexing on file changes.
  • Queries: Sub-100ms for navigation. Cross-file import and call resolution at index time.
  • Embeddings: Jina Code V2 (768d, code-aware). Auto-downloads on first run (~642MB).

Indexing Configuration

Auto-indexing is off by default. Use the command palette (CodeGraph: Index Directory) for on-demand indexing, or configure paths:

// .vscode/settings.json
{
  "codegraph.indexOnStartup": true,
  "codegraph.indexPaths": [
    "/path/to/project-a",
    "/path/to/project-b"
  ],
  "codegraph.excludePatterns": [
    "**/cmake-build-debug/**",
    "**/bazel-out/**",
    "**/generated/**",
    "**/*.bin"
  ],
  "codegraph.maxFileSizeKB": 1024
}

indexPaths accepts any absolute paths — they don't have to be inside your workspace. All paths are indexed into a single unified graph. In multi-root workspaces, put indexPaths in one settings.json only (arrays are not merged across folders).

Always-skipped directories: node_modules, target, .git, dist, build, out, __pycache__, vendor, DerivedData, tmp, coverage, logs. For MCP, use --exclude flags. For VS Code, use codegraph.excludePatterns with glob syntax.

Building from Source

git clone https://github.com/codegraph-ai/codegraph-vscode
cd codegraph-vscode
npm install
cargo build --release -p codegraph-lsp    # Rust server
npm run esbuild                           # TypeScript extension
npx @vscode/vsce package                  # VSIX

Requires Node.js 18+, Rust stable, VS Code 1.90+.

License

Apache-2.0

Keywords

mcp

FAQs

Package last updated on 27 Mar 2026

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