
一个强大的 Go 代码库分析器,将代码转换为可探索的图表,使 AI 助手能够通过模型上下文协议(MCP)理解复杂的代码库。
概览
一个强大的 Go 代码库分析器,将代码转换为可探索的图表,使 AI 助手能够通过模型上下文协议(MCP)理解复杂的代码库。 Go 代码图分析 Go 源代码,创建包含包、类型、函数及其关系的全面图表示。该图可以是: - 以交互式网页界面可视化 - 存储在 Neo4j 中以处理复杂查询 - 通过 MCP 由 AI 助手查询以实现智能代码理解 - : 从 Go AST 提取 9 种节点类型和 12 种关系类型 - : 可实时过滤处理 4,000+ 节点的网页界面 - : MCP 服务器支持对代码的自然语言查询 - : Neo4j 集成用于复杂架构分析 - : 在拥有 97 个软件包和 4,000+ 节点的代码库上成功测试 - : 可选嵌入以增强代码理解 将输出复制到你的Claude Desktop配置文件中: - : ~/图书馆/应用程序...
概述(AI 翻译)
一个强大的 Go 代码库分析器,将代码转换为可探索的图表,使 AI 助手能够通过模型上下文协议(MCP)理解复杂的代码库。
什么是Go Code Graph?
Go 代码图分析 Go 源代码,创建包含包、类型、函数及其关系的全面图表示。该图可以是:
- 以交互式网页界面可视化
- 存储在 Neo4j 中,用于复杂查询
- 通过 MCP 由 AI 助手查询,实现智能代码理解
主要特色
- ** 🔍 深度代码分析**:从Go AST提取9种节点类型和12种关系类型
- ** 🎨 交互式可视化**:支持4,000+个节点的网页界面,支持实时过滤
- ** 🧠 AI驱动理解**:MCP服务器支持对你的代码进行自然语言查询
- ** 📊 图数据库**:用于复杂架构分析的Neo4j集成
- ** 🚀 企业规模**:在拥有97个软件包和4,000+节点的代码库上成功测试
- ** ⚡ 语义搜索**:可选嵌入以增强代码理解
快速入门 MCP
1.使用 Docker 设置(推荐)
2.
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Go Code Graph
A powerful Go codebase analyzer that transforms code into explorable graphs, enabling AI assistants to understand complex codebases through the Model Context Protocol (MCP).
What is Go Code Graph?
Go Code Graph analyzes Go source code to create a comprehensive graph representation of your codebase structure, including packages, types, functions, and their relationships. This graph can be:
- Visualized in an interactive web interface
- Stored in Neo4j for complex queries
- Queried by AI assistants through MCP for intelligent code understanding
Key Features
- 🔍 Deep Code Analysis: Extracts 9 node types and 12 relationship types from Go AST
- 🎨 Interactive Visualization: Web interface handling 4,000+ nodes with real-time filtering
- 🧠 AI-Powered Understanding: MCP server enables natural language queries about your code
- 📊 Graph Database: Neo4j integration for complex architectural analysis
- 🚀 Enterprise Scale: Successfully tested on codebases with 97 packages and 4,000+ nodes
- ⚡ Semantic Search: Optional embeddings for enhanced code understanding
Quick Start with MCP
1. Setup with Docker (Recommended)
# Clone and setup
git clone https://github.com/brutski/go-code-graph.git
cd go-code-graph
make dev-setup # Starts Neo4j and builds MCP server image
2. Configure Claude Desktop
make generate-mcp-config # Generates exact configuration needed
Copy the output to your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
3. Start Using with AI
The MCP server is now ready! Your AI assistant can analyze any Go codebase.
MCP Tools and Prompts
The MCP server provides two ways to analyze your codebase:
MCP Prompts (Guided Workflows)
The MCP server includes 15 comprehensive prompts that guide you through common analysis tasks. These prompts show the AI assistant exactly which tools to use and in what order, ensuring best practices and comprehensive coverage. See MCP Prompts Guide for detailed documentation.
Example prompts:
analyze_new_codebase- Complete initial analysis with architecture overviewassess_code_quality- Comprehensive quality assessment with actionable insightsanalyze_change_impact- Understand effects before making changesdebug_execution_flow- Trace execution paths for debuggingplan_refactoring- Get step-by-step refactoring guidance
When to use prompts: Starting new analysis tasks, following best practices, ensuring comprehensive coverage.
MCP Tools (Building Blocks)
The MCP server provides 8 powerful tools for direct codebase analysis. These are the building blocks that prompts use, but you can also use them directly for specific queries and custom exploration:
🔍 analyze_workspace
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →