Skip to main content
Glama
lex-tools

@lex-tools/codebase-context-dumper

Official
by lex-tools

コードベースコンテキストダンパー MCP サーバー

npmバージョン ライセンス: Apache-2.0

コードベースのコンテキストを大規模言語モデル (LLM) に簡単にダンプできるように設計されたモデル コンテキスト プロトコル (MCP) サーバー。

なぜこれを使うのですか?

LLMの大きなコンテキストウィンドウは強力ですが、大規模なコードベースからファイルを手動で選択してフォーマットするのは面倒です。このツールは、以下の方法でこのプロセスを自動化します。

  • プロジェクト ディレクトリを再帰的にスキャンします。

  • .gitignoreルールによって除外されていない、指定されたディレクトリ ツリーからのテキスト ファイルを含めます。

  • バイナリ ファイルを自動的にスキップします。

  • 明確なファイル パス マーカーを使用してコンテンツを連結します。

  • LLM のコンテキスト ウィンドウよりも大きいコードベースを処理するためのチャンク化をサポートします。

  • MCP 対応クライアントとシームレスに統合します。

Related MCP server: code-index-mcp

使用方法(推奨:npx)

このツールを使用する最も簡単な方法は、ローカルインストールを必要とせずに最新バージョンを実行するnpxを使用することです。

次のコマンドを使用するように MCP クライアント (例: Claude Desktop、VS Code 拡張機能) を構成します。

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

MCP クライアントは、このサーバーによって提供されるdump_codebase_contextツールを呼び出すことができるようになります。

機能とツールの詳細

ツール: dump_codebase_context

指定されたディレクトリからテキストファイルを再帰的に読み取ります.gitignoreルールを尊重し、バイナリファイルはスキップします。ファイルパスのヘッダー/フッターとコンテンツを連結します。大規模なコードベース向けに出力のチャンク化をサポートします。

機能性:

  • base_pathで指定されたディレクトリをスキャンします。

  • すべてのレベルの.gitignoreファイルを尊重します (デフォルトではネストされたファイルと.gitを含む)。

  • バイナリ ファイルを検出してスキップします。

  • 有効な各テキスト ファイルの内容を読み取ります。

  • 各ファイルの内容の先頭にヘッダー ( --- START: relative/path/to/file --- ) を追加し、末尾にフッター ( --- END: relative/path/to/file --- ) を追加します。

  • 処理されたすべてのファイルの内容を 1 つの文字列に連結します。

入力パラメータ:

  • base_path (文字列、必須): スキャンするプロジェクト ディレクトリへの絶対パス。

  • num_chunks (整数、オプション、デフォルト:1):出力を分割するチャンクの総数。1以上である必要があります。

  • chunk_index (整数、オプション、デフォルト:1):返されるチャンクの1から始まるインデックス。num_chunks num_chunks > 1かつchunk_index <= num_chunksある必要があります。

出力: 連結された(場合によってはチャンク化された)テキスト コンテンツを返します。

ローカルインストールと使用方法(上級)

ローカル バージョンを実行したい場合 (開発用など) は、次の手順に従ってください。

  1. リポジトリをクローンします。

    git clone git@github.com:lex-tools/codebase-context-dumper.git
    cd codebase-context-dumper
  2. 依存関係をインストールします:

    npm install
  3. サーバーを構築します。

    npm run build
  4. ローカル ビルド出力を指すように MCP クライアントを構成します。

    {
      "mcpServers": {
        "codebase-context-dumper": {
          "command": "/path/to/your/local/codebase-context-dumper/build/index.js" // Adjust path
        }
      }
    }

貢献

貢献を歓迎します!開発、デバッグ、新しいバージョンのリリースの詳細については、 CONTRIBUTING.md をご覧ください。

ライセンス

このプロジェクトはApache License 2.0に基づいてライセンスされています。詳細はLICENSEファイルをご覧ください。

Available Tools

1 tool
dump_codebase_contextA

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
base_pathYesThe absolute path to the project directory to scan.
num_chunksNoOptional total number of chunks to divide the output into (default: 1).
chunk_indexNoOptional 1-based index of the chunk to return (default: 1). Requires num_chunks > 1.

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key operational traits: recursive file reading, .gitignore respect, binary file skipping, output formatting with headers/footers, and chunking for large outputs. However, it doesn't mention potential limitations like file size constraints, permission requirements, or error handling, leaving some gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is highly concise and well-structured in two sentences: the first covers core functionality and constraints, the second addresses scalability. Every phrase adds value (e.g., 'respecting .gitignore rules', 'skipping binary files', 'chunking the output'), with no wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (recursive file operations, chunking) and lack of annotations/output schema, the description does a good job covering core behavior and constraints. It explains what the tool does, key features, and output handling, but omits details like return format, error scenarios, or performance implications, which would enhance completeness for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already fully documents all three parameters (base_path, num_chunks, chunk_index). The description adds no additional parameter-specific information beyond what's in the schema, such as examples or edge cases. The baseline score of 3 reflects adequate but minimal value addition from the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('recursively reads text files', 'concatenates content with file path headers/footers') and resource ('from a specified directory'), including key behavioral details like respecting .gitignore rules and skipping binary files. With no sibling tools, it fully defines the tool's unique purpose without redundancy.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for scanning codebases ('large codebases') and mentions chunking for scalability, but provides no explicit guidance on when to use this tool versus alternatives or any prerequisites. Since there are no sibling tools, the lack of comparative guidance is less critical, but still leaves usage context somewhat open-ended.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool update
    • First observeddump_codebase_context

TDQS

A3.9/5.0
Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool has a single, clearly defined purpose.

Naming Consistency5/5

A single tool inherently has perfect naming consistency, as there are no other tools to compare it against for patterns or conventions.

Tool Count2/5

One tool is too few for most practical server purposes, as it severely limits functionality and interaction. While the tool is well-described, a single tool feels thin and incomplete for a codebase context server.

Completeness2/5

The server's purpose appears to be codebase context management, but with only a dump tool, there are significant gaps. Missing operations like search, filter, update, or delete context make the surface incomplete and likely insufficient for agent workflows.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

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