代码库上下文转储器 MCP 服务器
模型上下文协议 (MCP) 服务器旨在轻松地将您的代码库上下文转储到大型语言模型 (LLM) 中。
为什么要使用这个?
LLM 中的大型上下文窗口功能强大,但从大型代码库中手动选择和格式化文件非常繁琐。此工具通过以下方式自动化此过程:
- 递归扫描您的项目目录。
- 包括指定目录树中未被
.gitignore
规则排除的文本文件。 - 自动跳过二进制文件。
- 将内容与清晰的文件路径标记连接起来。
- 支持分块来处理大于 LLM 上下文窗口的代码库。
- 与 MCP 兼容客户端无缝集成。
用法(推荐:npx)
使用此工具的最简单方法是通过npx
,它可以运行最新版本而无需本地安装。
配置您的 MCP 客户端(例如,Claude Desktop、VS Code 扩展)以使用以下命令:
然后,MCP 客户端将能够调用该服务器提供的dump_codebase_context
工具。
功能和工具详细信息
工具: dump_codebase_context
以递归方式从指定目录读取文本文件,遵循.gitignore
规则并跳过二进制文件。将内容与文件路径的页眉/页脚连接起来。支持对大型代码库的输出进行分块。
功能:
- 扫描
base_path
中提供的目录。 - 尊重所有级别的
.gitignore
文件(包括嵌套文件和默认的.git
)。 - 检测并跳过二进制文件。
- 读取每个有效文本文件的内容。
- 在每个文件的内容前添加一个标题(
--- START: relative/path/to/file ---
)并添加一个页脚(--- END: relative/path/to/file ---
)。 - 将所有处理过的文件内容连接成一个字符串。
输入参数:
base_path
(字符串,必需):要扫描的项目目录的绝对路径。num_chunks
(整数,可选,默认值:1):将输出划分成的块的总数。必须 >= 1。chunk_index
(整数,可选,默认值:1):要返回的块的从 1 开始的索引。要求num_chunks > 1
且chunk_index <= num_chunks
。
输出:返回连接后的(可能分块的)文本内容。
本地安装和使用(高级)
如果您希望运行本地版本(例如,用于开发):
- 克隆存储库:
- 安装依赖项:
- 构建服务器:
- 配置您的 MCP 客户端以指向本地构建输出:
贡献
欢迎贡献!有关开发、调试和发布新版本的详细信息,请参阅CONTRIBUTING.md 。
执照
本项目遵循 Apache License 2.0 许可协议。详情请参阅LICENSE文件。
local-only server
The server can only run on the client's local machine because it depends on local resources.
模型上下文协议 (MCP) 服务器旨在轻松地将您的代码库上下文转储到大型语言模型 (LLM) 中。
Related MCP Servers
- -securityAlicense-qualityA 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 -110158TypeScriptMIT License
- -securityAlicense-qualityMCP 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 -24TypeScriptMIT License
Upstash MCP Serverofficial
AsecurityAlicenseAqualityModel 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 -163744TypeScriptMIT License- AsecurityFlicenseAqualityA 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 -42JavaScript
Appeared in Searches
- A tool for debugging Pine Script code
- How to convert Figma files to React code
- A platform for hosting and sharing code
- Using separate agents for schema validation, code standards, and directory structure enforcement in development workflows
- Finding the Top 10 Most Frequently Pulled Packages from Nexus Repository