Labsco
MCP SERVER

Safe File MCP

by khromov

Check what a codebase costs in tokens before you feed it to a model, find the files driving that number, and pull the whole thing as paginated markdown.

Codebase Context Packing & CompressionVerified
Summary
Measuring before retrieving is the entire point, and it is the step every naive codebase tool skips.

The standard failure is asking for a repository, getting most of a context window back, and discovering afterwards that a lockfile and a vendored dependency accounted for most of it. Reporting the token count first, and then which files are responsible, turns that into a decision made in advance. Pagination on the retrieval is the matching piece — a merged codebase that exceeds the response limit is not partially useful, it fails. Three tools, no writes, and the discipline is the product rather than the packaging.

What it is

A three-tool codebase packaging server built around token cost: measure it first, find the largest contributors, then retrieve the merged content in pages.

What you get
  • get_codebase_size returns token counts before any processing, which is the number that decides whether the next call is affordable.
  • get_codebase_top_largest_files identifies which files are driving the size, so exclusions can be chosen rather than guessed.
  • get_codebase generates a merged markdown file of the whole codebase, paginated so a large repository does not arrive as one unusable response.
Requirements

Nothing to supply — it reads the codebase it is pointed at.

Setup effort

One command — npx -y context-coder --mini --stdio