Repository navigation
feat(mcp): let admins see and change where files are kept - #151
Merged
Merged
Conversation
file_storage says where Lens keeps its own files and which connections could take them, and checks it; set_file_storage changes it after checking that a small file can be written, read back and removed there. Admins only; changing it needs the write scope. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XZQXJtCvJgbG1Z2H312KcS
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.
Before: agents connected over MCP couldn't see or change where Lens keeps its files.
After: two new MCP tools, for admins only.
file_storagesays where files go and lists the storage connections Lens could use. Withcheck, it writes a small file there, reads it back and removes it.set_file_storagekeeps new files on this machine or on a connection (with a folder and optional rclone crypt). It runs the same check first and saves only if the check passes. Changing storage needs a token with the write scope.New connections are still added in the web app, and files already stored stay where they are. The in-app assistant already has the same through
file_storageandchange_settings files(#148).How: both tools are in
app/api/mcp_tools.py. They reuseblobs.testandsettings.saveand are audited assettings.save files.test_file_storage_toolscovers non-admins being refused, the check, a missing or unknown connection, and saving. The MCP tests pass (15), and mypy and ruff are clean.docs/mcp.mdanddocs/storage.mdare updated.🤖 Generated with Claude Code
https://claude.ai/code/session_01XZQXJtCvJgbG1Z2H312KcS
Generated by Claude Code