A Model Context Protocol server to dump your codebase into your LLM model
What is lex tools codebase context dumper
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.
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/claude-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. Requiresnum_chunks > 1
andchunk_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/claude-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/claude-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.
Leave a Comment
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
chrisdoc hevy mcp
sylphlab pdf reader mcp
An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.
aashari mcp server atlassian bitbucket
Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.
aashari mcp server atlassian confluence
Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.
prisma prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
Zzzccs123 mcp sentry
mcp sentry for typescript sdk
zhuzhoulin dify mcp server
zhongmingyuan mcp my mac
zhixiaoqiang desktop image manager mcp
MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)
zhixiaoqiang antd components mcp
An MCP service for Ant Design components query | 一个减少 Ant Design 组件代码生成幻觉的 MCP 服务,包含系统提示词、组件文档、API 文档、代码示例和更新日志查询
Submit Your MCP Server
Share your MCP server with the community
Submit Now