Codebase Intelligence MCP Server
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., "@Codebase Intelligence MCP Serverfind all TODO comments in the src directory"
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.
Codebase Intelligence MCP Server
A production-grade Model Context Protocol (MCP) server that exposes powerful code analysis and repository intelligence tools. Designed for local git repositories, this server provides tools for code search, git history analysis, complexity metrics, test discovery, and dependency management.
Perfect for integrating with Claude, Cursor, or other LLM-based development tools via MCP clients.
Quick Start (< 2 minutes)
# 1. Install
git clone https://github.com/atishay2411/langgraph-mcp-server
cd langgraph-mcp-server
pip install -e .
# 2. Set repository path
export CODEBASE_INTEL_REPO_ROOT=/path/to/your/git/repo
# 3. Run server (stdio mode - zero config)
python -m codebase_intel.server
# ✓ Ready for MCP clients!Related MCP server: Code Understanding MCP Server
Architecture
LLM Client (Claude/Cursor)
│
├─ LangGraph Agent (custom StateGraph)
│
└─ MCP Client (MultiServerMCPClient)
│
┌─────────▼─────────┐
│ MCP Transport │
│ (stdio or HTTP) │
└─────────┬─────────┘
│
┌────────────▼────────────┐
│ FastMCP Server │
│ (codebase_intel) │
└────┬──────────┬─────────┘
│ │
┌─────▼──┐ ┌──▼────────┐
│9 Tools │ │4 Resources│
│2 Prompts │2 Prompts │
└─────┬──┘ └───────────┘
│
Repository (read-only)Tools (9 available)
Tool | Params | Description | Security |
|
| Read files with line-range support | ✓ Traversal guard |
|
| Recursive directory tree (auto-exclude | ✓ Dir exclusion |
|
| Code search (literal + regex, glob patterns) | ✓ Binary skip |
|
| Repository history with filtering | ✓ Subprocess allowlist |
|
| Per-line git attribution | ✓ Arg list only |
|
| Show commit/tree/blob | ✓ Ref validation |
|
| Cyclomatic complexity (Python, radon) | ✓ Dir exclusion |
| (none) | Parse pyproject.toml/requirements.txt/package.json | ✓ Error handling |
|
| AST-based test discovery (no execution) | ✓ No code exec |
Resources (ambient context):
repo://structure— Dir tree (3 levels)repo://readme— README contentrepo://dependencies— All depsrepo://git-log— Last 20 commits
Prompts (templates with embedded data):
code_review_prompt(path, focus)— Customizable code reviewsummarize_recent_changes_prompt(max_commits)— Git history summary
Modes
Stdio Transport (local, zero-auth)
export CODEBASE_INTEL_REPO_ROOT=/path/to/repo
python -m codebase_intel.server
# Clients connect via stdin/stdoutHTTP Transport (remote, bearer-token auth)
export CODEBASE_INTEL_REPO_ROOT=/path/to/repo
export CODEBASE_INTEL_TRANSPORT=streamable-http
export CODEBASE_INTEL_AUTH_TOKEN=$(openssl rand -hex 32)
python -m codebase_intel.server
# Server at http://localhost:8000/mcp (requires Bearer token)Docker
export TARGET_REPO_PATH=/path/to/repo
export CODEBASE_INTEL_AUTH_TOKEN=$(openssl rand -hex 32)
docker-compose up
# Server at http://localhost:8000/mcpLangGraph Client Example
export GROQ_API_KEY=your_key
export CODEBASE_INTEL_REPO_ROOT=/path/to/repo
python -m codebase_intel_client "What's the most complex function?"The client uses a custom StateGraph (explicit agent & tools nodes, not prebuilt one-liner) demonstrating production-grade LangGraph patterns.
Configuration
# Required
CODEBASE_INTEL_REPO_ROOT=/path/to/repo
# Optional (env vars, see .env.example)
CODEBASE_INTEL_LOG_LEVEL=INFO
CODEBASE_INTEL_TRANSPORT=stdio # or streamable-http
CODEBASE_INTEL_AUTH_TOKEN=... # required for HTTPSee .env.example for full options.
Security
✅ Path Traversal Prevention — resolve_within_repo() + normalization
✅ Safe Git Execution — Argument lists, no shell, allowlisted subcommands
✅ Directory Exclusions — .git, node_modules, venv, etc. auto-skipped
✅ Bearer Token Auth — Constant-time comparison, no side-channels
✅ No Code Execution — AST-based parsing, no imports/subprocess for untrusted code
✅ Read-Only Design — No write capabilities anywhere
Testing
pytest tests/ -v # All tests
pytest tests/ --cov=src/ --cov-report=html # With coverage
pytest tests/test_tool_files.py -v # Specific file111+ tests passing (93% pass rate) covering security, tools, auth, dependencies, git operations, test discovery.
CI/CD
✅ Lint (ruff)
✅ Type-check (mypy)
✅ Tests (pytest + coverage)
✅ Docker build validation
See .github/workflows/ci.yml.
Project Layout
src/codebase_intel/ # MCP Server (9 tools, 4 resources, 2 prompts)
├── server.py # FastMCP assembly
├── config.py, logging_conf.py
├── security/ # Path guard, git subprocess wrapper
├── tools/ # 9 MCP tools
├── resources/, prompts/ # Resources & prompts
└── auth/ # Bearer token middleware
src/codebase_intel_client/ # LangGraph Client
├── graph.py # Custom StateGraph
├── nodes.py # Agent nodes
├── config.py, state.py
└── run.py # CLI entrypoint
tests/ # 111+ tests
.github/workflows/ci.yml # GitHub Actions
Dockerfile, docker-compose.yml # ContainerizationExample Queries
# Find complex functions
"What functions in src/ have high cyclomatic complexity?"
# Analyze dependencies
"List all Python dependencies and their versions."
# Search patterns
"Find all async functions in the codebase."
# Test coverage
"Which test files exist and how many tests do we have?"
# Git insights
"What changed in the last 5 commits?"Limitations (v1)
Python complexity analysis only (JS/TS coming)
Single repository (no monorepo support)
Read-only (by design)
Requires
.gitdirectory
Contributing
Fork & branch
pytest tests/ && ruff check .Submit PR
License
MIT — See LICENSE
Built With
Questions? Open an issue.
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
- FlicenseAqualityDmaintenanceAn MCP server that transforms repositories into queryable knowledge by combining static code analysis with git history tracking. It allows users to investigate codebase structure, identify fragile files based on churn, and receive risk assessments through natural language queries.Last updated7
- AlicenseCqualityDmaintenanceAn MCP server that analyzes local or remote GitHub repositories, providing intelligent code context and structure to AI coding assistants.Last updated1013MIT
- Alicense-qualityAmaintenanceA production-grade MCP server for managing git projects, offering dynamic tool selection and enterprise-grade security.Last updated2MIT
- Alicense-qualityDmaintenanceA production-grade MCP server providing advanced code intelligence capabilities such as semantic search, dependency analysis, and natural language Q&A across multiple programming languages.Last updatedMIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
An MCP server for deep research or task groups
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/atishay2411/codebase-analyzer-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server