@lex-tools/codebase-context-dumper

@lex-tools/codebase-context-dumper

Official
lex-tools

Automatically extracts and formats your entire codebase into text that can be fed to LLMs, respecting .gitignore rules and skipping binary files.

A Model Context Protocol (MCP) server designed to easily dump your codebase context into Large Language Models (LLMs).

3188 views6Local (stdio)

What it does

  • Dump entire codebase context with file paths
  • Respect .gitignore rules automatically
  • Skip binary files during extraction
  • Chunk large codebases for LLM context limits
  • Recursively scan project directories

Best for

Developers wanting to analyze codebases with LLMsCode review and refactoring assistanceProviding full project context to AI assistants
Zero setup with npxAutomatic .gitignore compliance

About @lex-tools/codebase-context-dumper

@lex-tools/codebase-context-dumper is an official MCP server published by lex-tools that provides AI assistants with tools and capabilities via the Model Context Protocol. @lex-tools/codebase-context-dumper: an MCP server to dump your codebase context into LLMs for fast context injection, em It is categorized under developer tools. This server exposes 1 tool that AI clients can invoke during conversations and coding sessions.

How to install

You can install @lex-tools/codebase-context-dumper in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

@lex-tools/codebase-context-dumper is released under the Apache-2.0 license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Tools (1)

dump_codebase_context

Recursively reads text files from a specified directory, respecting .gitignore rules and skipping binary files. Concatenates content with file path headers/footers. Supports chunking the output for large codebases.

MseeP.ai Security Assessment Badge

codebase-context-dumper MCP Server

smithery badge npm version License: Apache-2.0

A Model Context Protocol (MCP) server designed to easily dump your codebase context into Large Language Models (LLMs).

@lex-tools/codebase-context-dumper MCP server

Why Use This?

Large context windows in LLMs are powerful, but manually selecting and formatting files from a large codebase is tedious. This tool automates the process by:

  • Recursively scanning your project directory.
  • Including text files from the specified directory tree that are not excluded by .gitignore rules.
  • Automatically skipping binary files.
  • Concatenating the content with clear file path markers.
  • Supporting chunking to handle codebases larger than the LLM's context window.
  • Integrating seamlessly with MCP-compatible clients.

Usage (Recommended: npx)

The easiest way to use this tool is via npx, which runs the latest version without needing a local installation.

Configure your MCP client (e.g., Claude Desktop, VS Code extensions) to use the following command:

{
  "mcpServers": {
    "codebase-context-dumper": {
      "command": "npx",
      "args": [
        "-y",
        "@lex-tools/codebase-context-dumper"
      ]
    }
  }
}

The MCP client will then be able to invoke the dump_codebase_context tool provided by this server.

Features & Tool Details

Tool: dump_codebase_context

Recursively reads text files from a specified directory, respecting .gitignore rules and skipping binary files. Concatenates content with file path headers/footers. Supports chunking the output for large codebases.

Functionality:

  • Scans the directory provided in base_path.
  • Respects .gitignore files at all levels (including nested ones and .git by default).
  • Detects and skips binary files.
  • Reads the content of each valid text file.
  • Prepends a header (--- START: relative/path/to/file ---) and appends a footer (--- END: relative/path/to/file ---) to each file's content.
  • Concatenates all processed file contents into a single string.

Input Parameters:

  • base_path (string, required): The absolute path to the project directory to scan.
  • num_chunks (integer, optional, default: 1): The total number of chunks to divide the output into. Must be >= 1.
  • chunk_index (integer, optional, default: 1): The 1-based index of the chunk to return. Requires num_chunks > 1 and chunk_index <= num_chunks.

Output: Returns the concatenated (and potentially chunked) text content.

Local Installation & Usage (Advanced)

If you prefer to run a local version (e.g., for development):

  1. Clone the repository:
    git clone [email protected]:lex-tools/codebase-context-dumper.git
    cd codebase-context-dumper
    
  2. Install dependencies:
    npm install
    
  3. Build the server:
    npm run build
    
  4. Configure your MCP client to point to the local build output:
    {
      "mcpServers": {
        "codebase-context-dumper": {
          "command": "/path/to/your/local/codebase-context-dumper/build/index.js" // Adjust path
        }
      }
    }
    

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details on development, debugging, and releasing new versions.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Alternatives

Related Skills

Browse all skills
ui-design-system

UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.

18
ai-sdk

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".

6
api-documenter

Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals. Use PROACTIVELY for API documentation or developer portal creation.

4
openai-knowledge

Use when working with the OpenAI API (Responses API) or OpenAI platform features (tools, streaming, Realtime API, auth, models, rate limits, MCP) and you need authoritative, up-to-date documentation (schemas, examples, limits, edge cases). Prefer the OpenAI Developer Documentation MCP server tools when available; otherwise guide the user to enable `openaiDeveloperDocs`.

4
cli-builder

Guide for building TypeScript CLIs with Bun. Use when creating command-line tools, adding subcommands to existing CLIs, or building developer tooling. Covers argument parsing, subcommand patterns, output formatting, and distribution.

3
ydc-ai-sdk-integration

Integrate Vercel AI SDK applications with You.com tools (web search, AI agent, content extraction). Use when developer mentions AI SDK, Vercel AI SDK, generateText, streamText, or You.com integration with AI SDK.

2