Skip to main content

FastOCR

FastOCR MCP server

OCR any scanned PDF or image from Claude, Cursor and other MCP clients, in 100+ languages. fastocr.org · Docs · Get an API key

PyPI License: MIT

An MCP server for the FastOCR Document OCR API. It lets Claude Desktop, Claude Code, Cursor and other MCP clients OCR a local scanned PDF or image and get back its text or a searchable PDF.

  • PDF files up to 1 GiB, and PNG, JPG, JPEG, GIF, WebP and BMP images up to 20 MiB; 100+ languages.
  • Built on the official fastocr-sdk and the official MCP Python SDK. Runs locally over stdio; your files go only to the FastOCR API.

A scanned Arabic book page beside the text FastOCR returned for it

A real scanned page and the first lines of the text FastOCR returned for it, unedited.

API reference and guides: https://fastocr.org/docs

Get an API key

Any signed-in FastOCR account can create an API key and start right away.

  1. Sign in and create an API key in the developer console. You accept the API terms with your first key.
  2. Set the key as FASTOCR_API_KEY in your MCP client config (see below).
  3. When you need more than the free pages, buy a prepaid API page pack by card in the developer console.

Each account gets 50 free document pages per month.

Install

With uv there is nothing to install; MCP clients run it with uvx fastocr-mcp. Or install it with pip and run fastocr-mcp:

pip install fastocr-mcp

Python 3.10 or newer. The server reads the key from FASTOCR_API_KEY.

Configure your MCP client

Claude Code

claude mcp add fastocr -e FASTOCR_API_KEY=your_api_key -- uvx fastocr-mcp

Claude Desktop

Add this to claude_desktop_config.json (Settings > Developer > Edit Config), then restart Claude Desktop:

{
  "mcpServers": {
    "fastocr": {
      "command": "uvx",
      "args": ["fastocr-mcp"],
      "env": { "FASTOCR_API_KEY": "your_api_key" }
    }
  }
}

Cursor

Add the same block to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):

{
  "mcpServers": {
    "fastocr": {
      "command": "uvx",
      "args": ["fastocr-mcp"],
      "env": { "FASTOCR_API_KEY": "your_api_key" }
    }
  }
}

If you installed with pip, use "command": "fastocr-mcp" and "args": [].

Tools

Tool What it does
ocr_file(path, output="text", output_path=None) Uploads a local PDF or image, runs OCR and waits up to 45 seconds; a larger document returns its id for get_document. output="text" returns the text (text over 20,000 characters is cut, and the full text is saved to output_path or <file>.ocr.txt next to the input file). output="pdf" saves a searchable PDF to output_path or <file>.searchable.pdf.
ocr_pdf(path, output="text", output_path=None) The same tool as ocr_file under its earlier name, kept so existing setups keep working.
get_document(document_id, output="status", output_path=None) Status and page counts of a document; with output="text" or "pdf", waits up to 45 seconds and fetches the finished result. Fetching a result again costs no pages.
list_documents(limit=20) The most recent documents in the account, newest first.
delete_document(document_id) Deletes a document and its stored files on FastOCR. Local files are not touched.

Try asking: "OCR ~/Downloads/scanned-contract.pdf and summarize the termination clause", "Read the text in /Users/me/Desktop/receipt.jpg" or "Make a searchable copy of /Users/me/archive/1998-letters.pdf".

Every processed page uses one page of the account's API allowance; an image is one page. A document that runs out of pages fails with buy_pages; the tool says so and links to the developer console.

Errors

Tool errors are written for the agent to act on: a rejected key, an account out of pages (buy_pages), too many documents processing at once (concurrency_limit), a missing file, or an unsupported file type. Each message says what to do next. Error codes are listed in the API docs.

Configuration

Variable Purpose
FASTOCR_API_KEY Required. Your API key.
FASTOCR_BASE_URL Optional. Overrides https://api.fastocr.org.

License

MIT

Metadata

Release files for fastocr-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastocr-mcp 0.1.0
File Size Uploaded Provenance
fastocr_mcp-0.1.0.tar.gz 17.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fastocr-mcp 0.1.0
File Interpreter ABI Platform
fastocr_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.6 kB

Release files / fastocr_mcp-0.1.0.tar.gz

Download URL fastocr_mcp-0.1.0.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
771f1d6e26ac489c3de2c02621d31b7963c1592e07d99e5dee5b4373a5c50eb3
BLAKE2b-256 checksum
How to use checksums
e094fc5b06c82eef2036dd7157d299ee6a5bc84efb99b85b497fa01e1ff9f3a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / fastocr_mcp-0.1.0-py3-none-any.whl

Download URL fastocr_mcp-0.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4504b20e6d239b0e7baf7bc9bc1051a8a84973b1bc2c573b166b00b176da485
BLAKE2b-256 checksum
How to use checksums
97847043e7455bc29570c81dce7f4496e06d3d6187190d203780890e7dc9984b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for fastocr-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fastocr_mcp-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page