Codebase MCP server
Commit 29 Okt 2026Mengubah Claude Desktop menjadi asisten coding dengan semantic code search, persistent memory, dan pipeline editing berbantuan AI.
Juga dikenal sebagai danyQe/codebase-mcp
- Stars
- 50
- Tools
- 16
- Unduhan, 30 hari
- β
- Versi terbaru
- β
- Commit terakhir
- 29 Okt 2026
- Lisensi
- Apache-2.0
Apa itu Codebase MCP?
Codebase adalah MCP server. Mengubah Claude Desktop menjadi asisten coding dengan semantic code search, persistent memory, dan pipeline editing berbantuan AI. Server ini menyediakan 16 tool, seperti session_tool, memory_tool, git_tool.
Ringkasan dibuat dari README proyek
Tentang Codebase MCP server
Mengubah Claude Desktop menjadi asisten coding khusus adalah apa yang ditawarkan oleh codebase-mcp bagi developer yang ingin menggunakan langganan Claude Pro atau Team mereka tanpa harus membayar tool bulanan tambahan. Dengan terhubung melalui Model Context Protocol, ini menyediakan alternatif open-source untuk layanan berbayar seperti Cursor. Sistem ini menggunakan local embeddings dan indexing FAISS untuk melakukan semantic search dalam waktu kurang dari satu detik pada file Python, JavaScript, dan TypeScript.
User dapat menyiapkan server secara lokal menggunakan Python 3.11 dan package manager uv, serta mengonfigurasi backend FastAPI untuk mengelola engine utamanya. Meskipun sebagian besar pemrosesan tetap dilakukan secara lokal untuk menjaga privasi, tool edit_file memerlukan API key Gemini untuk memfasilitasi modifikasi kode berbantuan AI. Server ini menyediakan 16 tool berbeda, termasuk sistem persistent memory yang mengategorikan pembelajaran arsitektur dan kesalahan, workflow Git berbasis sesi untuk pengembangan fitur yang terisolasi, serta automated quality gates yang menggunakan Black dan Ruff untuk memastikan kode memenuhi standar tertentu sebelum melakukan commit.
Apa yang bisa Anda lakukan dengannya
- 1Implementasi fitur baru dengan konteksMinta AI untuk membuat endpoint API baru sementara ia secara otomatis mencari pola yang sudah ada dan mengelola branch pengembangan khusus.
- 2Melakukan refactoring kode secara cerdasMinta perubahan struktural pada service Anda menggunakan editing berbantuan AI yang memvalidasi perubahan terhadap quality gates.
- 3Menjaga pengetahuan proyek jangka panjangGunakan sistem persistent memory untuk memastikan asisten mengingat keputusan arsitektur sebelumnya dan menghindari pengulangan kesalahan yang sama.
- 4Navigasi codebase yang kompleksLakukan pencarian berbasis semantik atau level symbol untuk menemukan fungsi atau class spesifik di dalam proyek Anda.
Ditulis berdasarkan README proyek. Setiap use case diperiksa terhadap kutipan dari README tersebut.
Tool Codebase MCP 16
Terdeteksi dari READMEsession_toolmemory_toolgit_toolwrite_tooledit_filesearch_toolread_code_toolproject_context_toollist_directory_toolcode_analysis_toollist_file_symbols_toolread_symbol_from_database
| session_tool | β | |
| memory_tool | β | |
| git_tool | β | |
| write_tool | β | |
| edit_file | β | |
| search_tool | β | |
| read_code_tool | β | |
| project_context_tool | β | |
| list_directory_tool | β | |
| code_analysis_tool | β | |
| list_file_symbols_tool | β | |
| read_symbol_from_database | β |
Tampilkan semua 16 toolTampilkan lebih sedikit tool
project_structure_toolfile_toolexecute_toolshow_directory_tree
| project_structure_tool | β | |
| file_tool | β | |
| execute_tool | β | |
| show_directory_tree | β |
Konfigurasi
GEMINI_API_KEY
| Nama | Deskripsi | Tipe |
|---|---|---|
| GEMINI_API_KEY | β |
Pengecekan otomatis
Berjalan 13 Nov 2026Laporan lengkap βBelum diverifikasi. Sebuah server memerlukan skor 80, tidak ada temuan serius, dan data yang cukup untuk kami periksa. Cara kerja checks
- Source repository terhubung dan dapat dijangkauLolos
- Lisensi open source (OSI)Lolos
- Ada commit atau release dalam satu tahun terakhirLolos
- Nama package tidak mirip dengan package populerTidak diperiksa
- Remote endpoint menggunakan HTTPSTidak diperiksa
- Tools yang bersifat destruktif telah diberi labelTidak diperiksa
- Tidak ada instruksi tersembunyi untuk modelLolos
- Tidak ada advisory kritis di paket maupun dependensinyaTidak diperiksa
README
Lihat di GitHubCodebase MCP
Privacy-first AI development assistant via MCP | Turn Claude into your personal coding assistant | Semantic code search β’ AI-assisted editing β’ Quality-checked generation β’ Persistent memory | Free open-source alternative to Cursor & paid AI coding tools | Python, React, TypeScript, FastAPI
Open Source**
Codebase MCP is an open-source AI-powered development assistant that connects Claude Desktop (or any MCP-compatible LLM) to your codebase through the Model Context Protocol. Stop paying for separate coding assistants - if you already have a Claude subscription, that's all you need.
π Read Full Documentation | ποΈ Architecture | π€ Contributing
π Why Codebase MCP?
The Problem
Modern AI coding assistants like Cursor, Windsurf, and others charge $20-40+/month on top of your existing LLM subscription. If you already pay for Claude, why pay again for a coding assistant?
The Solution
Codebase MCP turns your existing Claude subscription into a powerful coding assistant:
- β One subscription - Use your existing Claude Pro/Team plan
- β Privacy-first - Local embeddings and processing (except edit operations)
- β Open source - Apache 2.0 license, community-driven
- β Extensible - Works with any MCP-compatible LLM via Model Context Protocol
- β Lightweight - ~100MB memory footprint for medium projects
- β Fast - Sub-second semantic search with local FAISS indexing
β‘ Quick Start
Prerequisites
- Python 3.11+
- Claude Desktop (or any MCP-compatible client)
- Git installed
- uv package manager (recommended)
Installation
1. Clone the repository:
git clone https://github.com/danyQe/codebase-mcp.git
cd codebase-mcp
2. Install globally (recommended):
# Install uv if you haven't
pip install uv
# Create virtual environment and install dependencies
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt
# Install formatters globally (required for code formatting)
pip install black ruff
3. Configure Gemini API (for edit tool):
# Create .env file
cp .env.example .env
# Get free API key from: https://aistudio.google.com/app/apikey
# Add to .env:
GEMINI_API_KEY=your_api_key_here
4. Configure Claude Desktop:
Add to your claude_desktop_config.json:
{
"mcpServers": {
"codebase-manager": {
"command": "/path/to/your/.venv/bin/python",
"args": [
"/path/to/codebase-mcp/mcp_server.py"
]
}
}
}
5. Start the FastAPI server:
# In a separate terminal, navigate to your project directory
python main.py /path/to/your/project
# Server starts on http://localhost:6789
# You can access the web dashboard at: http://localhost:6789
6. Use with Claude Desktop:
- Restart Claude Desktop
- Start chatting - Claude now has access to 16 MCP tools for codebase management!
π― Key Features
π Semantic Code Search
- AI-powered code understanding with local embeddings
- Multi-language support (Python, JavaScript, TypeScript)
- Symbol-level indexing (functions, classes, interfaces)
- Fuzzy search and exact matching modes
π§ Persistent Memory System
- Remember context across chat sessions
- Categorize learnings: progress, mistakes, solutions, architecture
- Semantic memory search with importance scoring
- Never repeat the same mistake twice
πΏ Session-Based Git Workflow
- Isolated development branches for each feature
- Automatic commit tracking in
.codebasedirectory - Separate from user's
.git- track AI changes independently - Auto-merge support with quality gates
βοΈ Intelligent Code Writing
- Write Tool: Create new files with auto-formatting and quality scoring
- Edit Tool: AI-assisted editing with Gemini integration (inspired by Cursor)
- Quality Gates: Auto-commit only when code quality β₯ 80%
- Dependency Checking: Prevent code duplication and missing imports
π¨ Auto-Formatting
- Python: Black + Ruff (PEP 8 compliant)
- TypeScript/JavaScript: Prettier (run through npx), plus a few simple lint-style warnings (no ESLint)
- Quality Scoring: Automatic code quality assessment
- Error Recovery: Intelligent retry with corrections
π Project Intelligence
- Real-time codebase analysis
- File structure visualization
- Dependency tracking
- Symbol extraction and indexing
ποΈ Architecture
βββββββββββββββββββ
β Claude Desktop β User interacts via chat
ββββββββββ¬βββββββββ
β MCP Protocol (stdio)
β
βββββββββββββββββββ
β MCP Server β 16 Tools (proxy layer)
β (mcp_server.py)β Lightweight, fast
ββββββββββ¬βββββββββ
β HTTP/REST
β
βββββββββββββββββββ
β FastAPI Server β Port 6789 (main.py)
β Core Engine β 40+ API endpoints
ββββββββββ¬βββββββββ
β
ββββββ΄ββββββ¬ββββββββββ¬βββββββββββ
β β β β
ββββββββββ ββββββββ ββββββββββ βββββββββββββ
βSemanticβ βMemoryβ β Git β βCode Tools β
β Search β βSystemβ βManager β β Pipeline β
ββββββββββ ββββββββ ββββββββββ βββββββββββββ
β β β β
ββββββββββββ΄ββββββββββ΄βββββββββββ
β
ββββββββββββββββββββββββ
β Local Storage β
β β’ FAISS (vectors) β
β β’ SQLite (metadata) β
β β’ .codebase (git) β
ββββββββββββββββββββββββ
Privacy Note: All processing is local except the edit tool, which uses Google's free Gemini API for AI-assisted code editing. Only the edited file is sent to Gemini - no project context or history.

π οΈ Available Tools
Codebase MCP provides 16 MCP tools for comprehensive development automation:
| Tool | Purpose | Key Features |
|---|---|---|
session_tool |
Manage dev sessions | Create branches, auto-commit, merge |
memory_tool |
Store/retrieve knowledge | Persistent context, semantic search |
git_tool |
Git operations | Status, diff, log, commit, branches |
write_tool |
Intelligent file creation | Auto-format, quality scoring, dependency check |
edit_file |
AI-assisted editing | Gemini-powered, error recovery, format validation |
search_tool |
Semantic code search | 4 modes: semantic, fuzzy, text, symbol |
read_code_tool |
Smart code reading | Symbol-level, line ranges, whole file |
project_context_tool |
Project analysis | Structure, dependencies, overview |
list_directory_tool |
Directory exploration | Tree view, metadata, gitignore support |
code_analysis_tool |
Code quality checks | Syntax, linting, imports, dependencies |
list_file_symbols_tool |
Symbol extraction | Functions, classes, interfaces |
read_symbol_from_database |
DB symbol lookup | Fast indexed retrieval |
project_structure_tool |
Project visualization | Enhanced tree with stats |
file_tool |
Basic file operations (legacy) | Read and write by line range; write_tool is preferred for new code |
execute_tool |
Run a command | Arguments, timeout and working directory |
show_directory_tree |
Compact directory tree | Depth 1 to 5, tuned for LLM context |
π Performance
- Semantic Search: Sub-second response for typical codebases
- Memory Footprint: ~100MB for medium projects (<20k lines)
- Indexing Speed: ~30 seconds for 10k lines initial index
- Edit Operations: 5-15 seconds (Gemini API + formatting)
- Optimal Project Size: <20,000 lines (tested and verified)
Note: Edit tool can be slow due to Gemini API latency and code formatting. Claude Desktop may timeout on very large edits (use smaller, focused edits).
π Usage Examples
Creating a New Feature
User: "Create a FastAPI endpoint for user authentication with JWT tokens"
Claude:
β
Searching for existing auth patterns...
β
Creating session: feat/user-auth
β
Writing authentication.py with JWT implementation
β
Auto-formatted with Black + Ruff
β
Quality score: 95% - Auto-committed
β
Storing solution in memory
Refactoring Code
User: "Refactor the user service to use dependency injection"
Claude:
β
Reading current user service implementation
β
Searching for DI patterns in codebase
β
Editing with AI assistance (Gemini)
β
Validating changes with quality gates
β
Session: refactor/user-di ready for review
Memory-Driven Development
User: "Continue working on the payment integration"
Claude:
β
Loading memory context...
β
Found previous progress: Stripe API setup complete
β
Found previous mistake: Don't use synchronous requests in async endpoints
β
Continuing from last checkpoint...
π Privacy & Security
Privacy-First Design
- Local Embeddings: AllMiniLM-L6-v2 runs entirely on your machine
- Local Processing: FAISS vector store, SQLite metadata - all local
- No Cloud Dependencies: Except for Gemini API (edit tool only)
Gemini API Usage
- Scope: Only
edit_filetool uses Gemini - Data Sent: Only the file being edited (no project context)
- Alternative: Contributors can add local LLM support (GPU required)
- Cost: Free tier (15 RPM, 250K TPM, 1K RPD)
Security Best Practices
- Never commit
.envwith API keys - Use
.gitignorefor sensitive files - Review AI-generated code before production deployment
- Keep dependencies updated
π€ Contributing
We welcome contributions! This project was built to be community-driven and extensible.
Priority Areas:
- π Language Support: Add Java, Go, Rust, PHP, etc.
- π§ Local LLM Integration: Replace Gemini with local models
- π Search Improvements: Enhanced semantic algorithms
- π UI/UX: Improve web dashboard
- β‘ Performance: Optimization for larger codebases
See CONTRIBUTING.md for detailed guidelines.
π License
This project is licensed under the Apache License 2.0 - see LICENSE file for details.
Credits:
- Edit tool techniques inspired by Cursor
- Built with Claude Sonnet 4 and 4.5
- Powered by Model Context Protocol
πΊοΈ Roadmap
Current Version: v1.0.0-beta
Upcoming Features:
- Community-driven enhancements
- More language support
- Local LLM alternatives
- Performance optimizations
- Advanced prompt engineering templates
π Support
- π Documentation: https://danyqe.github.io/codebase-mcp/
- π Issues: https://github.com/danyQe/codebase-mcp/issues
- π¬ Discussions: https://github.com/danyQe/codebase-mcp/discussions
- π Star this repo if you find it useful!
π Acknowledgments
Special thanks to:
- Anthropic for Claude and the Model Context Protocol
- Google for the free Gemini API
- Cursor team for pioneering AI-assisted editing techniques
- Open source community for making this possible
Made with β€οΈ by developers, for developers
Stop paying for coding assistants. Start building with your own LLM.
Pertanyaan tentang Codebase MCP
Tool apa yang disediakan Codebase MCP?
Server ini menyediakan 16 tool, termasuk session_tool, memory_tool, git_tool, write_tool, edit_file.
Apakah ini memerlukan langganan terpisah?
Tidak, ini menggunakan paket Claude Pro atau Team Anda yang sudah ada, berfungsi sebagai alternatif open-source untuk tool berbayar seperti Cursor.
Apakah kode saya bersifat pribadi?
Ya, ini menggunakan desain yang mengutamakan privasi dengan local embeddings dan pemrosesan lokal; hanya file spesifik yang sedang diedit yang dikirim ke Gemini API.
Bahasa pemrograman apa saja yang didukung?
Saat ini mendukung Python, JavaScript, dan TypeScript.