Skip to main content
MCP server CX Codex

Filelayer — Claude Code MCP server: what it does, how to install

Filelayer is an MCP server for Claude Code that checks who may read, download, or revoke files and serves them with the right headers. It issues share links with time, password, and download limits.

Apache-2.0 updated 2026-10-21

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add core -e DATABASE_URL=<DATABASE_URL> -e FILELAYER_AS=<FILELAYER_AS> -e FILELAYER_ORG=<FILELAYER_ORG> -e S3_ACCESS_KEY_ID=<S3_ACCESS_KEY_ID> -e S3_SECRET_ACCESS_KEY=<S3_SECRET_ACCESS_KEY> -- npx -y @filelayer/core
Open on GitHub

What Filelayer does

Filelayer sits between your application and your Postgres database plus object storage (S3, R2, B2 or a local directory). You pass the caller's own user id, and one authorization function decides what they can do with a file, streams the bytes with correct headers, and logs the decision in the same transaction that made it.

Share links can carry a password, an expiry and a download cap, and can be revoked afterward — access stops on the next request. For taking access back from one named person, unshare is the right call rather than revoking a single grant id, because create() is not idempotent and an earlier grant can stay live.

Filelayer does not substitute for row-level security: a direct SELECT against its tables passes through unfiltered, though the schema blocks cross-tenant grants and authority leaking through delegation. For public images at CDN volume or video with scrubbing, a CDN fits better, since every byte here is proxied through your own server.

What it helps with

  • share a private file with one user or an entire org
  • issue a file link with a password, expiry and download limit
  • revoke a share link already handed to someone
  • log who accessed a file, including denied requests
  • cap how many times a file can be downloaded

Example prompts for the agent

  • Share file id with user_456 for one hour, capped at three downloads
  • Revoke all of user_456's access to this file using unshare
  • Show who accessed file id and which requests were denied

How to install Filelayer

Platform CLI

claude mcp add core -e DATABASE_URL=<DATABASE_URL> -e FILELAYER_AS=<FILELAYER_AS> -e FILELAYER_ORG=<FILELAYER_ORG> -e S3_ACCESS_KEY_ID=<S3_ACCESS_KEY_ID> -e S3_SECRET_ACCESS_KEY=<S3_SECRET_ACCESS_KEY> -- npx -y @filelayer/core

Replace <…> with your own values. 9 more environment variables are in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Filelayer

How do I install Filelayer in Claude Code?

Run `claude mcp add core -e DATABASE_URL=<DATABASE_URL> -e FILELAYER_AS=<FILELAYER_AS> -e FILELAYER_ORG=<FILELAYER_ORG> -e S3_ACCESS_KEY_ID=<S3_ACCESS_KEY_ID> -e S3_SECRET_ACCESS_KEY=<S3_SECRET_ACCESS_KEY> -- npx -y @filelayer/core`.

What does Filelayer do?

It decides whether a caller can read, download or revoke a specific file, serves the bytes with correct headers, and records the access decision in a log. It also issues share links with a password, expiry and download cap.

What does Filelayer need to run?

A nine-table schema that lives in your own Postgres, with file bytes stored in S3, R2, B2 or a local directory behind one storage adapter.

Similar MCP servers

All MCP servers for Backend and APIs →

Project sponsors

Companies that keep this analytics open