Filelayer
by filelayer.dev · v0.36.1 · updated Nov 24, 2026
User files for a SaaS, under one person's authority: list, share with an expiry, revoke.
Run it locally
Install the package and point your AI client at it.
npm
npx -y @filelayer/[email protected]Environment variables
DATABASE_URLrequiredsecretYour own PostgreSQL, where this library keeps file ownership, grants and the audit chain. Apply node_modules/@filelayer/core/schema.sql once before starting.
FILELAYER_ASrequiredThe ONE subject this server speaks for, in your own id space. Fixed for the life of the process: no tool reads it as an argument and no tool can change it, which is the only reason exposing these tools to an agent is safe. Write it yourself or have your provisioning write it, never derive it from a...
FILELAYER_ORGrequiredThe organisation this server is scoped to, in your own id space.
FILELAYER_DATA_DIRA local directory for the bytes. Needs no bucket and no IAM user. Set this OR the S3_* block: with neither, the server refuses to start rather than falling back to memory, which would work in a demo and lose the first real file.
S3_ENDPOINTAn S3-compatible endpoint, for example https://<account>.r2.cloudflarestorage.com. Setting it makes S3_BUCKET, S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY required.
S3_BUCKETThe bucket. It must be private: this library decides who may be GIVEN a URL and has no say in who the object store will answer. `npx -p @filelayer/core filelayer doctor` reports whether yours serves unauthenticated reads.
S3_REGIONRegion, or `auto` for Cloudflare R2.
S3_ACCESS_KEY_IDsecretAccess key id for the bucket.
S3_SECRET_ACCESS_KEYsecretSecret access key for the bucket.
FILELAYER_MCP_AGENT_LABELHow this agent names itself in the audit trail, recorded on every event these tools produce. It is what lets the chain separate "the partner opened this document" from "the partner's assistant opened this document".
FILELAYER_MCP_ALLOW_DESTRUCTIVESet to exactly `true` to register delete_file. Off by default because deleting is not recoverable and an agent that misreads a sentence deletes the wrong thing silently.
FILELAYER_MCP_EXPOSE_AUDITSet to exactly `true` to register file_audit. Off by default because the trail is an organisation's whole history and a tool that returns it copies every file name, actor and denial into the model's context. Reading it is itself audited since 0.27.0, which was the previous reason; the default did no...
FILELAYER_MCP_RETURN_BYTESSet to exactly `true` to register read_file. Off by default because a document returned by a tool is a document copied into a model's context; file_info plus a share link is usually what was actually needed.
FILELAYER_BASE_URLThe base of the share URLs this instance mints. Without it, share links come back without a URL.
More MCP servers
FileToPDF
filetopdf.dev
Convert files, HTML, and Markdown to PDF via the FileToPDF API. Bring your own API key.
Firma
firma.dev
Send, track and manage e-signature requests, templates and webhooks with the Firma API.
Fiskmas
fiskmas.dev
Hosting for AI agents: your AI client deploys Docker apps to live HTTPS URLs over MCP.
FixedIn
fixedin.dev
Actively exploited? End of life? Which version fixes it? CVE verdicts for server software.
Fixter
fixter.dev
Monitoring for small teams. Logs, traces, metrics, live issue tracking, API/MCP uptime.
Flagbearer
flagbearer.dev
Feature flags for coding agents: create flags, roll them out gradually and write the flag code.