Sponsored by Deepsite.site

scan-mcp

Created By
jacksenechal3 months ago
scan-mcp offers a robust and minimal MCP server designed for efficient document scanning on Linux systems. It simplifies image capture from scanners, supporting advanced features like Automatic Document Feeder (ADF), duplex scanning, and specific page sizing. The tool intelligently discovers and selects devices, handles scan jobs with JSON Schema-validated inputs, and assembles multipage documents, making it ideal for automating and standardizing document digitization workflows.
Content

Minimal MCP server for scanner capture (ADF/duplex/page-size), batching, and multipage assembly.

  • Small, typed MCP server exposing tools for device discovery and scan jobs
  • JSON Schema–validated inputs with deterministic, typed outputs
  • Smart device selection (prefers ADF/duplex, avoids camera backends), robust defaults

Note: This package targets Node 22 and Linux SANE backends (scanimage).

Quick Start (MCP client config)

Add a server entry to your MCP client configuration:

{
  "mcpServers": {
    "scan": {
      "command": "npx",
      "args": [
        "-y",
        "scan-mcp"
      ],
      "env": {
        "INBOX_DIR": "~/Documents/scanned_documents/inbox"
      }
    }
  }
}
  • Call start_scan_job without a device_id to auto-select a scanner and begin scanning.
  • Artifacts are written under INBOX_DIR per job: job-*/page_*.tiff, doc_*.tiff, manifest.json, events.jsonl.

Install

  • Run with npx: npx scan-mcp
    • The CLI runs a quick preflight check for Node 22+ and required scanner/image tools and prints installation hints if anything is missing.
  • CLI help: scan-mcp --help
  • Install npm: npm i -g scan-mcp then scan-mcp
  • From source (development):
    • npm install
    • npm run build
    • MCP clients can run via node dist/mcp.js or npx tsx src/mcp.ts

System Requirements

  • Linux with SANE utilities: scanimage (and optionally scanadf)
  • TIFF tools: tiffcp (preferred) or ImageMagick convert

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 / SCANADF_BIN (defaults: scanimage / scanadf): override binary paths.
  • TIFFCP_BIN / IM_CONVERT_BIN (defaults: tiffcp / convert): multipage assembly 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.

Tools

  • list_devices: Discover connected scanners with backend details.
  • get_device_options: Probe options for a given device_id.
  • start_scan_job: Start a job (auto-selects device if omitted). Creates per-page TIFFs, assembles documents.
  • get_job_status: Inspect job state and artifact paths.
  • cancel_job: Request job cancellation (best-effort during scan loops).

See JSON Schemas in schemas/ for shapes of inputs/outputs. Tests assert against these contracts.

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 registration
  • src/services/* — hardware interface and job orchestration
  • schemas/ — JSON Schemas used for validation and tests
  • docs/ — architecture, conventions, and deep dives

Development

  • npm run dev (stdio MCP server), npm run dev:http (experimental HTTP)
  • make verify runs lint, typecheck, and tests
  • Conventions: docs/CONVENTIONS.md and architecture in docs/BLUEPRINT.md

Roadmap

Tracking ideas and future improvements are documented in docs/ROADMAP.md.


lobehub badge

Server Config

{
  "mcpServers": {
    "scan": {
      "command": "npx",
      "args": [
        "-y",
        "scan-mcp"
      ],
      "env": {
        "INBOX_DIR": "~/Documents/scanned_documents/inbox"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Amap Maps高德地图官方 MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
DeepChatYour AI Partner on Desktop
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Serper MCP ServerA Serper MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor