# Filelayer

> Filelayer is an open-source MCP server for files and documents. File ownership, expiring shares and audit trail for SaaS apps, exposed to agents over MCP. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Starting price:** $99 a month
- **Platforms:** CLI, self-hosted
- **Website:** https://filelayer.dev
- **Repository:** https://github.com/filelayer/filelayer/tree/HEAD/packages/core
- **MCP Registry name:** dev.filelayer/core
- **Categories:** files and documents, security
- **Listing updated:** 2026-11-14

## About

Filelayer is a Node library that keeps file ownership, grants and a hash-chained audit trail in your own PostgreSQL, with the bytes on your own S3-compatible bucket or a local directory. The MCP package exposes a slice of it to an agent: list a user's files, share one with an expiry and revoke the link.

The safety design is that the server speaks for exactly one subject. FILELAYER_AS and FILELAYER_ORG are fixed for the life of the process, and no tool reads them as an argument, so an agent cannot act as someone else. To serve several people you start several servers. The bucket must be private, and a doctor command checks whether it serves unauthenticated reads.

The project is Apache-2.0 and labelled alpha at v0.35.3, so the schema can still change in any 0.x release. It needs Node 22.18 or later and a Postgres you already run.

## Features

- **Single-subject server:** Acts for one fixed user and organization that tools cannot change.
- **Expiring shares:** Share a file with an expiry, a download cap or a password.
- **Revocable links:** Revoke a share so access stops immediately, not at expiry.
- **Hash-chained audit:** Records allowed and denied access in your own Postgres.
- **Bring your own storage:** Uses your S3 or R2 bucket, or a local data directory.
- **Doctor check:** Reports whether your bucket serves unauthenticated reads.

## Good for

- Let an agent list a customer's files without cross-user access
- Share a contract with an expiring link and revoke it later
- Answer a security review about who opened or was refused a file
- Add per-file permissions to a SaaS app on your own bucket

## Install

### Claude Code (Terminal)

```sh
claude mcp add core --env DATABASE_URL='<DATABASE_URL>' --env FILELAYER_AS='<FILELAYER_AS>' --env FILELAYER_ORG='<FILELAYER_ORG>' --env S3_ACCESS_KEY_ID='<S3_ACCESS_KEY_ID>' --env S3_SECRET_ACCESS_KEY='<S3_SECRET_ACCESS_KEY>' -- npx -y @filelayer/core
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "core": {
      "command": "npx",
      "args": [
        "-y",
        "@filelayer/core"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "FILELAYER_AS": "<FILELAYER_AS>",
        "FILELAYER_ORG": "<FILELAYER_ORG>",
        "S3_ACCESS_KEY_ID": "<S3_ACCESS_KEY_ID>",
        "S3_SECRET_ACCESS_KEY": "<S3_SECRET_ACCESS_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "core": {
      "command": "npx",
      "args": [
        "-y",
        "@filelayer/core"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "FILELAYER_AS": "<FILELAYER_AS>",
        "FILELAYER_ORG": "<FILELAYER_ORG>",
        "S3_ACCESS_KEY_ID": "<S3_ACCESS_KEY_ID>",
        "S3_SECRET_ACCESS_KEY": "<S3_SECRET_ACCESS_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "core": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@filelayer/core"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "FILELAYER_AS": "<FILELAYER_AS>",
        "FILELAYER_ORG": "<FILELAYER_ORG>",
        "S3_ACCESS_KEY_ID": "<S3_ACCESS_KEY_ID>",
        "S3_SECRET_ACCESS_KEY": "<S3_SECRET_ACCESS_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "core": {
      "command": "npx",
      "args": [
        "-y",
        "@filelayer/core"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "FILELAYER_AS": "<FILELAYER_AS>",
        "FILELAYER_ORG": "<FILELAYER_ORG>",
        "S3_ACCESS_KEY_ID": "<S3_ACCESS_KEY_ID>",
        "S3_SECRET_ACCESS_KEY": "<S3_SECRET_ACCESS_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "core": {
      "command": "npx",
      "args": [
        "-y",
        "@filelayer/core"
      ],
      "env": {
        "DATABASE_URL": "<DATABASE_URL>",
        "FILELAYER_AS": "<FILELAYER_AS>",
        "FILELAYER_ORG": "<FILELAYER_ORG>",
        "S3_ACCESS_KEY_ID": "<S3_ACCESS_KEY_ID>",
        "S3_SECRET_ACCESS_KEY": "<S3_SECRET_ACCESS_KEY>"
      }
    }
  }
}
```

## FAQ

### Is it free?

The library is Apache-2.0 and free in production. Team is $99 a month and Business $299 a month for support; Enterprise is by email.

### Why is it safe to expose to an agent?

The acting subject is fixed in environment variables and no tool accepts it as an argument.

### What does it need?

Node 22.18 or later, a PostgreSQL database and either an S3-compatible bucket or a local data directory.

### How mature is it?

It is alpha at v0.35.3, and the schema can still change in any 0.x release.

### Is Filelayer free?

Yes. Filelayer is open source, so you can use and self-host it for free.

### How do I add Filelayer to Claude Code?

Run this command in your terminal: claude mcp add core --env DATABASE_URL='<DATABASE_URL>' --env FILELAYER_AS='<FILELAYER_AS>' --env FILELAYER_ORG='<FILELAYER_ORG>' --env S3_ACCESS_KEY_ID='<S3_ACCESS_KEY_ID>' --env S3_SECRET_ACCESS_KEY='<S3_SECRET_ACCESS_KEY>' -- npx -y @filelayer/core

### What are the best alternatives to Filelayer?

The closest alternatives to Filelayer are REA, Agent Roast, Midplane, Leash and ASTra.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.
- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [Leash](https://ai-powered.com/mcp/leash): Leash is a free MCP server for security.
- [ASTra](https://ai-powered.com/mcp/astra): ASTra is a freemium MCP server for files and documents.
- [Tinplate Edge AI Safety, Security & EU Compliance](https://ai-powered.com/mcp/tinplate-edge-ai-safety-security-and-eu-compliance): Tinplate Edge AI Safety, Security & EU Compliance is a freemium MCP server for security.
- [SecureCloud](https://ai-powered.com/mcp/securecloud): SecureCloud is a free MCP server for security.
- [Eikino](https://ai-powered.com/mcp/eikino): Eikino is a freemium MCP server for security.

---
Source: https://ai-powered.com/mcp/filelayer
