librechat-personal-files-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@librechat-personal-files-mcpSave the meeting notes to my private files and publish a shareable link"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
librechat-personal-files-mcp
MCP server providing per-user personal file storage, persistent documentation, RAG indexing/retrieval, and opaque public link publishing for LibreChat agents.
Features
Per-user storage: Private files under
/data/private/<userId>/with full CRUD, list, move operations.Documentation catalog:
save_documentation/update_documentationwrite todocs/and updatememory-index.json(schema v2).RAG integration:
index_documentsends content to rag_api viaPOST /embedwith canary verification (issue #305);search_knowledgefor semantic search;remove_from_knowledgefor deletion.Public publishing:
publish_filecreates cryptographically random tokens (≥128 bits); files served via NginxX-Accel-RedirectwithContent-Disposition: attachment,nosniff,no-store.Strict security: Fail-closed on missing/invalid
X-User-Id; path traversal blocked; no absolute paths; no..segments; symlink escape detection; reserved segment protection; atomic index writes with cross-process locking.
Related MCP server: knowledge_mgmt
Architecture
┌──────────────┐ ┌────────────────────────┐ ┌─────────────┐
│ LibreChat │────▶│ librechat-personal-files-mcp │──▶│ rag_api │
│ (Agent) │ MCP │ (stateless HTTP /mcp) │ │ (vector DB) │
└──────────────┘ └────────────────────────┘ └─────────────┘
│
│ GET /files/{token}
▼
┌──────────────┐
│ Nginx │
│ (X-Accel) │
└──────────────┘
│
▼
┌──────────────┐
│ /data/private│ (read-only bind)
└──────────────┘Quick Start (Development)
cd /opt/LibreChat/mcp-personal-files
python -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/python -m pytest
.venv/bin/python -m ruff check .
# Run server
STORAGE_ROOT=/tmp/pf-private JWT_SECRET=$(openssl rand -hex 32) .venv/bin/personal-files-mcpProduction Deployment
1. Host preparation (run once as root)
cd /opt/LibreChat
groupadd -g 2500 lcfiles 2>/dev/null || true
mkdir -p ./data/private/_system
chown -R 2000:2500 ./data/private
chmod 2770 ./data/private
setfacl -R -m g:2500:rX,d:g:2500:rX ./data/private 2>/dev/null || \
echo "ACL tools absent; using 644/755 fallback"
grep -q '^JWT_SECRET=' .env || echo "JWT_SECRET=$(openssl rand -hex 32)" >> .env2. Add to docker-compose.override.yml
Copy the blocks from docker-compose.snippet.yml into your existing override file.
3. Configure LibreChat Admin Panel
Add under MCP Settings:
mcpSettings:
allowedAddresses:
- 'librechat-personal-files:8080'
mcpServers:
personal-files:
type: streamable-http
url: http://librechat-personal-files:8080/mcp
timeout: 120000
chatMenu: false
headers:
X-User-ID: '{{LIBRECHAT_USER_ID}}'
X-User-Email: '{{LIBRECHAT_USER_EMAIL}}'Restart LibreChat.
4. Nginx configuration (add to existing server block)
limit_req_zone $binary_remote_addr zone=pubfiles:10m rate=5r/s;
location ^~ /files/ {
limit_req zone=pubfiles burst=10 nodelay;
limit_req_status 429;
proxy_pass http://librechat-personal-files:8080/files/;
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Real-IP $remote_addr;
}
location ^~ /_protected/ {
internal;
alias /data/private/;
}Reload Nginx.
Environment Variables
Variable | Default | Description |
|
| Header carrying the user identity |
|
| Root directory for user data |
|
| Legacy shared area (read/write during migration) |
|
| rag_api endpoint |
| required | HS256 secret shared with LibreChat/rag_api (≥32 chars) |
|
| Base URL for public links |
|
| Max upload size |
|
| SQLite registry for public links |
MCP Tools
Storage
list_files(path="", recursive=false, pattern=null)— list files/dirsread_file(path)— read UTF-8 text; error for binary or >2 MBwrite_file(path, content)— write text (UTF-8), creates parent dirsupdate_file(path, content)— update existing filedelete_file(path)— delete file or directorymove_file(src, dst)— move within user rootget_file_info(path)— metadata + docindex + publishing status
Documentation
save_documentation(filename, content, title?, description?, tags?, topics?)— saves todocs/, updates index, does not publish or indexupdate_documentation(filename, content, ...)— update existing docget_document_metadata(filename)— full index entry
RAG
search_knowledge(query, limit=8)— semantic search (owner-scoped via JWT)index_document(path)— embed + canary verify, updates index statusremove_from_knowledge(path)— delete from rag_api, clears indexget_index_status()— counts + rag_api health
Publishing
publish_file(path, expires_in_days?)— create/reuse public link, returns token + URLunpublish_file(path_or_token)— revoke link (file stays private)get_public_link(path)— active link for pathlist_public_links()— all links for user
Security Model
Identity:
X-User-Idheader injected by LibreChat ({{LIBRECHAT_USER_ID}}). Placeholder unresolved → empty string → fail-closed.Fail-closed: Missing/empty/invalid header → HTTP 403
{"error":"missing_user_identity"}or{"error":"invalid_user_identity"}.Path safety: All paths are relative; absolute paths and
..rejected; symlink escape detected viaPath.resolve()+ prefix check.Isolation: rag_api owner scope enforced by JWT
sub/id= userId (PR #319 merged 2026-08-15).Public links: Opaque
secrets.token_urlsafe(16)tokens; no user/path in URL; revocation via410 Gone; lazy cleanup of expired entries.
Development
# Run tests
.venv/bin/pytest -q
# Lint
.venv/bin/ruff check .
# Type check (optional)
.venv/bin/mypy src/personal_files_mcp # if mypy added to depsLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to process files locally — OCR images, extract text from PDFs and DOCX, and describe images using local vision models, all without sending data to external services.
- AlicenseNot gradedqualityDmaintenanceEnables uploading, organizing, and semantically searching documents with support for various file types and embedding providers.27MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents with long-term memory and retrieval-augmented generation (RAG) capabilities, allowing them to recall past conversations, search local files, and learn user preferences.MIT
- AlicenseAqualityCmaintenanceProvides AI agents with local file-processing capabilities for token counting, RAG chunking, CSV/JSON conversion, QR generation, and more, while keeping documents private on the user's machine.71MIT
Related MCP Connectors
File uploads for AI agents. Upload, list, and manage files. No signup required.
Securely search and manage workspace context files for AI agents and teams.
Upload any file, get a tracked shareable link. DocSend for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/martinriesel/librechat-personal-files-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server