MCP Codebase Mentor
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Codebase Mentor search for authentication logic in my project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Codebase Mentor
An MCP (Model Context Protocol) server that acts as an AI mentor for any codebase using dual-layer indexing.
Features
Universal language support - AI handles all programming languages
Complete file coverage - Indexes code, tests, configs, and docs
Smart filtering - Respects
.gitignoreand applies sensible defaultsSemantic search - Vector-based code search using LlamaIndex
Tutorial generation - Creates structured learning guides with architecture diagrams
Related MCP server: Axon.MCP.Server
Installation
# Clone the repository
git clone <repository-url>
cd mcp-codebase
# Install dependencies
npm install
# Build the project
npm run buildUsage with Cursor/Claude
Add to your MCP configuration:
{
"mcpServers": {
"codebase-mentor": {
"command": "node",
"args": ["/path/to/mcp-codebase/dist/index.js"]
}
}
}Available Tools
init_codebase
Initialize and index a codebase for AI mentoring.
init_codebase(rootPath: "/path/to/your/project")This will:
Crawl the directory structure (respecting
.gitignore)Analyze each file with AI to extract summaries, imports, and exports
Build a manifest with file metadata and dependency graph
Create a vector index for semantic search
Output files:
.mcp_manifest.json- File metadata and dependency graph.mcp_index/- Vector index for semantic search
generate_tutorial
Generate a comprehensive "Zero to Hero" tutorial for a codebase.
generate_tutorial(rootPath: "/path/to/your/project", focusTopic?: "authentication")Creates:
Project overview and architecture
Mermaid.js dependency diagrams
Structured learning path (chapters)
Key insights and patterns
search_codebase
Perform semantic search across a codebase.
search_codebase(rootPath: "/path/to/your/project", query: "how is authentication handled?")Returns relevant code snippets with:
File paths and line numbers
Relevance scores
File context and summaries
Project Structure
mcp-codebase/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── tools/
│ │ ├── init.ts # init_codebase implementation
│ │ ├── tutorial.ts # generate_tutorial implementation
│ │ └── search.ts # search_codebase implementation
│ ├── core/
│ │ ├── crawler.ts # File system walker (.gitignore aware)
│ │ ├── analyzer.ts # LLM-based file analysis
│ │ ├── manifest.ts # Manifest CRUD operations
│ │ └── vectorIndex.ts # LlamaIndex integration
│ ├── utils/
│ │ ├── fileFilter.ts # Smart file filtering logic
│ │ ├── languageDetect.ts # Language/file type detection
│ │ ├── progress.ts # Progress reporter
│ │ └── git.ts # Git metadata extraction
│ ├── prompts/
│ │ ├── analyze.ts # Universal file analysis prompt
│ │ └── curriculum.ts # Tutorial generation prompt
│ └── types/
│ ├── manifest.ts # Manifest type definitions
│ └── mcp.ts # MCP tool interfaces
├── package.json
├── tsconfig.json
└── README.mdDevelopment
# Type checking
npm run typecheck
# Development mode with auto-reload
npm run dev
# Build for production
npm run buildPerformance Expectations
For a typical repository:
500 files: ~10-15 minutes (mostly AI analysis)
1000 files: ~20-30 minutes
5000 files: ~2 hours
Initialization is a one-time operation. Subsequent queries use the cached index.
Storage
For a 500-file repository (~50MB source):
Manifest: ~100-200 KB
Vector Index: ~5-10 MB
Total overhead: ~20% of source size
Limitations
LLM Dependency: Initialization requires an MCP host with sampling capability
No Incremental Updates: Re-run
init_codebasewhen files change significantlyBinary Files: Skipped (images, PDFs, executables)
Very Large Files: May hit LLM context limits (>100K tokens)
License
MIT
Available Tools
3 toolsgenerate_tutorialA
Generate a comprehensive tutorial/learning guide for a codebase. Creates a "Zero to Hero" tutorial with:
Project overview and architecture
Mermaid.js dependency diagrams
Structured learning path (chapters)
Key insights and patterns
Requires init_codebase to be run first.
Inputs: rootPath (required), focusTopic.
init_codebaseA
Initialize and index a codebase for AI mentoring. This tool:
Crawls the directory structure (respecting .gitignore)
Analyzes each file to extract summaries, imports, and exports
Builds a manifest with file metadata and dependency graph
Creates a vector index for semantic search
Run this before using generate_tutorial or search_codebase.
Inputs: rootPath (required).
search_codebaseA
Perform semantic search across a codebase. Uses vector embeddings to find relevant code sections based on natural language queries.
Returns:
Matching code snippets with file paths and line numbers
Relevance scores
File context and summaries
Requires init_codebase to be run first.
Inputs: query (required), rootPath (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a distinct responsibility: init_codebase prepares the index, search_codebase queries it, and generate_tutorial creates learning content from the indexed data. There is no overlap in purpose or behavior.
All tool names follow a consistent verb_noun pattern: init_codebase, generate_tutorial, search_codebase. The naming is uniform, predictable, and clearly indicates each tool's action.
With only 3 tools, the server is tightly scoped to its purpose of codebase mentoring. Each tool is essential to the workflow, and the small count is appropriate for a focused toolset.
The toolset covers the full lifecycle: initialization, semantic search, and tutorial generation. For the stated domain, there are no obvious missing operations that would leave an agent stuck.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
An MCP server that integrates with Discord to provide AI-powered features.
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA local MCP server that provides AI coding assistants with semantic search capabilities over codebases. It indexes code using local embeddings and exposes tools for efficient code retrieval, saving tokens and improving response quality.31 npm4MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that transforms codebases into intelligent, queryable knowledge bases, enabling AI assistants to perform semantic search, explore architecture, and analyze code relationships.166-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents structured code understanding and precise code intelligence via local indexing of AST, call graphs, and semantic search.73 npm4Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that indexes your codebase and gives AI assistants persistent understanding of project structure, dependencies, and history across sessions, with a self-improving multi-agent system for continuous code quality enhancement.6 npm3MIT