Skip to main content
Glama
README.md
# πŸ—ΊοΈ CodeAtlas MCP Server

**Give your AI assistant deep understanding of any codebase**

[![npm](https://img.shields.io/npm/v/@giauphan/codeatlas-mcp?logo=npm)](https://www.npmjs.com/package/@giauphan/codeatlas-mcp)
[![CI](https://github.com/giauphan/codeatlas-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/giauphan/codeatlas-mcp/actions)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![Node](https://img.shields.io/badge/Node-%3E%3D18-brightgreen?logo=node.js)](https://nodejs.org/)

> A standalone [MCP](https://modelcontextprotocol.io/) server that exposes code analysis data to **Gemini, Claude, Cursor, Windsurf, VS Code Copilot** β€” with persistent AI memory between conversations.

---

## ✨ What Does It Do?

```
Your Code β†’ CodeAtlas Analyze β†’ MCP Server β†’ AI Understands Everything
                                     β”‚
                              10 powerful tools:
                              β€’ Search functions & classes
                              β€’ Trace feature flows
                              β€’ Generate architecture diagrams
                              β€’ Persistent memory across conversations
```

**Before CodeAtlas:** AI greps blindly, forgets your project every conversation.
**After CodeAtlas:** AI instantly knows your architecture, dependencies, and remembers context.

---

## πŸš€ Setup (1 minute)

### 1. Analyze your project

Install the [CodeAtlas extension](https://github.com/giauphan/CodeAtlas), then:

```
Ctrl+Shift+P β†’ CodeAtlas: Analyze Project
```

### 2. Add MCP config to your AI

<details>
<summary>🟒 <b>Gemini / Antigravity</b> β€” <code>.gemini/settings.json</code></summary>

```json
{
  "mcpServers": {
    "codeatlas": {
      "command": "npx",
      "args": ["-y", "@giauphan/codeatlas-mcp"]
    }
  }
}
```
</details>

<details>
<summary>⚫ <b>Cursor</b> β€” <code>.cursor/mcp.json</code></summary>

```json
{
  "mcpServers": {
    "codeatlas": {
      "command": "npx",
      "args": ["-y", "@giauphan/codeatlas-mcp"]
    }
  }
}
```
</details>

<details>
<summary>πŸ”΅ <b>VS Code Copilot</b> β€” <code>.vscode/settings.json</code></summary>

```json
{
  "mcp": {
    "servers": {
      "codeatlas": {
        "command": "npx",
        "args": ["-y", "@giauphan/codeatlas-mcp"]
      }
    }
  }
}
```
</details>

<details>
<summary>🟣 <b>Claude Desktop</b> β€” <code>claude_desktop_config.json</code></summary>

```json
{
  "mcpServers": {
    "codeatlas": {
      "command": "npx",
      "args": ["-y", "@giauphan/codeatlas-mcp"]
    }
  }
}
```
</details>

<details>
<summary>🟣 <b>Claude Code CLI</b></summary>

```bash
claude mcp add codeatlas -- npx -y @giauphan/codeatlas-mcp
```
</details>

<details>
<summary>πŸ”΄ <b>Windsurf</b> β€” <code>.windsurf/mcp.json</code></summary>

```json
{
  "mcpServers": {
    "codeatlas": {
      "command": "npx",
      "args": ["-y", "@giauphan/codeatlas-mcp"]
    }
  }
}
```
</details>

> **Done!** Your AI can now use all 10 CodeAtlas tools.

---

## πŸ› οΈ 10 MCP Tools

### Code Analysis (6 tools)

| Tool | Description | Example Use |
|------|-------------|-------------|
| `list_projects` | List all analyzed projects | "What projects do I have?" |
| `get_project_structure` | Get modules, classes, functions | "Show me all classes" |
| `get_dependencies` | Import/call/containment relationships | "What does UserService depend on?" |
| `get_insights` | Code quality & security analysis | "Any security issues?" |
| `search_entities` | Fuzzy search entities by name | "Find the login function" |
| `get_file_entities` | All entities in a specific file | "What's in auth.ts?" |

### Architecture Visualization (2 tools)

| Tool | Description | Example Use |
|------|-------------|-------------|
| `generate_system_flow` | Mermaid architecture diagram (module imports) | "Show me the system architecture" |
| `generate_feature_flow_diagram` ⭐ | Mermaid execution flow diagram (call chains) | "How does the payment feature work?" |

### AI Memory (2 tools)

| Tool | Description | Example Use |
|------|-------------|-------------|
| `sync_system_memory` | Save context to `.agents/memory/` | "Remember what we changed" |
| `trace_feature_flow` | Trace feature through codebase | "What files are involved in auth?" |

---

## 🧠 AI Memory β€” Persistent Context

AI assistants forget everything between conversations. CodeAtlas fixes this:

```
Conversation 1 β†’ AI analyzes code β†’ sync_system_memory
                                          β”‚
                                   .agents/memory/
                                   β”œβ”€β”€ system-map.md       ← Architecture diagram
                                   β”œβ”€β”€ modules.json        ← All entities
                                   β”œβ”€β”€ conventions.md      ← Code patterns
                                   β”œβ”€β”€ business-rules.json ← Domain logic
                                   β”œβ”€β”€ feature-flows.json  ← Feature traces
                                   └── change-log.json     ← Change history
                                          β”‚
Conversation 2 β†’ AI reads memory β†’ full context restored instantly ✨
```

### Auto-Generated IDE Rules

When you run `Analyze Project`, CodeAtlas auto-creates rule files for your AI IDE:

| Generated File | For |
|---|---|
| `.agents/rules/codeatlas-mcp.md` | All AI assistants |
| `.cursor/rules/codeatlas.mdc` | Cursor |
| `CLAUDE.md` | Claude Code |
| `.windsurfrules` | Windsurf |

These tell your AI to:
1. Read `.agents/memory/` at the start of every conversation
2. Use MCP tools before making changes
3. Call `sync_system_memory` after completing changes

---

## 🌍 Supported Languages

| Language | Features |
|----------|----------|
| **TypeScript / JavaScript** | Full AST: imports, classes, functions, variables, calls, implements |
| **Python** | Classes, functions, variables, imports, calls |
| **PHP** | Classes, interfaces, traits, enums, functions, properties |
| **Blade Templates** | `@extends`, `@include`, `@component`, `<x-component>` |

---

## πŸ“¦ Alternative: Global Install

```bash
npm install -g @giauphan/codeatlas-mcp
```

Then use `"command": "codeatlas-mcp"` in your MCP config (no `args` needed).

---

## πŸ”§ Environment Variables

| Variable | Description |
|----------|-------------|
| `CODEATLAS_PROJECT_DIR` | Force a specific project directory |

> By default, the server auto-discovers all projects with `.codeatlas/analysis.json` under `~/`.

---

## πŸ§‘β€πŸ’» Development

```bash
git clone https://github.com/giauphan/codeatlas-mcp.git
cd codeatlas-mcp
npm install
npm run build
npm test    # 6 tests
npm start   # Start MCP server
```

---

## πŸ”— Related

- [CodeAtlas Extension](https://github.com/giauphan/CodeAtlas) β€” VS Code extension with interactive code graph
- [MCP Protocol](https://modelcontextprotocol.io/) β€” Model Context Protocol standard

## License

[MIT](LICENSE) β€” Free for personal and commercial use.

TDQS

A3.7/5.0

Scored across 10 tools

Disambiguation4/5

Most tools have distinct purposes. However, `generate_feature_flow_diagram` and `trace_feature_flow` both trace feature flow by keyword, differing only in output format (diagram vs. ordered list). Descriptions help differentiate, but an agent might still select the wrong one for a given need.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (e.g., `generate_feature_flow_diagram`, `get_dependencies`, `list_projects`). No mixed conventions or vague verbs.

Tool Count5/5

With 10 tools, the set covers the domain of code analysis and documentation well. Each tool serves a distinct, necessary function without redundancy or bloat.

Completeness4/5

The tool surface covers core CRUD-like operations for projects and entities, plus advanced analysis (flows, insights, memory sync). Minor gaps exist, such as no tool for editing entities or comparing versions, but core workflows are supported.

Maintenance

ActivityInactive
ResponsivenessNo issues