# Passing files

Source: https://smartpdf.ru/en/developers/docs/files

## File by link — for MCP

MCP tools accept a link to a file and download it themselves. The link must be:

- public — `http` or `https`, with no sign-in or cookies (temporary S3 or cloud drive links, for example, will work);
- to an external address — internal network addresses and `localhost` aren’t accepted;
- to a file of up to 100 MB that downloads in no more than a minute.

The result comes back as a link — the agent will pass it to you or download it itself.

## File from your computer — via REST

If the file is on your disk, it’s first uploaded with `POST /v1/upload`, and the operation is started via the REST API. Agents with terminal access (Claude Code, Codex CLI, Gemini CLI, Cursor) can do this:

```bash
FILE_ID=$(curl -sS -H "X-API-Key: $SMARTPDF_API_KEY" -F "file=@contract.pdf" \
  https://api.smartpdf.ru/v1/upload | jq -r .file_id)
```

Then start the operation, wait and download the result, as in the [quick start](https://smartpdf.ru/en/developers/docs/quickstart). Just ask the agent: “upload contract.pdf to SmartPDF via the REST API and compress it” — and give it a link to this page or to [llms.txt](https://smartpdf.ru/en/developers/llms.txt).

Even simpler: give the agent the SmartPDF skill — instructions and a script that uploads the file, starts the operation and saves the result next to the original (Python 3, no dependencies). In Claude Code, it comes with the [plugin](https://smartpdf.ru/en/developers/docs/claude-code); for Codex CLI, Gemini CLI, Cursor and VS Code, copy the [skills/smartpdf](https://github.com/kirmoz1997/smartpdf-agents/tree/main/skills/smartpdf) folder into the agent’s skills folder.
