Codebase Context Dumper
Easily provide codebase context to Large Language Models (LLMs).
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
.gitignorerules. - 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
.gitignorefiles at all levels (including nested ones and.gitby 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. Requiresnum_chunks > 1andchunk_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):
- Clone the repository:
git clone [email protected]:lex-tools/codebase-context-dumper.git cd codebase-context-dumper - Install dependencies:
npm install - Build the server:
npm run build - 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.
相关服务器
Scout Monitoring MCP
赞助Put performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
赞助Access financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Docfork
Provides up-to-date documentation for over 9000 libraries directly within AI code editors.
YepCode
Execute any LLM-generated code in the YepCode secure and scalable sandbox environment and create your own MCP tools using JavaScript or Python, with full support for NPM and PyPI packages
Gemma MCP Client
A client for Google's Gemma-3 model that enables function calling through MCP.
MCP Server Example
An example MCP server for educational purposes, demonstrating how to build a functional server that integrates with LLM clients.
Test Automator
An LLM-powered server for automating unit, integration, E2E, and API tests.
MCP WordPress Server
A comprehensive MCP server for managing WordPress sites, featuring a wide range of tools for performance monitoring, caching, and more.
MasterMCP
A demonstration tool showcasing potential security attack vectors against the Model Control Protocol (MCP).
Unified MCP Client Library
An open-source library to connect any LLM to any MCP server, enabling the creation of custom agents with tool access.
Claude Swarm MCP Server
An MCP server for multi-agent orchestration using Claude AI via Claude Desktop.
MCP Code Sandbox Server
Execute code securely in isolated sandbox environments using the E2B API.
