MCP Codebase Analyzer
Analyzes remote GitHub repositories by downloading them into a local sandbox for structural analysis.
Click on "Install 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 AnalyzerAnalyze git changes and affected functions."
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 Analyzer
A Model Context Protocol (MCP) server that lets an LLM explore a codebase structurally - outlines, signatures, dependencies, complexity, and change impact, instead of ingesting raw files into context.
The Problem
Feeding entire files or repositories into an LLM's context window wastes tokens and increases hallucination risk. Most of that content is irrelevant to any given question. If someone asks "what does read_file do," the model doesn't need the whole file — it needs the function's signature, docstring, and maybe its body, nothing else.
Related MCP server: RepoMap
The Approach
Instead of dumping raw text, this server parses code into an Abstract Syntax Tree using Tree-sitter and exposes that structure through a set of MCP tools. An LLM client (e.g. Claude Desktop) can query exactly what it needs, a directory outline, one function's source, an import graph, a complexity score and drill deeper only when the task requires it. The result is a smaller, more precise context footprint and fewer tokens spent on irrelevant code.
Tech Stack
Python 3.13
FastMCP - MCP server framework
Tree-sitter (+ language grammars for Python and JavaScript) - structural parsing
Git (via subprocess) - diff and change-impact analysis
GitHub API - remote repository ingestion
MCP Inspector - protocol-level testing and debugging
Tools
Tool | Description |
| High-speed recursive directory traversal with noise pruning ( |
| Maps out function and class definitions, signatures, return types, docstrings, and line numbers for a file. |
| Extracts the exact source of a single named function or method. |
| AST-aware symbol lookup across the workspace (finds definitions, not just text matches). |
| Regex-based text search across allowed file types. |
| Maps how internal and external modules connect to one another. |
| Calculates cyclomatic complexity per function to highlight refactor targets. |
| Maps uncommitted git modifications to the specific functions they affect. |
| Cross-references defined functions against usage to flag likely-unused code. |
| Combines file size with git commit frequency to surface large, frequently-changed files — a common code-smell signal. |
| Downloads and mounts a remote GitHub repository into a local sandbox for the same structural analysis. |
Design Principles
On-demand over front-loaded. Every tool returns the minimum structure needed to answer the next question, not the whole file.
Sandboxed by default. All file access is path-bounded to a configured project root, preventing traversal outside the allowed workspace.
Composable. Higher-level tools (dead code detection, churn heatmaps) are built by combining outputs from lower-level tools (outline, search, git) rather than duplicating parsing logic.
Language-extensible. Tree-sitter's grammar model means adding a new language is a matter of adding a grammar + query, not rewriting the architecture.
Status
Phase 1 of a three-phase project. Phase 2 is a self-hosted home server (reverse proxy, monitoring, CI/CD). Phase 3 merges the two: applying this same "structured query over raw dump" philosophy to infrastructure — an LLM querying and managing a live server the same way it queries a codebase here.
Running Locally
git clone <this-repo>
cd mcp-codebase-analyzer
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txt
fastmcp run server.pyTest with MCP Inspector:
npx @modelcontextprotocol/inspector fastmcp run server.pyOr connect it to Claude Desktop as an MCP server for real LLM tool-use testing.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceProvides LLM-optimized tools for advanced code analysis, repository complexity evaluation, and call graph generation. It enables users to visualize directory structures, detect code patterns, and build semantic context with significant token savings.8MIT
- Alicense-qualityDmaintenanceProvides AI assistants with a structured, token-efficient map of a codebase's symbols, dependencies, and relationships via MCP tools like overview, query, and impact analysis.8MIT
- Flicense-qualityCmaintenanceProvides structural code intelligence via 26 MCP tools, enabling AI assistants to query code symbols, dependencies, and call graphs accurately without file-pasting.
- Alicense-qualityAmaintenanceGenerates a comprehensive context map of your codebase to reduce token usage for AI coding assistants. Provides 12 MCP tools for exploring project structure, dependencies, and generating wiki knowledge bases.21MIT
Related MCP Connectors
Repo intel for AI coding agents: overview, PRs, contributors, hot files, CI, deps. Remote MCP.
One shared context your team's AI tools read & write over MCP. No re-explaining. Free.
100+ MCP tools for AI agents: content metadata, trade intelligence, business-expertise analysis.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kilqwe/MCP-Code-Explorer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server