skim-mcp

v0.1.1
io.github.helloderekg/skim-mcp Checked 2 days ago Published 5 months ago

Lossless skim-then-expand reading of big files, repos, and command output with far fewer tokens

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

skim_open

Open a large file and return a compact skeleton + expandable anchor ids (not the full text). Returns handle, report (token counts + compression ratio), skeleton (read this), and anchors (ids you can expand). Use instead of reading a whole large file when you only need parts. Collapsed bodies are NOT in the skeleton - expand the anchor when the answer needs the body. Pass `query` to also get `matches` (which lines/anchors contain it) in the same call, saving a skim_search round-trip when you already know what you're looking for.

ParameterTypeDescription
path *string
querystring

skim_expand

Return exact, verbatim source lines for one or more anchor ids from a skim_open result. Items can be anchor ids ("a7") or literal line ranges ("L120-180", 1-based inclusive) - ranges work even for lines shown in the skeleton, e.g. when a grep gave you line numbers.

ParameterTypeDescription
anchors *array
handle *string

skim_run

Run a shell command and return a COMPACT, expandable view of its output instead of the full dump. For verbose commands (test runs, builds, npm/pip, big logs): the skeleton shows the shape with critical lines (errors, codes, numbers) preserved and repeated blocks deduped; skim_expand(handle, ...) pulls exact output spans. Nothing is lost. Returns exit_code + a token report. Runs on your machine.

ParameterTypeDescription
command *string
timeoutinteger

skim_repo

Build a LOSSLESS, ranked, token-budgeted map of a whole repo/directory. Returns each code file's skeleton (signatures + structure, bodies folded), ranked by relevance to `query` (or by size if no query), trimmed to `budget_tokens`. Every file gets a handle, so skim_expand(handle, anchors=[...]) returns exact code from any file. Files that didn't fit are listed by name so you can skim_open them individually. Use to understand a codebase cheaply, then expand.

ParameterTypeDescription
path *string
budget_tokensinteger
max_filesinteger
querystring

skim_patch

Replace exactly one anchored span (or literal "L<start>-<end>" range) of a skimmed file on disk. This is what verbatim-in-context buys: the span you expanded IS what the file contains, so an edit built from it applies safely. Expand the span first, edit that exact text, then patch. The write is refused if the file on disk no longer matches this handle's snapshot (drift -> clean error; re-open and rebuild the patch). Newline style (LF/CRLF) is preserved, the result is re-skimmed and verified, and a fresh handle for the new content is returned. Set SKIM_PATCH_DISABLED=1…

ParameterTypeDescription
anchor *string
handle *string
new_text *string