Skip to main content
Glama

@lex-tools/codebase-context-dumper

Official
by lex-tools

codebase-context-dumper MCP Server

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

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.

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 git@github.com: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.

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

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

  1. Why Use This?
    1. Usage (Recommended: npx)
      1. Features & Tool Details
        1. Tool: dump_codebase_context
      2. Local Installation & Usage (Advanced)
        1. Contributing
          1. License

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.
              Last updated -
              114
              158
              TypeScript
              MIT License
              • Apple
            • -
              security
              A
              license
              -
              quality
              MCP Server simplifies the implementation of the Model Context Protocol by providing a user-friendly API to create custom tools and manage server workflows efficiently.
              Last updated -
              2
              4
              TypeScript
              MIT License
            • A
              security
              A
              license
              A
              quality
              Model Context Protocol (MCP) is a new, standardized protocol for managing context between large language models (LLMs) and external systems. In this repository, we provide an installer as well as an MCP Server for Upstash Developer API's.
              Last updated -
              16
              37
              44
              TypeScript
              MIT License
              • Linux
              • Apple
            • A
              security
              F
              license
              A
              quality
              A Model Context Protocol (MCP) server that optimizes token usage by caching data during language model interactions, compatible with any language model and MCP client.
              Last updated -
              4
              2
              JavaScript

            View all related MCP servers

            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/lex-tools/codebase-context-dumper'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server