fix(server): honor exclude on the mcp kb_export tool - #618
Merged
Conversation
the kb.export mcp tool dropped the `exclude` filter that the jsonl rpc and `vouch export --exclude` cli both accept (added in fdf1520, which missed server.py), so an mcp agent — the primary vouch client — could never produce a knowledge-only bundle and got no `excluded` in the response. thread it through to bundle.export, matching the sibling surfaces.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Walkthrough
ChangesMCP export exclusions
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
plind-junior
enabled auto-merge
July 30, 2026 13:04
Member
|
Eagle eye, nice catch! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
the mcp
kb_exporttool (server.py) is the only one of the three export surfaces that ignoresexclude. the jsonl rpc_h_exportand thevouch export --excludecli both accept it and thread it intobundle.export, returningexcludedin the result; the mcp tool takes onlyout_path, always writes a full bundle, and omitsexcluded.excludeis load-bearing — it drives the knowledge-only preset (KNOWLEDGE_EXCLUDE = ("decided", "sessions")). the mcp surface is the primary agent transport (claude code / cursor / codex), so an agent currently cannot produce a filtered bundle over mcp.this is surface drift from
fdf1520(which addedexcludeto the cli and jsonl rpc but missedserver.py); the later path-fencing rework ofkb_exportdidn't restore it.fix
add the optional
exclude: list[str] | Noneparam and thread it tobundle.export(..., exclude=tuple(exclude or ())), and returnexcluded— identical to_h_export. unknown/traversal names still raise via_check_exclude, matching the other surfaces.test
test_kb_export_mcp_honors_excludecalls the mcp tool withexclude=["decided", "sessions"]and assertsresult["excluded"]plus an absentsessions/subdir in the tarball. it fails on the current code (TypeError: unexpected keyword argument 'exclude') and passes with the fix.validation
make checkgreen:ruff check src tests,mypy src(116 files, no issues), fullpytest tests/ --ignore=tests/embeddings.test_capabilitiesstill passes (the method list is unchanged; only the tool signature gains an optional param).Summary by CodeRabbit
New Features
Bug Fixes