This guide walks autonomous agents (e.g., Cline, Windsurf, Claude Desktop) through installing and configuring the scan-mcp server. The recommended invocation is npx scan-mcp, which always runs the latest published version without a local clone.
Make sure the host machine already provides the runtime and native tooling that scan-mcp expects. The server performs these checks on startup, but it is best to confirm them up front:
- Node.js 22 or newer (includes
npx). Verify withnode -v. - SANE scanner utilities –
scanimageis required andscanadfis recommended for automatic document feeders. Validate withscanimage --versionandscanimage -L. - TIFF assembly tool –
tiffcp(preferred, provided bylibtiff-tools) or ImageMagickconvert. Test withtiffcp -h. - Writable inbox directory where scan jobs can deposit artifacts (default:
~/Documents/scanned_documents/inbox). Create it beforehand withmkdir -p ~/Documents/scanned_documents/inbox.
Typical Debian/Ubuntu installation:
sudo apt-get update
sudo apt-get install -y sane-utils libtiff-tools imagemagickIf no physical scanner is available, you can still exercise the server by setting SCAN_MOCK=true, which generates fake TIFFs instead of calling SANE.
Add a server entry to your MCP client's configuration file (for example ~/.codeium/windsurf/mcp_config.json, ~/.config/cline/mcp_servers.json, or the equivalent location your client documents).
Use this exact mcpServers block:
{
"mcpServers": {
"scan": {
"command": "npx",
"args": [
"-y",
"scan-mcp"
],
"env": {
"INBOX_DIR": "~/Documents/scanned_documents/inbox"
}
}
}
}Key details:
"-y"tellsnpxto run without prompting for confirmation.- Update
INBOX_DIRif you prefer a different destination for job artifacts. - Set
SCAN_MOCK=truein theenvblock when running on a machine without SANE devices. - Additional overrides such as
SCANIMAGE_BIN,TIFFCP_BIN, orSCAN_PREFER_BACKENDScan also be supplied inside the sameenvobject when needed.
- Ensure the inbox directory exists and is writable.
- Run the server once in mock mode to confirm dependencies:
The command should print usage information and exit successfully.
SCAN_MOCK=true npx -y scan-mcp --help
- Start your MCP client; it should list a
scanserver endpoint. Calllist_devicesto see detected scanners or mock devices.
- Missing binaries: Install or adjust the
SCANIMAGE_BIN,SCANADF_BIN,TIFFCP_BIN, orIM_CONVERT_BINenvironment variables to point at the correct paths. - Permission errors: Ensure the configured
INBOX_DIRexists and the MCP client user can read/write inside it. - No scanners found: Confirm
scanimage -Lreturns at least one device. If not, install or troubleshoot SANE backends, or enableSCAN_MOCK=truefor testing. - Large documents: Provide
TIFFCP_BIN(libtiff) when possible—ImageMagickconvertis a slower fallback.
- Full project README:
https://github.com/jacksenechal/scan-mcp#readme - JSON Schemas for tool inputs/outputs:
schemas/ - Environment variable reference: run
npx -y scan-mcp --help
With these steps complete, scan-mcp will be available to any MCP-compatible client via npx scan-mcp.