scan-mcp
This server provides an MCP interface for discovering scanners, starting/configuring scan jobs, and inspecting/cancelling jobs and their artifacts.
Discover connected scanner devices and their SANE options.
Start scan jobs with optional device auto-selection and defaults.
Configure scans by resolution, color mode, source, duplex, page size, custom size, output format, temp dir, and document break policy.
Optionally detect and crop carrier-sheet pages while preserving raw pages.
Check job status, list recent jobs, and cancel running jobs.
Retrieve job manifests and event logs.
Supports discovery and scanning from Epson scanners via the SANE epson2 backend, enabling scan jobs with device options, ADF/duplex, page-size settings, and multipage TIFF assembly.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@scan-mcp Scan all pages in the ADF and combine into one PDF"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Minimal MCP server for scanner capture (ADF/duplex/page-size), batching, and multipage assembly.
Features
Small, typed MCP server exposing tools for device discovery and scan jobs
zod-validated inputs; the JSON Schemas in
schemas/document the contract and are contract-testedSmart device selection (prefers ADF/duplex, avoids camera backends), robust defaults
Local-first transports: stdio by default to keep everything on-device, optional HTTP for your own network deployments
Note: This package targets Node 22 and Linux SANE backends (scanimage).
Related MCP server: fsext-mcp-server-java
Quick Start (local stdio, default)
Add a server entry to your MCP client configuration:
{
"mcpServers": {
"scan": {
"command": "npx",
"args": [
"-y",
"scan-mcp"
],
"env": {
"INBOX_DIR": "~/Documents/scanned_documents/inbox"
}
}
}
}This invocation runs over stdio for a privacy-first, single-machine setup.
Call
start_scan_jobwithout adevice_idto auto-select a scanner and begin scanning.Artifacts are written under
INBOX_DIRper job:job-*/page_*.tiff,doc_*.tiff,manifest.json,events.jsonl. Whencrop_carrier_sheetsis set and a carrier sheet is detected, apage_*.cropped.tiffderivative is also written per affected page.
Streamable HTTP transport
Prefer to attach the scanner to another machine on your network? scan-mcp also supports the
streamable HTTP transport:
scan-mcp --httpDefault port is
3001; setMCP_HTTP_PORTto override (for exampleMCP_HTTP_PORT=3333 scan-mcp --http).Binds
127.0.0.1by default. SetMCP_HTTP_HOSTto expose it on other interfaces (for exampleMCP_HTTP_HOST=::for all, or a LAN address); the server has no authentication, so only do that on a trusted network.HTTP responses use server-sent events (SSE) for streaming tool output; clients such as Claude Desktop and Windsurf support this transport.
There is currently no authentication; widen the bind address only on a trusted internal network.
Install
Run with npx:
npx scan-mcp(recommended)The CLI runs a quick preflight check for Node 22+ and required scanner/image tools and prints installation hints if anything is missing.
See recommended server config above
Use
npx scan-mcp --httpto launch the streamable HTTP transport when running on another machine.CLI help:
scan-mcp --helpFrom source (for development):
npm installnpm run build
For Cline setup, and other automated agentic installation, see llms-install.md
System Requirements
Linux with SANE utilities:
scanimageTIFF tools:
tiffcp(multipage assembly) and ImageMagickconvert(carrier-sheet detection and cropping); preflight requires both
Environment Variables
SCAN_MOCK(default:false): mock SANE calls and generate fake TIFFs for testing.INBOX_DIR(default:scanned_documents/inbox): base directory for job runs and artifacts.SCANIMAGE_BIN(default:scanimage): override the binary path.TIFFCP_BIN/IM_CONVERT_BIN(defaults:tiffcp/convert): multipage assembly and image analysis tools.SCAN_EXCLUDE_BACKENDS(CSV): backends to exclude (e.g.,v4l).SCAN_PREFER_BACKENDS(CSV): preferred backends (e.g.,epjitsu,epson2).PERSIST_LAST_USED_DEVICE(default:true): persist and lightly prefer last used device.LOG_LEVEL(default:info): pino log level.MCP_HTTP_PORT(default:3001): TCP port for the HTTP transport.MCP_HTTP_HOST(default:127.0.0.1): bind address for the HTTP transport.
API
Tools
list_devices
Discover connected scanners with backend details.
Inputs: none.
get_device_options
Get SANE options for a specific device.
Inputs:
device_id(string): Target device identifier.
start_scan_job
Begin a scanning job; omitting
device_idtriggers auto-selection and default options.Inputs (all optional unless noted):
device_id(string)resolution_dpi(integer, 50–1200)color_mode(Color|Gray|Lineart): color_mode defaults to Lineart (document-first); at >= 600dpi it defaults to Color, since high-dpi capture usually means artwork/photos where 1-bit destroys information. Pass color_mode explicitly to override either default; high dpi is the only signal used.source(Flatbed|ADF|ADF Duplex)duplex(boolean)page_size(Letter|A4|Legal|Custom)custom_size_mm{width,height}doc_break_policy{type(page_count|none),page_count}: split the batch into documents ofpage_countpagesoutput_format(string, defaulttiff)tmp_dir(string)crop_carrier_sheets(boolean, defaultfalse): detect carrier-sheet leading-edge band and write cropped page derivatives; raw pages are kept
get_job_status
Inspect job state and artifact counts.
Inputs:
job_id(string)
cancel_job
Request job cancellation; best effort during scan loops.
Inputs:
job_id(string)
list_jobs
List recent jobs from the inbox directory.
Inputs (optional):
limit(integer, max 100)state(running|completed|cancelled|error|unknown)
get_manifest
Fetch a job's
manifest.json.Inputs:
job_id(string)
get_events
Retrieve a job's
events.jsonllog.Inputs:
job_id(string)
See JSON Schemas in schemas/ for input shapes. Runtime validation is zod (src/server/register.ts); the schemas document the contract and tests assert against them.
How Selection and Defaults Work
Defaults aim for 300dpi, reasonable color mode, and ADF/duplex when available. Full details on scoring and fallbacks live in docs:
Selection and defaults:
docs/SELECTION.md
Project Layout
src/mcp.ts— MCP server entry and tool registrationsrc/services/*— hardware interface and job orchestrationschemas/— JSON Schemas documenting the tool contracts (used by tests)docs/— architecture, conventions, and deep dives
Development
npm run dev(stdio MCP server),npm run dev:http(HTTP transport)make verifyruns lint, typecheck, and testsConventions:
docs/CONVENTIONS.mdand architecture indocs/BLUEPRINT.md
Roadmap
Tracking ideas and future improvements are documented in docs/ROADMAP.md.
Available Tools
8 toolscancel_jobC
Cancel a running scan job
Inputs: job_id (required).
get_device_optionsB
Get SANE options for a specific device (sources, resolutions, modes)
Inputs: device_id (required).
get_eventsB
Fetch job events JSONL by job_id
Inputs: job_id (required).
get_job_statusC
Get status and artifact counts for a job
Inputs: job_id (required).
get_manifestC
Fetch a job manifest JSON by job_id
Inputs: job_id (required).
list_devicesA
List connected scanner devices with basic capabilities
Inputs: no named parameters.
list_jobsC
List recent scan jobs from the inbox directory
Inputs: limit, state.
start_scan_jobC
Start a scan job; auto-selects device and fills defaults when omitted
Inputs: duplex, source, tmp_dir, device_id, +7 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool maps to a distinct resource or action: device listing, device options, job start/cancel, job listing/status, manifest, and events. The job-read tools are adjacent but clearly differentiated by their outputs.
All names use consistent snake_case with clear verb_object patterns such as list_devices, get_job_status, start_scan_job, and cancel_job. There is no mixed casing or vague verb usage.
Eight tools is well-scoped for scanner discovery, job control, and job inspection. Each tool covers a separate operation with no obvious filler.
The surface covers device discovery/options and the core job lifecycle plus manifest/events inspection. However, there is no tool to retrieve or download scanned artifacts, and no explicit option-setting operation, which can leave end-to-end scanning workflows at a dead end.
Maintenance
Related MCP Connectors
Screenshots, PDFs, image editing, QR codes, email validation and more through one hosted MCP server.
Scans remote MCP servers for protocol, security, and TLS issues; exposes scan tools via MCP.
PDF tools + QR over MCP: merge, split, rotate, text, metadata, malicious-content scan.
MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables users to print markdown tasklists, Notion tasks with QR codes, and arbitrary images directly to ESC/POS thermal printers over USB. It includes specialized tools for task processing, automated card generation, and printer diagnostics.71MIT
- AlicenseNot gradedqualityCmaintenanceA full-featured secure MCP server for local file system operations, with built-in image processing, OCR and media tools.Apache 2.0
- AlicenseAqualityCmaintenanceEnables scanning documents via network (eSCL) or USB (WIA/SANE) scanners, returning inline images, OCR text, or saved PDFs for Claude to read.23MIT
- AlicenseNot gradedqualityCmaintenanceA local MCP server that drives PDFium and pypdf to perform comprehensive PDF operations including inspection, assembly, page editing, watermarking, rendering, extraction, form filling, encryption, compression, attachments, bookmarks, and metadata management.MIT