Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AIFire in da houseCheck it out free

codebase-mcp

MCP.Pizza Chef: DeDeveloper23

Codebase MCP is a Model Context Protocol server that enables AI agents to retrieve, process, and analyze entire codebases from remote GitHub repositories using RepoMix. It supports multiple output formats, customizable processing options, and file saving, facilitating comprehensive project context for developers and AI assistants working with large codebases.

Use This MCP server To

Retrieve entire codebases as single text outputs in XML, Markdown, or Plain formats Process and analyze remote GitHub repositories directly Save processed codebases to files for offline use or sharing Customize codebase retrieval with options like comments, line numbers, and file summaries Enable AI agents to understand large projects comprehensively Integrate with AI copilots to provide full project context Automate codebase documentation generation from repository data

README

Codebase MCP

A Model Context Protocol (MCP) server implementation that provides tools to retrieve and analyze entire codebases using RepoMix.

This MCP allows AI Agents like Cursor's Composer Agent to automatically read and understand entire codebases at once, making it easier for developers to work with large codebases and for AI assistants to have comprehensive context of a project.

Features

  • ๐Ÿ“š Codebase Retrieval: Retrieve the entire codebase as a single text output in different formats (XML, Markdown, Plain)
  • ๐ŸŒ Remote Repository Support: Process remote GitHub repositories directly
  • ๐Ÿ’พ File Saving: Save the processed codebase to a file
  • ๐Ÿ”ง Customizable Options: Control how the codebase is processed with various options (comments, line numbers, file summaries, etc.)

Installation

From NPM (Recommended)

# Install the package globally
npm install -g codebase-mcp

# Install RepoMix (required dependency)
codebase-mcp install

From GitHub

# Clone the repository
git clone https://github.com/DeDeveloper23/codebase-mcp.git

# Navigate to the project directory
cd codebase-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Install globally
npm install -g .

# Install RepoMix (required dependency)
codebase-mcp install

Integration with Cursor

To use this MCP with Cursor's Composer Agent:

  1. Open Cursor IDE
  2. Click the Composer icon in the sidebar
  3. Click the "MCP Servers" button at the top
  4. Click "Add new MCP server"
  5. Fill in the details:
    • Name: Codebase MCP (or any name you prefer)
    • Type: command
    • Command: codebase-mcp start
  6. Click "Add" to save

Once added, the MCP will provide three powerful tools to the Composer Agent:

Available Tools

  1. getCodebase

    • Purpose: Analyzes your current workspace/project
    • Use when: You want the AI to understand your entire codebase
    • Example prompt: "Please analyze my codebase to understand its structure"
  2. getRemoteCodebase

    • Purpose: Fetches and analyzes any public GitHub repository
    • Use when: You want to explore or understand other projects
    • Example prompt: "Can you analyze the repository at github.com/username/repo?"
  3. saveCodebase

    • Purpose: Saves the codebase analysis to a file for later use
    • Use when: You want to preserve the codebase snapshot or share it
    • Example prompt: "Save an analysis of this codebase to review later"

Example Usage in Cursor

Here are some example prompts you can use with the Composer Agent:

"Analyze my current project and explain its main components."

"Can you look at the tensorflow/tensorflow repository and explain how their testing framework works?"

"Save an analysis of my project to 'codebase-analysis.md' in markdown format."

The Composer Agent will automatically use the appropriate tool based on your request.

Usage Outside Cursor

Starting the MCP Server

codebase-mcp start

This will start the MCP server in stdio mode, which can be used by any MCP-compatible clients.

License

MIT

codebase-mcp FAQ

How do I install the codebase-mcp server?
You can install it globally via npm using 'npm install -g codebase-mcp' and follow RepoMix installation instructions.
Can codebase-mcp process private GitHub repositories?
Yes, with proper authentication and access tokens, it can process private repositories securely.
What output formats does codebase-mcp support?
It supports XML, Markdown, and Plain text formats for codebase retrieval.
How can I customize the codebase processing?
You can control options like including comments, line numbers, and file summaries during retrieval.
Is it possible to save the retrieved codebase to a file?
Yes, codebase-mcp provides functionality to save the processed codebase to files for later use.
Which AI agents can integrate with codebase-mcp?
It integrates with AI agents like Cursor's Composer Agent and can be used with models from OpenAI, Anthropic, and Google Gemini.
Does codebase-mcp support remote repositories only?
While optimized for remote GitHub repositories, it can also work with local repositories if configured properly.
How does codebase-mcp help developers?
It simplifies understanding and navigating large codebases by providing comprehensive, formatted project context for AI and humans alike.