Context7
Up-to-date docs for AI agents
제작자가 쓴 설명(영어 원문)
Context optimization for LLM agents: tool registry, result masking, budgeting, compaction.
이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.
이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.
쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.
필요한 것
어떤 앱을 쓰세요?
위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.
Claude Desktop → Settings → Developer → Edit Config를 열고 claude_desktop_config.json에 이 내용을 붙여 넣으세요
{
"mcpServers": {
"distil": {
"command": "npx",
"args": [
"-y",
"@munhq/distil"
]
}
}
}터미널에서 이 명령어를 실행하세요
claude mcp add distil -- npx -y @munhq/distil프로젝트의 .cursor/mcp.json 또는 ~/.cursor/mcp.json에 붙여 넣으세요
{
"mcpServers": {
"distil": {
"command": "npx",
"args": [
"-y",
"@munhq/distil"
]
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
프로젝트의 .vscode/mcp.json에 붙여 넣으세요
{
"servers": {
"distil": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@munhq/distil"
]
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
이 서버는 내 컴퓨터에서 실행되는데, ChatGPT는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.
선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.
이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.
내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.
누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 6일 점검
레지스트리 이름이 GitHub 계정 munhq 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요
내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요
내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요
레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.
해당하는 기본 점검 1개 중 1개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.
레지스트리에 필수 키가 나와 있지 않아요. 다만 처음 쓸 때 로그인을 요구하는 서버도 있어요.
내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).
GitHub 저장소는 마지막으로 – 변경됐고, 최신 버전(0.3.4)은 2개월 전 레지스트리에 올라왔어요.
Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Node.js도 있어야 해요.
같은 카테고리에는: Context7, Codebase Memory, Exa
같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.
카드 보는 법:★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.
claude mcp add distil -- npx -y @munhq/distil
No account, no API key, nothing to configure. The package is a small wrapper that fetches the binary for your platform and verifies it against the published checksums; install.sh and a prebuilt binary remain for anyone without Node.
That is not a claim, it is a measurement: 13,814 real agent sessions, 410,742 assistant turns, re-run on 2026-08-29. Every unique token in them was billed 550 times, because a request resends the whole history.
Which means the obvious move — compress the history — is usually the wrong one. Editing history invalidates the cached prefix from the edit onwards and converts reads at 0.1x into writes at 1.25x or 2.0x. You cannot compress your way out of context cost. You can only decline to admit tokens.
Every tool in this space publishes a savings percentage measured on its own fixtures. What none publishes is the denominator: what share of a real session it is allowed to touch, and what that share costs once prompt-cache pricing is applied. distil measures both on transcripts an agent actually wrote.
What is prior art, and what is not. The cache arithmetic below is not a discovery. Anthropic's context editing docs state that clearing tool results invalidates the cached prefix, and ship clear_at_least so a clear only fires when it is large enough to pay for that. The break-even rule is published too: on a 5-minute cache, cleared tokens times requests-before-the-next-clear must exceed 11.5 times the tokens you keep. The table in this README reproduces that rule exactly — it was derived independently, which is a check on the arithmetic, not a contribution.
The gap is empirical. Every source says to calibrate against your own workload, and none ships a way to do it or publishes what the values turn out to be. That is what this crate is for: measuring the numbers you need in order to choose clear_at_least, or to decide not to clear at all.
Measured 2026-08-29 over 13,814 local Claude Code transcripts — 410,742 assistant turns, 212.7M tokens of unique text. Reproduce it on your own corpus with distil-bench ~/.claude/projects; a corpus grows, so the date matters more than the decimals.
| tokens | share | |
|---|---|---|
| tool results | 127,371,430 | 59.9% |
| tool calls | 38,065,121 | 17.9% |
| user text | 29,818,536 | 14.0% |
| assistant text | 15,402,077 | 7.2% |
| thinking | 2,076,716 | 1.0% |
Those 212.7M unique tokens were billed as 116.9 billion input tokens — every token paid for 550 times, because a request resends the whole history.
Price that at real cache multipliers (read 0.1x, write 1.25x for the 5-minute TTL and 2.0x for the 1-hour):
| share of tokens | share of cost | |
|---|---|---|
| cache read | 97.9% | 71.8% |
| cache writes | 2.0% | 27.6% |
Cache writes are 2% of the tokens and 28% of the bill. Editing history invalidates the cached prefix from the edit onwards, converting reads at 0.1x into writes at 1.25x or 2.0x. So a rewrite must shrink what it invalidates below:
| turns remaining | 5m TTL | 1h TTL |
|---|---|---|
| 1 | 8.0% | 5.0% |
| 10 | 46.5% | 34.5% |
| 20 | 63.5% | 51.3% |
| 100 | 89.7% | 84.0% |
That table is the published break-even rule in another form: at every row, cleared x turns / kept equals 11.5 for the 5-minute tier. Use it to pick a clear_at_least value, and use distil-bench to find the turn count and tail size to put into it — those are workload properties, and they are the part nobody publishes.
Per unit of history, at 10 remaining turns: keeping it costs 1.00, compressing it costs 2.15, and never admitting it costs 0. You cannot compress your way out of context cost. You can only decline to admit tokens.
Layers that do not touch history are on the right side of that arithmetic: CacheAlignLayer (orders content so the stable prefix stays cacheable) and ScratchpadLayer (keeps working state outside the window).
Layers that rewrite history — MaskingLayer, SummarizationLayer, CompactionLayer — cost more than they save in the common case. Reach for them at one boundary only: context overflow, where the alternative is a failed request and cache price stops being the comparison. BudgetLayer exists for exactly that moment.
RegistryLayer and CodeModeLayer predate Anthropic's Tool Search Tool and Programmatic Tool Calling, which do the same jobs natively and better. Prefer the native features.
For clearing old tool results, prefer the provider's clear_tool_uses context editing over MaskingLayer: it runs server-side, it takes clear_at_least, and it is one API parameter against a dependency. Reach for a layer here only when you need behaviour the API does not offer.
cargo build --features bench --release
./target/release/distil-bench ~/.claude/projects --json baseline.json
./target/release/distil-bench ~/.claude/projects --split-by-tool mcpcodeindex
./target/release/distil-bench ~/.claude/projects --export-sessions ./sessions --min-turns 40
See bench/README.md for the external-tool comparison, the fairness rules, and the two harness mistakes that produced wrong numbers first.
A saving is only a saving if the model can still answer what the original context could answer.
# No LLM judge: file paths checked against ground truth from the transcript
python bench/artifact_retention.py ./sessions 12
cargo build --features probe --release ./target/release/distil-probe --probes 6 --model qwen2.5:3b
The probe taxonomy is Factory.ai's; their write-up defines it and ships no harness. The judge is a Completer, never a Summarizer — a summarizer may impose summarization framing, which rewrites both the probe format and the grading instruction.
use distil::{CacheAlignLayer, Ctx, EstimateCounter, Pipeline};
let pipeline = Pipeline::builder() .counter(EstimateCounter) .layer(CacheAlignLayer::generic()) .build();
let mut ctx = Ctx::new(messages, tools, turn); let result = pipeline.optimize(&mut ctx); println!("{result}");
This example is kept compilable as examples/readme_quickstart.rs — run it with cargo run --example readme_quickstart.
Every layer implements Layer and reports tokens_before, tokens_after and a detail line, so each one can be measured on its own.
| feature | what it adds |
|---|---|
corpus | transcript loader (no extra dependencies) |
bench | distil-bench, needs tiktoken |
probe | distil-probe, needs proxy for the HTTP judge |
tiktoken | accurate BPE counts instead of the chars/3.5 estimate |
proxy | distil-proxy HTTP server |
mcp | distil-mcp MCP server |
metrics | Prometheus /metrics |
./install.sh # binaries, the skill, and the MCP server
/plugin marketplace add munhq/distil /plugin install distil # Claude Code: skill and server in one step
install.sh installs both binaries, drops the skill into every Claude home it finds, and registers the MCP server at user scope. When the plugin is already installed it installs the binary only, since the plugin declares the server and ships the skill itself.
The plugin launches the server with npx -y @munhq/distil, so it needs Node. It cannot use a plugin-relative path: Claude Code expands ${CLAUDE_PLUGIN_ROOT} and nothing else does, so a plugin declaring one hands every other client a literal path that does not exist. install.sh and the prebuilt binaries remain for anyone without Node.
| platform | binaries | scripts |
|---|---|---|
| Linux x86_64 / arm64 | released, tested | yes |
| macOS x86_64 / arm64 | released, built in CI | yes |
| Windows x86_64 / arm64 | released, built in CI | needs a shell: Git Bash, MSYS2 or WSL |
The release publishes six targets and plugin/test_platform.sh holds both the installer and the plugin launcher to that matrix, so an asset name and the name asked for cannot drift apart. install.sh and the launcher are bash scripts, so on Windows they need a shell — cmd and PowerShell cannot run them. Linux binaries are static musl builds, so they do not need a matching glibc.
The corpus is one developer's machine. The ratios are the finding; the absolute totals are personal. Counts use cl100k_base, which approximates Claude's tokenizer within a few percent. The break-even model assumes a single cache breakpoint, so a rewrite confined to the tail costs less than the table shows — that refines it, it does not reverse it.
Build and test instructions, the rules a benchmark change has to follow, and what a pull request needs before review: CONTRIBUTING.md. Report a vulnerability privately — SECURITY.md.
MIT. See LICENSE.