giauphan/CodeAtlas
GitHub: giauphan/CodeAtlas
一款为多 IDE 提供持久化记忆与 MCP 工具链的 AI 代码分析平台,解决上下文丢失与代码理解成本高的问题。
Stars: 0 | Forks: 0
# 🗺️ CodeAtlas
**AI-powered code analysis & memory for VS Code, Cursor, Windsurf**
[](https://github.com/giauphan/CodeAtlas/releases)
[](https://marketplace.visualstudio.com/)
[](https://www.npmjs.com/package/@giauphan/codeatlas-mcp)
[](https://github.com/giauphan/CodeAtlas/actions)
[](LICENSE)
## ✨ 为何选择 CodeAtlas?
| Problem | CodeAtlas Solution |
|---|---|
| AI forgets your project structure every conversation | **Persistent memory** in `.agents/memory/` |
| AI greps files blindly, missing relationships | **10 MCP tools** for instant code intelligence |
| No way to see how features flow through code | **Mermaid diagrams** of execution flows |
| Hard to onboard on new codebases | **Auto-generated architecture maps** |
| Different AI IDEs need different configs | **Auto-generates rules** for Cursor, Claude, Windsurf, Gemini |
## 🚀 快速开始(2 分钟)
### 步骤 1:安装扩展
Download `codeatlas-1.6.0.vsix` from [Releases](https://github.com/giauphan/CodeAtlas/releases), then:
```
VS Code: Extensions → ⋯ → Install from VSIX
```
### 步骤 2:分析项目
```
Ctrl+Shift+P → CodeAtlas: Analyze Project
```
This generates:
- `.codeatlas/analysis.json` — Code structure data
- `.agents/memory/` — AI-readable system documentation
- `.agents/rules/` — MCP instructions for AI
- IDE-specific rules for **Cursor** / **Claude** / **Windsurf** (auto-detected)
### 步骤 3:连接 AI
Pick your AI IDE and add the MCP config:
🟢 Gemini / Antigravity —
```
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
```
⚫ Cursor —
```
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
```
🔵 VS Code Copilot —
```
{
"mcp": {
"servers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
}
```
🟣 Claude Desktop —
```
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
```
🔴 Windsurf —
```
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
```
## 🛠️ MCP 工具(10 个工具)
### 代码分析
| Tool | What it does |
|------|-------------|
| `list_projects` | List all analyzed projects (auto-discovers `~/`) |
| `get_project_structure` | Get all modules, classes, functions, variables |
| `get_dependencies` | Get import / call / containment / implements relationships |
| `get_insights` | AI-generated code quality & security insights |
| `search_entities` | Fuzzy search by entity name (faster than grep!) |
| `get_file_entities` | Get all entities defined in a specific file |
### 架构可视化
| Tool | What it does |
|------|-------------|
| `generate_system_flow` | Auto-generate Mermaid **architecture diagrams** (module imports) |
| `generate_feature_flow_diagram` | Auto-generate Mermaid **execution flow diagrams** (call chains) |
### AI 内存
| Tool | What it does |
|------|-------------|
| `sync_system_memory` | Create/update `.agents/memory/` — AI's persistent long-term memory |
| `trace_feature_flow` | Trace a feature through the codebase, returns files in dependency order |
## 🧠 AI 内存系统
AI assistants lose context between conversations. CodeAtlas solves this:
```
Conversation 1 → AI writes code → calls sync_system_memory
│
.agents/memory/
├── system-map.md ← Mermaid architecture
├── modules.json ← All modules & entities
├── conventions.md ← Code patterns & style
├── business-rules.json ← Domain logic
├── feature-flows.json ← Feature traces
└── change-log.json ← What changed & when
│
Conversation 2 → AI reads .agents/memory/ → knows full system flow instantly
```
### 自动生成的 IDE 规则
On `Analyze Project`, CodeAtlas automatically creates rule files so your AI **knows how to use CodeAtlas** out of the box:
| File Generated | For |
|---|---|
| `.agents/rules/codeatlas-mcp.md` | Generic (all AIs) |
| `.agents/rules/auto-memory.md` | Memory read/sync instructions |
| `.cursor/rules/codeatlas.mdc` | Cursor |
| `CLAUDE.md` | Claude Code |
| `.windsurfrules` | Windsurf |
## 🌐 VS Code 扩展功能
- **Interactive Force-Directed Graph** — Visualize code architecture and dependencies
- **AST-Based Analysis** — Deep semantic understanding, not just text matching
- **AI Copilot Chat** — Ask architectural questions about your codebase
- **Entity Overview** — Clear counts of modules, classes, functions, relationships
- **Click-to-Navigate** — Jump from graph nodes to source code
- **Auto-Reanalyze on Save** — Graph updates as you code
- **Search & Filter** — Find specific entities, filter by type
## 🌍 支持的语言
| Language | Parser | Features |
|----------|--------|----------|
| TypeScript / JavaScript | `@typescript-eslint/typescript-estree` | Full AST: imports, classes, functions, variables, calls, implements |
| Python | Regex-based | Classes, functions, variables, imports, calls |
| PHP | Regex-based | Classes, interfaces, traits, enums, functions, properties, constants |
| Blade Templates | Regex-based | `@extends`, `@include`, `@component`, `` |
## 🏗️ 架构
```
graph LR
A[VS Code Extension] -->|Analyze| B(AST Parser)
B -->|Graph Data| C[.codeatlas/analysis.json]
C -->|Read| D[MCP Server]
D -->|10 Tools| E[AI Assistants]
E -->|sync_system_memory| F[.agents/memory/]
F -->|Read at start| E
A -->|Auto-generate| G[IDE Rules]
G -->|.cursor / CLAUDE.md / .windsurfrules| E
A -->|Render| H[React Webview UI]
H -->|Graph| I((react-force-graph-2d))
```
## 📦 技术栈
| Component | Technology |
|---|---|
| Extension Host | VS Code API, TypeScript |
| AST Parser | `@typescript-eslint/typescript-estree`, Python & PHP regex |
| MCP Server | `@modelcontextprotocol/sdk`, Zod |
| Webview UI | React, Vite |
| Graph | `react-force-graph-2d` |
| CI | GitHub Actions |
| Build | `esbuild`, `tsc`, `vsce` |
## 许可证
[MIT](LICENSE) — Free for personal and commercial use.
🟢 Gemini / Antigravity — .gemini/settings.json
```
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
```
⚫ Cursor — .cursor/mcp.json
```
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
```
🔵 VS Code Copilot — .vscode/settings.json
```
{
"mcp": {
"servers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
}
```
🟣 Claude Desktop — claude_desktop_config.json
```
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
```
🟣 Claude Code CLI
``` claude mcp add codeatlas -- npx -y @giauphan/codeatlas-mcp ```🔴 Windsurf — .windsurf/mcp.json
```
{
"mcpServers": {
"codeatlas": {
"command": "npx",
"args": ["-y", "@giauphan/codeatlas-mcp"]
}
}
}
```
标签:AI代码分析, CMS安全, Cursor集成, IDE配置, JavaScript, MCP服务器, Mermaid图, OpenVAS, PHP, Python, TypeScript, VS Code扩展, Windsurf集成, 二进制发布, 代码关系图谱, 代码导航, 代码智能分析, 代码理解, 多语言支持, 威胁情报, 安全插件, 安全测试框架, 开发者工具, 开源工具, 持久化记忆, 数据可视化, 无后门, 架构可视化, 自动化攻击, 自动化规则生成, 逆向工具, 项目结构记忆