Generic MCP server exposing a scan tool to network (eSCL/AirScan) and USB (WIA/SANE/TWAIN) scanners.
Project description
scanner-mcp
Let Claude scan and read paper documents from any USB or network scanner.
A generic MCP server that exposes a scanning tool to Claude (and any other MCP client). It works with network scanners through the standard eSCL / AirScan / Mopria protocol and with USB scanners through the platform driver stack — WIA on Windows and SANE on Linux/macOS. No vendor-specific driver code.
When Claude needs to read a paper document, it can call scan_document, and the page
image is returned inline so Claude can read it directly (optionally OCR'd to text, or
saved as PDF).
What it exposes
| Tool | Purpose |
|---|---|
list_scanners |
Discover every scanner reachable from this machine (network + USB). |
scan_document |
Scan a page/stack and return it as inline images, a saved file, and/or OCR text. |
Backends are auto-detected and degrade gracefully — the same server runs on any OS and lights up whatever scanners it can reach:
- eSCL (
_uscan._tcpmDNS) — driverless network MFPs/scanners. Cross-platform. - WIA — USB (and some network) scanners on Windows, driven via PowerShell COM.
- TWAIN — Windows scanners that expose only a TWAIN data source (older/pro units
with no usable WIA driver). Optional; needs
pytwain+ a TWAIN DSM (see below). - SANE (
scanimage) — USB/network scanners on Linux and macOS.
Install
cd scanner-mcp
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
pip install -e .
# optional OCR support:
pip install -e ".[ocr]" # also needs the Tesseract binary installed
# optional TWAIN backend (Windows only):
pip install -e ".[twain]" # also needs a TWAIN DSM (see below)
Platform prerequisites:
- Windows: nothing extra for WIA — it and PowerShell ship with Windows. Install the
scanner's normal Windows driver so it appears in Devices.
- TWAIN (optional): install
pytwain(pip install -e ".[twain]") and make sure a TWAIN DSM is present. 64-bit Python needsTWAINDSM.dll(shipped by most TWAIN 2.x drivers or the TWAIN DSM redistributable); 32-bit Python can use the classictwain_32.dll. If neither is installed, the TWAIN backend just stays disabled.
- TWAIN (optional): install
- Linux:
sudo apt install sane-utils(providesscanimage). - macOS:
brew install sane-backendsfor USB; network scanners work via eSCL with no extras. - Network scanners: just be on the same LAN/subnet; mDNS handles discovery.
Connect it to Claude
Claude Desktop
Edit claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"scanner": {
"command": "C:\\Users\\aminh\\scanner-mcp\\.venv\\Scripts\\scanner-mcp.exe"
}
}
}
On macOS/Linux use the venv path /path/to/scanner-mcp/.venv/bin/scanner-mcp.
Claude Code (CLI)
claude mcp add scanner -- /path/to/scanner-mcp/.venv/bin/scanner-mcp
Restart the client, then ask Claude: "List my scanners" or "Scan the document on the glass and read it."
How you actually run it
You normally don't launch anything yourself — Claude Desktop/Code starts the
scanner-mcp server in the background (per the config above) and calls its tools when
you ask. Running scanner-mcp by hand just starts the MCP server, which waits silently
for JSON-RPC on stdin; it is not an interactive shell.
To test the hardware without Claude, use the bundled CLI, test_scan.py:
# from the project folder, using the venv's Python
python test_scan.py --list # discover scanners
python test_scan.py --dpi 300 # scan (auto-selects if only one)
python test_scan.py --scanner "<id>" --source adf --format pdf
Configuration (env vars)
| Variable | Default | Meaning |
|---|---|---|
SCANNER_MCP_SAVE_DIR |
~/Scans |
Where scans are written. |
SCANNER_MCP_LOG |
INFO |
Log level. |
scan_document options
scanner_id (from list_scanners; auto if only one), source
(auto/platen/adf/adf-duplex), resolution (DPI), color_mode
(color/gray/lineart), output_format (png/jpeg/pdf), save_dir,
return_image (inline images for Claude to read), ocr (extract text).
Notes & limitations
- eSCL covers most scanners sold in the last ~decade (anything "AirPrint/AirScan" or "Mopria" capable). Older USB-only units go through WIA/SANE instead.
- PDF output for multi-page WIA scans is assembled with Pillow.
- HTTPS eSCL devices use self-signed certs, so TLS verification is disabled for them (typical for LAN scanners); prefer a trusted network.
- This server performs local hardware I/O only — it does not send anything to the cloud.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scanner_mcp-0.1.0.tar.gz.
File metadata
- Download URL: scanner_mcp-0.1.0.tar.gz
- Upload date:
- Size: 298.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94e96b9ef44c1ce16f4c7fdbab3162657151a8dc864a77bb36e9fdc02552c253
|
|
| MD5 |
af8090b4a0f10030826ed2c59a19239d
|
|
| BLAKE2b-256 |
bd610952caf6a2e279880d493288cb48df7fc6c7229a942c7d8bdd2f62a3ba1a
|
Provenance
The following attestation bundles were made for scanner_mcp-0.1.0.tar.gz:
Publisher:
publish.yml on AminHA1248/scanner-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanner_mcp-0.1.0.tar.gz -
Subject digest:
94e96b9ef44c1ce16f4c7fdbab3162657151a8dc864a77bb36e9fdc02552c253 - Sigstore transparency entry: 2152410695
- Sigstore integration time:
-
Permalink:
AminHA1248/scanner-mcp@976bb2bc52d6ddba9104535d8cd3a6055183cd90 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AminHA1248
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@976bb2bc52d6ddba9104535d8cd3a6055183cd90 -
Trigger Event:
release
-
Statement type:
File details
Details for the file scanner_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scanner_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e0fe30470af6174f418ff45f7f7ae0dbed04a6f4f8762a798258cea074bac65
|
|
| MD5 |
143cd4d3e7bc12faccfd8ded814319a3
|
|
| BLAKE2b-256 |
9ba338d031895a1677d7dbb3aff82423940227f43f5db2713b7fb2daa1bc7b63
|
Provenance
The following attestation bundles were made for scanner_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on AminHA1248/scanner-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scanner_mcp-0.1.0-py3-none-any.whl -
Subject digest:
2e0fe30470af6174f418ff45f7f7ae0dbed04a6f4f8762a798258cea074bac65 - Sigstore transparency entry: 2152410706
- Sigstore integration time:
-
Permalink:
AminHA1248/scanner-mcp@976bb2bc52d6ddba9104535d8cd3a6055183cd90 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AminHA1248
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@976bb2bc52d6ddba9104535d8cd3a6055183cd90 -
Trigger Event:
release
-
Statement type: