8000 feat(mcp): let admins see and change where files are kept by adeelahmad · Pull Request #151 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(mcp): let admins see and change where files are kept - #151

Merged
adeelahmad merged 1 commit into
mainfrom
claude/notes-module-j9j30y
Oct 5, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/notes-module-j9j30y

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Before: agents connected over MCP couldn't see or change where Lens keeps its files.

After: two new MCP tools, for admins only.

  • file_storage says where files go and lists the storage connections Lens could use. With check, it writes a small file there, reads it back and removes it.
  • set_file_storage keeps 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_storage and change_settings files (#148).

How: both tools are in app/api/mcp_tools.py. They reuse blobs.test and settings.save and are audited as settings.save files. test_file_storage_tools covers 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.md and docs/storage.md are updated.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XZQXJtCvJgbG1Z2H312KcS


Generated by Claude Code

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
@adeelahmad
adeelahmad merged commit 964e916 into main Oct 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0