JS

jacksenechal/scan-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

6 stars 5 forks 质量 80 趋势 34MIT

MCP server for scanning (image capture/multipage assembly)

概览

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 - zod-validated inputs; the JSON Schemas in schemas/ document the contract and are contract-tested - Smart 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). Add a server entry to your MCP client configuration: - This invocation runs over stdio for a privacy-first, single-machine setup. - 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. When crop_carrier_sheets is set and a carrier sheet is detected, a page_*.cropped.

README

以下为原文 README 节选,完整内容请查看原文。

scan-mcp

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-tested
  • Smart 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).

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_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. When crop_carrier_sheets is set and a carrier sheet is detected, a page_*.cropped.tiff derivative 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 --http
  • Default port is 3001; set MCP_HTTP_PORT to override (for example MCP_HTTP_PORT=3333 scan-mcp --http).
  • Binds 127.0.0.1 by default. Set MCP_HTTP_HOST to expose it on other interfaces (for example MCP_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 --http to launch the streamable HTTP transport when running on another machine.
  • CLI help: scan-mcp --help
  • From source (for development):
在 GitHub 查看完整 README

安装

npx -y scan-mcp
新手?先看 mcpskill.org 教程 →