---
title: CodeAtlas
emoji: ποΈ
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: "6.0.1"
app_file: app.py
pinned: false
license: mit
tags:
- mcp-in-action-track-consumer
- mcp
- gradio
- llamaindex
- gemini
- elevenlabs
- modal
- openai
- agents
- code-visualization
- fastmcp
- graphviz
- architecture
- visualization
- mcp-server
- mcp-in-action-track-consumer
- mcp-in-action-track-enterprise
- building-mcp-track-consumer
- building-mcp-track-enterprise
---
# ποΈ CodeAtlas
### AI-Powered Codebase Visualization & Understanding
**Transform any GitHub repository into beautiful architecture diagrams with voice narration and AI chat β powered by MCP**
[](https://huggingface.co/spaces/MCP-1st-Birthday/CodeAtlas)
[](https://gradio.app)
[](https://modelcontextprotocol.io)
[](https://llamaindex.ai)
[](https://ai.google.dev)
[](https://openai.com)
[](https://elevenlabs.io)
[](https://modal.com)
**[π Try it Live](https://huggingface.co/spaces/MCP-1st-Birthday/CodeAtlas)** β’ **[πΊ Demo Video](#-demo-video)** β’ **[π± Twitter Post](https://x.com/aghilsabu/status/1995249175336997350?s=20)** β’ **[πΌ LinkedIn Post](https://www.linkedin.com/posts/aghilsabu_codeatlas-ai-powered-codebase-visualization-share-7401015482310393857-vHRg)**
---
## π¬ Demo Video
[](https://youtu.be/J8dcTLzNgpE)
**[βΆοΈ Watch on YouTube](https://youtu.be/J8dcTLzNgpE)**
> *Watch CodeAtlas analyze a GitHub repository in real-time, generate architecture diagrams, and explain the codebase with voice narration.*
---
## π What is CodeAtlas?
**CodeAtlas** is your AI-powered codebase companion that instantly visualizes and explains any software architecture. Simply paste a GitHub URL, and within seconds get:
- πΊοΈ **Beautiful Architecture Diagrams** β AI-generated Graphviz visualizations showing components, layers, and relationships
- π **Voice Narration** β Listen to AI explain your codebase architecture (powered by ElevenLabs)
- π¬ **AI Chat** β Ask questions and get intelligent answers about the code
- π€ **MCP Integration** β Use with Claude Desktop, Cursor, or any MCP-compatible client
**Perfect for:** Code reviews, onboarding new developers, documentation, learning new frameworks, and understanding legacy codebases.
---
## β¨ Key Features
| Feature | Description | Technology |
|---------|-------------|------------|
| π **GitHub Analysis** | Paste any public repo URL and analyze instantly | GitHub API + Smart Filtering |
| π **ZIP Upload** | Upload local codebases for private analysis | File Processing |
| πΊοΈ **Architecture Diagrams** | AI-generated Graphviz diagrams with layers, clusters, and relationships | **Graphviz** + Gemini AI |
| π **Voice Narration** | Natural speech explanation of your architecture | **ποΈ ElevenLabs TTS** |
| π¬ **AI Chat** | Context-aware Q&A about your codebase | **π¦ LlamaIndex** RAG |
| π€ **Multi-Model Support** | Choose between Gemini 3.0/2.5 Pro/Flash or GPT-5.1/5 Mini | **Google Gemini** + **OpenAI** |
| π **Interactive Layout** | Real-time diagram adjustments (direction, spacing, zoom) | Graphviz DOT |
| π **Diagram History** | Browse and reload previous analyses | Local Storage |
| π **MCP Server** | 4 tools for AI agent integration | **FastMCP** |
| βοΈ **Cloud Ready** | One-command serverless deployment | **Modal** |
---
## π MCP Server Integration
CodeAtlas exposes **4 MCP tools** for AI agent integration:
| Tool | Description |
|------|-------------|
| `analyze_codebase` | Generate architecture diagram from GitHub URL |
| `get_architecture_summary` | Get text summary of codebase architecture |
| `chat_with_codebase` | Ask questions about any codebase |
| `list_recent_analyses` | List recently analyzed repositories |
**MCP Endpoint:** `https://huggingface.co/spaces/MCP-1st-Birthday/CodeAtlas/gradio_api/mcp/sse`
---
## π οΈ Tech Stack
CodeAtlas integrates multiple technologies for a comprehensive solution:
| Layer | Technology | Purpose |
|-------|------------|---------|
| **π¨ UI Framework** | [**Gradio 6**](https://gradio.app) | Multi-page routing, `mcp_server=True` |
| **π¦ AI Framework** | [**LlamaIndex**](https://llamaindex.ai) | Unified LLM interface, RAG |
| **β¨ Primary AI** | [**Google Gemini**](https://ai.google.dev) | Gemini 3.0 Pro, 2.5 Pro/Flash |
| **π€ Alternate AI** | [**OpenAI**](https://openai.com) | GPT-5.1, GPT-5 Mini/Nano |
| **ποΈ Voice TTS** | [**ElevenLabs**](https://elevenlabs.io) | High-quality voice narration |
| **βοΈ Backend API** | [**Modal**](https://modal.com) | Serverless API endpoints |
| **π MCP Protocol** | [**FastMCP**](https://github.com/jlowin/fastmcp) | Model Context Protocol |
---
## π Project Structure
```
codeAtlas/
βββ app.py # Main Gradio application entry point
βββ modal_backend.py # Modal serverless API deployment
βββ requirements.txt # Python dependencies
βββ Makefile # Build and run commands
βββ src/
β βββ config.py # Configuration management
β βββ core/
β β βββ analyzer.py # AI-powered codebase analysis
β β βββ diagram.py # Graphviz diagram generation
β β βββ repository.py # GitHub/ZIP repository loading
β βββ integrations/
β β βββ elevenlabs.py # ElevenLabs TTS integration
β β βββ modal_client.py # Modal API client
β β βββ voice.py # Voice synthesis utilities
β βββ mcp/
β β βββ server.py # FastMCP server setup
β β βββ tools.py # MCP tool definitions
β βββ ui/
β βββ app.py # UI layout and routing
β βββ components.py # Reusable UI components
β βββ styles.py # CSS styling
βββ data/
β βββ diagrams/ # Generated diagram files
β βββ audios/ # Voice narration files
β βββ logs/ # Application logs
βββ assets/
βββ screenshots/ # Documentation screenshots
```
---
## π Quick Start
### Prerequisites
- Python 3.10+
- Graphviz (`brew install graphviz` on macOS, `apt install graphviz` on Linux)
### Option 1: Run Locally
```bash
# Clone and setup
git clone https://github.com/aghilsabu/codeAtlas.git
cd codeAtlas
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Run
python app.py
```
Open http://localhost:7860 and go to **Settings** to add your API keys.
### Option 2: Use Makefile
```bash
make install # Create venv and install dependencies
make run # Run the application
```
### Option 3: Deploy API Backend to Modal
```bash
# Deploy the serverless API backend on Modal
modal deploy modal_backend.py
```
**Modal Backend API Endpoints:**
| Endpoint | URL |
|----------|-----|
| Health Check | `https://aghilsabu--codeatlas-backend-health.modal.run` |
| Generate Diagram | `https://aghilsabu--codeatlas-backend-generate-diagram.modal.run` |
| Generate Voice | `https://aghilsabu--codeatlas-backend-generate-voice.modal.run` |
| Analyze Codebase | `https://aghilsabu--codeatlas-backend-analyze-codebase.modal.run` |
These serverless endpoints handle heavy compute operations and can be called from any frontend! π
---
## βοΈ Configuration
Configure API keys via the **Settings** page in the UI:
| Key | Required | Purpose | Get Key |
|-----|----------|---------|---------|
| **Gemini API Key** | β
Yes | Primary AI engine | [aistudio.google.com/apikey](https://aistudio.google.com/apikey) |
| **OpenAI API Key** | Optional | GPT-5.1/5 Mini models | [platform.openai.com/api-keys](https://platform.openai.com/api-keys) |
| **ElevenLabs API Key** | Optional | Voice narration | [elevenlabs.io/app/developers](https://elevenlabs.io/app/developers/api-keys) |
---
## π How It Works
```mermaid
flowchart LR
A[GitHub URL/ZIP] --> B[Repository Loader]
B --> C[Smart File Filter]
C --> D[LlamaIndex + Gemini]
D --> E[DOT Diagram]
E --> F[Graphviz Render]
F --> G[Interactive Viewer]
D --> H[Architecture Summary]
H --> I[ElevenLabs TTS]
I --> J[π Audio Player]
D --> K[π¬ AI Chat]
```
1. **π₯ Load Repository** β Download from GitHub or extract ZIP, smart-filter to relevant code files (excludes node_modules, tests, configs)
2. **π§ AI Analysis** β LlamaIndex processes code context with Gemini 3.0 (or GPT-5.1) to understand architecture
3. **πΊοΈ Generate Diagram** β AI creates Graphviz DOT code with 15-20 key nodes showing layers, clusters, and relationships
4. **π Voice Narration** β AI generates natural summary, ElevenLabs converts to high-quality speech
5. **π¬ Chat Interface** β Context-aware Q&A about the analyzed codebase with conversation history
---
## π― Use Cases
- **Onboarding** β New team members instantly understand codebase structure
- **Documentation** β Generate architecture diagrams for README/docs
- **Code Review** β Visualize changes in context of overall architecture
- **Learning** β Understand how popular open-source projects are structured
- **Legacy Code** β Make sense of undocumented older codebases
---
## π¨βπ» Author
**Aghil Sabu**
- GitHub: [@aghilsabu](https://github.com/aghilsabu)
- HuggingFace: [@aghilsabu](https://huggingface.co/aghilsabu)
- Twitter/X: [@AghilSabu](https://x.com/AghilSabu)
---
## π License
MIT License β see [LICENSE](LICENSE) for details.
---
**Built with β€οΈ for MCP's 1st Birthday Hackathon π**
*November 2025*
[](https://github.com/aghilsabu/codeAtlas)