Skip to main content
Glama
README.md
# FlexFiles MCP server

Use [FlexFiles](https://flexfiles.io) from Claude, Cursor, VS Code and other AI apps. Ask "compress
report.pdf", "merge these two PDFs" or "make this scan searchable", and the assistant runs the
FlexFiles tool and saves the result next to your file.

It covers all 29 FlexFiles tools: compress, merge, split, convert to and from Word, Excel,
PowerPoint, JPG, HTML and text, OCR, protect and unlock, repair, deskew, flatten, add pages, links,
headers and footers, search and replace, remove annotations, and image convert, compress, enhance
and background removal.

## What you need

- A FlexFiles **Pro or Business** plan and an API key from
  [Account → API Keys](https://flexfiles.io/en/account#api-keys).
- Node.js 20 or newer.

## Set it up

Replace `ff_your_key` with your key in the snippets below.

**Claude Code**

```bash
claude mcp add flexfiles --env FLEXFILES_API_KEY=ff_your_key -- npx -y @flexfiles/mcp
```

**Claude Desktop**: Settings → Developer → Edit Config, then add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "flexfiles": {
      "command": "npx",
      "args": ["-y", "@flexfiles/mcp"],
      "env": { "FLEXFILES_API_KEY": "ff_your_key" }
    }
  }
}
```

**Cursor**: the same `mcpServers` block in `~/.cursor/mcp.json` (all projects) or
`.cursor/mcp.json` (one project).

**VS Code** (agent mode): `.vscode/mcp.json`. VS Code asks for the key once and stores it securely:

```json
{
  "inputs": [
    { "type": "promptString", "id": "flexfiles-key", "description": "FlexFiles API key", "password": true }
  ],
  "servers": {
    "flexfiles": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@flexfiles/mcp"],
      "env": { "FLEXFILES_API_KEY": "${input:flexfiles-key}" }
    }
  }
}
```

Other apps that run local MCP servers take the same command (`npx -y @flexfiles/mcp`) and
environment variable.

## Tools

| Tool | What it does |
| --- | --- |
| `convert_file` | Runs a FlexFiles tool on local files or https links, waits for the result (50 s by default) and saves it locally. |
| `get_conversion` | Checks a conversion that took longer and saves its result once it's done. |
| `list_conversions` | Lists recent conversions, newest first. |
| `list_tools` | Shows each tool's accepted files and settings (passwords, page ranges, formats). |
| `get_account` | Shows which FlexFiles account and plan the key uses. |

Example requests:

- "Compress ~/Documents/report.pdf as much as possible."
- "Merge invoice-1.pdf and invoice-2.pdf, in that order."
- "Convert contract.pdf to Word, pages 1 to 3 only."
- "Protect payslip.pdf with the password I give you."
- "Make scan.pdf searchable; it's in French."

## Files and safety

- **Results are saved next to the first input file**, or in the folder you name. Nothing is
  overwritten: when FlexFiles names the result like the original, it's saved as
  `report - Compress PDF.pdf`, and clashes get ` (1)`, ` (2)`. Your originals are never changed.
- **Only documents are sent.** A local file is uploaded only when its content is a PDF, image, Word
  or HTML file of the kind the tool reads. Anything else (keys, `.env` files, archives, folders) is
  refused before upload, so a document asking the assistant to "compress ~/.ssh/id_rsa" gets
  nowhere.
- **Links:** an https link is passed to FlexFiles, which downloads it itself (the link must be
  public and the download must finish within 15 seconds).
- Files go to your FlexFiles account and are kept as your plan's retention rules say; see the
  [privacy policy](https://flexfiles.io/en/privacy).
- The key is sent only to the FlexFiles API, never to download links, and requests carrying it don't
  follow redirects.

## Settings

| Variable | Meaning |
| --- | --- |
| `FLEXFILES_API_KEY` | Your FlexFiles API key (required for conversions). |
| `FLEXFILES_API_URL` | API address; defaults to `https://api.flexfiles.io/api/v1`. |

Long conversions: `convert_file` waits up to `wait_seconds` (50 by default), sending progress
updates to apps that show them. A job still running after that comes back with a `conversion_id`;
the assistant collects it later with `get_conversion`.

Usage counts against your plan's daily conversions and API limits (30 conversions a minute).
FlexFiles records that a conversion came from this server (`X-FlexFiles-Client: mcp-local/<version>`)
to count usage per integration.

## Troubleshooting

- **"No FlexFiles API key is set"**: add `FLEXFILES_API_KEY` to the server's `env` and restart the app.
- **"API access is no longer available on your current plan"**: API keys need Pro or Business.
- **"… isn't a PDF, image, Word or HTML file"**: the file isn't a kind FlexFiles reads, or isn't
  what its name says.
- **Results land in an odd folder**: some desktop apps start servers in `/`; pass `save_to`, or
  use absolute paths. Results of links go to the server's working folder, or to `~/Downloads` when
  that's `/`.

## Development

```bash
npm install
npm run typecheck
npm run build
npm test
npm run update-catalog   # refresh the bundled tool list from the API
```

The server reads the tool list from `GET /api/v1/tools` at startup and falls back to the bundled
copy in `src/catalogFallback.ts` when the API can't be reached.

## License

MIT

TDQS

A3.8/5.0

Scored across 5 tools

Disambiguation4/5

Four of the five tools have clearly distinct roles: account info, polling a conversion, listing conversions, and inspecting the tool catalog. The only friction is convert_file, which bundles ~30 actions behind one name, so agents must read the action vocabulary rather than select a tool; get_conversion vs. list_conversions could also briefly be confused but descriptions clarify.

Naming Consistency5/5

All five top-level tools follow the same snake_case verb_noun pattern: convert_file, get_account, get_conversion, list_conversions, list_tools. The kebab-case action identifiers live inside convert_file's parameter space, so they don't break the tool-name convention.

Tool Count4/5

Five tools is a compact, well-scoped surface for an API that actually exposes 30+ operations, and the dispatcher pattern keeps the MCP surface small. It is slightly under-fragmented, however, since nearly all real work hides behind a single overloaded tool, forcing discovery via list_tools.

Completeness4/5

Coverage is broad: bidirectional conversions (PDF/Word/HTML/PPTX/Excel/TXT/JPG), PDF editing (merge, split, page ops, headers, links, protect/unlock, flatten, annotate removal, repair, compress, OCR, deskew), image processing, plus job status and catalog discovery. Gaps are minor, e.g. no cancel-conversion or delete/cleanup of stored results, but all core workflows have a path.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues