CA

codegraph-ai/codegraph

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

136 stars 27 forks 质量 86 趋势 31Apache-2.0

CodeGraph构建了你的代码库——函数、类、导入、调用链——的语义图,并通过42个MCP工具、38种语言、VS Code扩展和持久内存层展开。

概览

CodeGraph 构建了你的代码库——函数、类、导入、调用链——的语义图,并通过 、a 、a 、a 和 a 来展示。通过树状解析器进行解析。AI 代理能够获得结构化的代码理解,而不是通过 grep 文件。 添加到 ~/.claude.json(或你的 MCP 客户端配置): 服务器会自动索引当前的工作目录。 一个 VSIX 服务于所有平台。分析引擎不是捆绑的:首次激活时,扩展会提供下载为你平台构建的引擎,并根据已发布的校验码进行验证,并安装到 ~/.codegraph/bin——与 JetBrains 插件使用的相同位置,因此一次下载同时满足两个平台的需求。下载是主动提供的,而非自动执行,因为它是原生二进制文件,需要你的权限。拒绝它,随时从命令面板运行。 一旦引擎存在,扩展会自动启动,并将所有工具注册为 Copilot 的语言模型工具。

概述(AI 翻译)

为AI代理和开发者提供跨语言代码智能。

CodeGraph构建你的代码库——函数、类、导入、调用链——的语义图,并通过42个MCP工具、VS Code扩展、JetBrains IDE插件和持久内存层进行展示。通过树置图解析38种语言。AI代理获得结构化的代码理解,而不是逐一浏览文件。

快速启动

MCP 服务器(Claude 代码、光标、任意 MCP 客户端)

添加到~/.claude.json(或你的MCP客户端配置):

服务器会自动索引当前的工作目录。

VS 代码扩展

安装VSIX变速箱:

一台VSIX服务于所有平台。 分析引擎不包含在内包:首次激活时,扩展会提供下载为你平台构建的引擎,并与已发布的校验和进行验证,并安装到 ~/.codegraph/bin 中——与 JetBrains 插件相同的位置,因此一次下载即可同时满足两者的需求。 下载是提供而非自动执行的,因为它是一个原生二进制文件,运行于你的权限下。 拒绝它,准备好时从命令面板运行CodeGraph:下载分析引擎。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

CodeGraph

Cross-language code intelligence for AI agents and developers.

CodeGraph builds a semantic graph of your codebase — functions, classes, imports, call chains — and exposes it through 42 MCP tools, a VS Code extension, a JetBrains IDE plugin, and a persistent memory layer. Parses 38 languages via tree-sitter. AI agents get structured code understanding instead of grepping through files.

Quick Start

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

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

{
  "mcpServers": {
    "codegraph": {
      "command": "/path/to/codegraph-server",
      "args": ["--mcp"]
    }
  }
}

The server indexes the current working directory automatically.

VS Code Extension

Install the VSIX:

code --install-extension codegraph-0.21.0.vsix

One VSIX serves every platform. The analysis engine is not bundled: on first activation the extension offers to download the engine built for your platform, verifies it against the published checksum, and installs it into ~/.codegraph/bin - the same location the JetBrains plugin uses, so one download serves both. The download is offered rather than performed automatically, because it is a native binary that runs with your permissions. Decline it and run CodeGraph: Download Analysis Engine from the command palette whenever you are ready.

Once an engine is present, the extension starts it automatically and registers all tools as Language Model Tools for Copilot.

JetBrains IDEs

A plugin for IntelliJ IDEA, PyCharm, GoLand, Android Studio and the rest of the family drives the same engine over LSP: Code Vision, Symbols and Memories tool windows, a graph panel, and one-click MCP registration for the AI Assistant. It resolves or downloads the engine the same way the VS Code extension does, sharing ~/.codegraph/bin.

→ jetbrains/README.md for surfaces, engine resolution order, and building from source.

Rules for AI agents

Pre-configured rule files that teach AI coding agents (Claude, Cursor, Windsurf, Codex, Cline) to use CodeGraph MCP tools before falling back to grep / multi-file reads. Maps natural-language intent to the right codegraph_* tool.

→ codegraph-ai/codegraph-rules-for-agents

Setup is cp /codegraph.md ~// (one line per agent — see the rules repo’s README).

GitHub Action — PR review in CI

Drop a workflow into your repo to get an automatic code-graph analysis comment on every PR — blast radius, test gaps, stale docs, suggested reviewers. Runs graph-only (no embeddings, no ONNX model), so it’s fast and needs no API keys — just the built-in GITHUB_TOKEN.

Copy .github/workflows/codegraph-pr.yml

在 GitHub 查看完整 README

安装

npx @vscode/vsce package # VSIX
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "codegraph": { "command": "/path/to/codegraph-server", "args": ["--mcp"] } } }