codebase-mcp
Reads the local Git repository of the scanned project to expose the current branch, the last commits and uncommitted changes through the get_git_history tool and the "Recent changes" section of the generated context.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
codebase-mcp
Auto-generate AI-ready context from your codebase — works with any LLM, agent, or MCP tool.
npx codebase-mcpStop re-explaining your stack every AI session. One command reads your entire codebase and outputs a structured CONTEXT.md — paste it into Claude, Cursor, ChatGPT, or any MCP-compatible agent instantly.
The problem
Every AI session starts with the same ritual:
"I'm using Next.js 14, TypeScript strict mode, Tailwind, Zustand, React Query, components are PascalCase, tests are co-located..."
Every. Single. Session.
codebase-mcp reads your actual codebase and writes that context file for you — automatically, accurately, and in a format every AI tool understands.
Related MCP server: AI Knowledge Center MCP
Install
# Zero install — run directly
npx codebase-mcp
# Global install
npm install -g codebase-mcp
# Short alias
cbmcpUsage
codebase-mcp # generate CONTEXT.md in current dir
codebase-mcp --copy # generate + copy to clipboard
codebase-mcp --print # print to stdout
codebase-mcp watch # auto-regenerate on file changes
codebase-mcp stats # show project summary, no file written
codebase-mcp --path /x # scan a different directory
codebase-mcp --template ./my-template.md # use a custom template
codebase-mcp --monorepo # scan all workspace packages
codebase-mcp sync # push CONTEXT.md to Claude Projects
codebase-mcp serve # start MCP server (stdio)Example output
## Project context
Generated: March 14, 2025 by codebase-mcp
**my-saas-app** v2.4.1 — Customer analytics dashboard
## Stack
- Framework: **Next.js 14.1.0**
- Language: **TypeScript**
- Package manager: **pnpm**
- Styling: **Tailwind CSS**
- State: **Zustand, TanStack Query**
- Testing: **Vitest, Playwright**
## Structure
├── app/ # Next.js App Router
├── components/ # 34 files
├── hooks/ # 12 files
└── stores/ # 4 files
## Components & modules
**Pages** (12): analytics, billing, dashboard...
**Components** (34): Button, Chart, DataTable, Modal...
**Hooks** (12): useAuth, useAnalytics...
## Conventions
- Components: **PascalCase**
- Tests: **co-located** alongside source files
- Path aliases: `@/components`, `@/lib`, `@/hooks`
## Recent changes
Branch: **main**
- Add Google OAuth provider
- Migrate DataTable to server components
- Fix race condition in useAuth hookWhat gets scanned
Source | What's extracted |
| Framework, styling, state, testing, build tool |
| TypeScript config, path aliases |
Folder structure | Directory tree (3 levels deep) |
| Component inventory, type classification |
Git log | Branch, last 15 commits, uncommitted changes |
Config files | ESLint, Prettier, Docker, CI platform |
Naming patterns | PascalCase vs kebab-case, co-located tests |
Detects 40+ frameworks and libraries: Next.js · Nuxt · Remix · Astro · SvelteKit · Vue · Angular · Express · Fastify · NestJS · Expo · Tailwind · MUI · Zustand · Jotai · Redux · TanStack Query · Vitest · Jest · Playwright · Cypress and more.
Works with
Tool | How |
Claude | Paste |
Cursor / Windsurf | Add to |
ChatGPT / Gemini | Paste at start of conversation |
Any MCP agent | `cbmcp --print |
Aider / Continue | Include as context file |
MCP server mode
codebase-mcp serve exposes your codebase as a full Model Context Protocol server — any MCP-compatible agent (Claude Desktop, Cursor, Windsurf, Continue) can query it at runtime.
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"codebase": {
"command": "codebase-mcp",
"args": ["serve", "--path", "/path/to/project"]
}
}
}Available tools
Tool | Description |
| Full CONTEXT.md — primary source of truth |
| Framework, language, deps, build setup |
| Folder tree (3 levels deep) |
| Search component inventory by name or type |
| Branch, recent commits, uncommitted state |
| Naming rules, aliases, test co-location |
GitHub Action — keep context always fresh
name: Update codebase context
on:
push:
branches: [main]
jobs:
context:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx codebase-mcp
- run: git diff --quiet CONTEXT.md || (git add CONTEXT.md && git commit -m "chore: update codebase context" && git push)Roadmap
v1.0 — Core scanner, 40+ frameworks, git history, conventions
v1.5 — Watch mode, custom templates, monorepo support
v2.0 — VS Code extension, Claude Projects auto-sync
v2.5 — Full MCP server mode
License
MIT © Dipanshu Singh
If codebase-mcp saves you time, a ⭐ helps others find it.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Serves your design system and coding standards to coding agents, so they stop guessing.
Project memory, documentation and controlled secret access for AI coding agents.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceExposes a developer's local context (communication preferences, stack, repos, memory models) to AI agents via MCP tools and resources, enabling them to bootstrap with local guidelines and reduce context hallucination.MIT
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server that provides project context, verification gates, and structured tools for coding agents to discover knowledge, run diagnostics, and execute allowlisted commands within a repository.MIT
- AlicenseNot gradedqualityDmaintenanceExposes a repo's historical engineering memory (decisions, landmines, guardrails) via MCP tools for AI coding agents.MIT
- AlicenseNot gradedqualityAmaintenanceServes focused context to AI coding agents from a locally indexed structural code graph of entities, Git relationships and recorded project memory, so relevant code and past mistakes can be retrieved before reading whole files. Queries can also traverse relationships such as callers, callees, paths and impact through the CLI, hooks, MCP and a local authenticated dashboard.24 npmMIT