Lathe

io.github.seayniclabs由 GitHub 帳號 seayniclabs 發布v0.4.1更新於 Nov 3, 2026

Local file and media tools: images, PDF, audio, video, OCR, batch and metadata. Runs locally.

發布方自己的服務:Lathe

概覽

AI 產生的概覽

Lathe 為 AI 助理提供本機工具,可在指定工作資料夾內檢視與轉換圖片、PDF、音訊和影片,並進行 OCR 與批次處理。

可以做什麼
  • 檢視圖片、PDF、音訊與影片資訊:尺寸、EXIF、頁數、長度、編碼,以及伺服器與模組狀態
  • 編輯圖片:縮放、轉檔、裁切、產生縮圖,以及壓縮並移除中繼資料以供網頁使用
  • 處理 PDF:擷取文字(掃描頁可用 OCR)、合併、拆分、壓縮,以及依 DPI 轉成 PNG 或 JPEG
  • 處理音訊與影片:轉換音訊格式、擷取影片畫面、裁切片段、製作短動畫 GIF
  • 以 OCR 從圖片擷取文字,並可選擇清除 GPS、相機與作者中繼資料
  • 對符合萬用字元的所有檔案執行同一操作,先試跑再正式執行
適用情境
適合檔案保存在本機、希望助理直接檢視、轉換、壓縮、拆分或擷取內容而不上傳的情況。可用於照片與文件整理、PDF 文字擷取、影片截圖與裁切,以及可重複的批次轉檔。
執行需求
以本機 stdio 程序執行 PyPI 套件 lathe-mcp,需要 Python 3.11 以上與 uv(或 pip)。選用擴充 pdf 與 ocr 提供 PDF 與 OCR 支援;媒體、OCR 與 PDF 轉圖分別需要 ffmpeg/ffprobe、tesseract 與 ghostscript。需設定 LATHE_WORKING_DIR 指定可讀寫的資料夾;batch 與 privacy 模組預設關閉。
安裝前請注意
寫入類工具會在工作資料夾產生新檔案,只有呼叫時傳入 overwrite=true 才會覆寫既有檔案。batch_process 通常在處理兩個以上檔案時請使用者核准,但設定 LATHE_BATCH_PREAPPROVED=true 會取消該提示。image_optimize 預設會移除中繼資料。選用的 HTTP 傳輸僅監聽本機,對外開放前須自行加上驗證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Lathe,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Lathe

Made by Seaynic Labs. Need tools like this built around your own systems? We do that.

Lathe is an MCP bundle for anyone who handles files and media. It gives your AI assistant local tools for images, PDFs, audio and video, and OCR, plus batch runs and metadata removal. The files stay on your machine.

It is a bundle: one server made of modules, each switched on or off. Modules that arrive in an update and are off by default stay off until you turn them on.

Security card
NetworkNone. Lathe makes no network connections, and ffmpeg and ffprobe are restricted to local files (-protocol_whitelist file,pipe). --transport http listens on 127.0.0.1 only when you start it that way.
FilesReads and writes files only inside the working folder (LATHE_WORKING_DIR). Reads its optional config file (/.config/lathe/config.toml). Writes one local approval log (/.local/state/lathe/approvals.jsonl).
SecretsNo keys, accounts or passwords. Nothing to store, and nothing that leaves the machine.
Read-only tools8: image_info, pdf_info, pdf_extract_text, audio_info, video_info, ocr_image, health, lathe_modules
Writes new filesaudio_convert, batch_process, image_convert, image_crop, image_optimize, image_resize, image_thumbnail, pdf_compress, pdf_merge, pdf_split, pdf_to_images, scrub_metadata, video_thumbnail, video_to_gif, video_trim: each call writes new files in the working folder and never overwrites an existing one unless the call passes overwrite=true. batch_process asks the person once per run of two or more files, and nothing else asks.
Startup costabout 7,600 tokens for a default install (21 tools, 4 skill prompts)
ChangesTool descriptions are locked by hash (tool-manifest.lock.json); CI fails if they change silently.

Modules

ModuleWhat it doesOn by defaultNeeds
imagesInfo, resize, convert, optimize, crop, thumbnailyesPillow (always installed)
pdfInfo, text (OCR for scanned pages), merge, render pages, split, compressyespdf extra; ghostscript for rendering
mediaAudio and video info, audio convert, a frame, trim, GIFyesffmpeg and ffprobe
ocrText from an imageyesocr extra; tesseract
batchOne operation over every file matching a glob, dry run firstnoper operation (see above)
privacyInspect and remove GPS, camera and author metadatanopdf extra, for PDFs

Lathe is free and MIT licensed. It has 21 tools by default and 23 with batch and privacy on.

Skills

Skills explain how to do a job well. Your AI assistant reads them as Agent Skills, or as MCP prompts in any MCP app.

SkillUse it for
getting-startedSetup, the install command for each missing piece, --doctor, and the approval rules
pdfTurning a Markdown file into a PDF with Chrome or Chromium
pdf-formsMaking a PDF with fillable text boxes and checkboxes
web-image-prepRemoving location data and shrinking a folder of photos for a website

First five minutes

  1. Install: uvx --from "lathe-mcp[pdf,ocr]" lathe --version prints the version. Needs Python 3.11 or newer and uv.
  2. Add Lathe to your client (see Add it to your MCP client). Set LATHE_WORKING_DIR to the folder with your files.
  3. Run lathe --doctor (uvx --from "lathe-mcp[pdf,ocr]" lathe --doctor). It prints ok or FIX for each piece and the command that fixes it.
  4. Ask your assistant to call lathe_modules. It lists every module, what is on, and what is missing.

Try these

Paste these into your assistant, after setting LATHE_WORKING_DIR:

  1. Call lathe_modules and tell me which pieces are missing.
  2. Show me the metadata in photos/trip.jpg, then make a copy without it as photos/trip-clean.jpg. (needs LATHE_PRIVACY_ENABLED=true)
  3. Dry-run image_optimize on everything in photos/ into web/, then run it. (needs LATHE_BATCH_ENABLED=true)
  4. Split report.pdf into parts of 5 pages in parts/.
  5. Cut the first 10 seconds of clip.mp4 into clip-10s.mp4, then make a 5-second GIF from it.

Install

Lathe needs Python 3.11 or newer. With uv you don't install anything ahead of time. Choose the extras for the modules you use:

bash
uvx --from lathe-mcp lathe --version                  # images, media and batchuvx --from "lathe-mcp[pdf,ocr]" lathe --version       # with PDF and OCR

Pinned to this release, for a repeatable setup:

bash
uvx --from "lathe-mcp[pdf,ocr]==0.4.1" lathe --version

Or with pip:

bash
pip install "lathe-mcp[pdf,ocr]"

Extras: pdf (pypdf), ocr (pytesseract), full (both). The images module needs nothing extra.

Claude Code plugin

The repository is also a Claude Code plugin. Its .mcp.json pins lathe-mcp[pdf,ocr]==0.4.1, and it ships the skills in skills/. The plugin is one way to install; the MCP config below works in any client.

System programs

Lathe starts without these. lathe --doctor and the lathe_modules tool list what is missing and the command for your platform.

ProgramUsed bymacOSDebian / Ubuntu
ffmpeg (includes ffprobe)media, batch (audio)brew install ffmpegsudo apt install ffmpeg
tesseractocr, and pdf_extract_text on scanned pagesbrew install tesseractsudo apt install tesseract-ocr
ghostscriptpdf_to_images, batch (PDF)brew install ghostscriptsudo apt install ghostscript

Settings

Set these as environment variables in your MCP client's config, or in a config file. Lathe starts without any of them.

VariableWhat it is
LATHE_WORKING_DIRThe folder Lathe reads from and writes to. Default: the folder the server starts in.
LATHE_MAX_FILE_MBLargest input file, in MB. Default 500.
LATHE_OCR_LANGTesseract language code(s), e.g. eng or eng+fra. Default eng.
LATHE_<MODULE>_ENABLEDtrue or false. Default true for images, pdf, media and ocr; false for batch and privacy.
LATHE_BATCH_PREAPPROVEDtrue lets a batch run of two or more files go ahead without the approval prompt. Default false. Set it only if your client cannot show approval prompts.
LATHE_APPROVAL_LOGWhere the approval log is written. Default ~/.local/state/lathe/approvals.jsonl.

Config file (optional). Lathe also reads ~/.config/lathe/config.toml, or the file named by LATHE_CONFIG. Environment variables win over the file.

toml
[core]working_dir = "/Users/you/Pictures"
[ocr]lang = "eng"
[batch]enabled = true
[privacy]enabled = true

Add it to your MCP client

Every client below runs Lathe as a local process over stdio. Put the env values only where you need them.

Claude Desktop: claude_desktop_config.json (Settings, Developer, Edit Config)

json
{  "mcpServers": {    "lathe": {      "command": "uvx",      "args": ["--from", "lathe-mcp[pdf,ocr]", "lathe"],      "env": { "LATHE_WORKING_DIR": "/path/to/your/files", "LATHE_BATCH_ENABLED": "true", "LATHE_PRIVACY_ENABLED": "true" }    }  }}

Claude Code

bash
claude mcp add lathe -e LATHE_WORKING_DIR=/path/to/your/files -- uvx --from "lathe-mcp[pdf,ocr]" lathe

Cursor: ~/.cursor/mcp.json, or .cursor/mcp.json in a project

json
{  "mcpServers": {    "lathe": {      "command": "uvx",      "args": ["--from", "lathe-mcp[pdf,ocr]", "lathe"],      "env": { "LATHE_WORKING_DIR": "/path/to/your/files" }    }  }}

VS Code: .vscode/mcp.json (note "servers", not "mcpServers")

json
{  "servers": {    "lathe": {      "type": "stdio",      "command": "uvx",      "args": ["--from", "lathe-mcp[pdf,ocr]", "lathe"],      "env": { "LATHE_WORKING_DIR": "/path/to/your/files" }    }  }}

Sonique, Hermes, OpenClaw, and other clients: any client that launches a stdio MCP server. Command uvx, arguments ["--from", "lathe-mcp[pdf,ocr]", "lathe"], plus the env values above.

Over HTTP. For clients that connect to a URL instead of starting a process:

bash
lathe --transport http --port 8765

It serves streamable HTTP at http://127.0.0.1:8765/mcp. It listens only on your own machine by default. Put authentication in front of it before exposing it anywhere else.

Tools

ToolModuleWhat it doesAsks first
healthcoreServer version, working folder, and whether each external program is installedno
lathe_modulescoreWhich modules are on, what is missing (with the install command), skills, and what each tool needsno
image_infoimagesWidth, height, format, mode, size, and EXIF tagsno
image_resizeimagesResize by width, height or percentage, keeping the aspect rationo
image_convertimagesConvert to png, jpeg, webp, avif or bmpno
image_optimizeimagesShrink for web delivery; metadata stripped unless strip_metadata=falseno
image_cropimagesCrop a rectangleno
image_thumbnailimagesFit inside a squareno
pdf_infopdfPage count, size, encryption, title, authorno
pdf_extract_textpdfText of the pages you name, or of the whole file; OCR for pages without a text layer; long text in partsno
pdf_mergepdfMerge PDFs in orderno
pdf_to_imagespdfRender pages to PNG or JPEG at a chosen DPIno
pdf_splitpdfSplit into parts of N pagesno
pdf_compresspdfLossless smaller copy: content streams and duplicate objectsno
audio_infomediaDuration, format, bitrate, sample rate, channelsno
audio_convertmediaConvert to mp3, wav, flac, aac or oggno
video_infomediaDuration, resolution, codec, frame rate, audio tracksno
video_thumbnailmediaSave one frame at a time in secondsno
video_trimmediaCut a section (stream copy; cuts land on keyframes)no
video_to_gifmediaAnimated GIF from up to 30 seconds of videono
ocr_imageocrText from an image; long text in partsno
batch_processbatchOne operation over every matching file; dry run by defaultyes, for runs of 2+ files
scrub_metadataprivacyInspect (default), or write a copy without GPS, camera or author metadatano

Every tool returns structured data with a published schema. Long text comes in parts: pass next_offset back as offset. Errors always read lathe.<module>.<code>: <message> Fix: <hint>.

Approval

Only batch_process asks, and only for a run of two or more files. The client shows the person one plan: the operation, the output folder, whether existing outputs may be replaced, the file count and up to ten file names. The person approves or declines once for the whole run. The model cannot answer for the person. A client that cannot show prompts gets approval_unavailable, with the setting that fixes it (LATHE_BATCH_PREAPPROVED=true).

Every other writing tool writes one new file per call without asking. None of them overwrites an existing file unless the call passes overwrite=true.

Files and safety

  • Working folder. Relative paths resolve against LATHE_WORKING_DIR. Inputs and outputs must stay inside it. Symlinks that point outside are refused.
  • Nothing is overwritten by accident. An output that already exists is refused unless the call passes overwrite=true. An output can never be the input file.
  • Batch runs never touch their inputs. batch_process refuses an output folder that is the input folder, and it skips any output that already exists.
  • Writes are atomic. A file is written under a temporary name and moved into place, so a failure never leaves a half-written file.
  • Local only. Lathe makes no network connections, and ffmpeg and ffprobe only open local files.
  • Size limit. Inputs over LATHE_MAX_FILE_MB (500 MB by default) are refused.

Security

See SECURITY.md for how to report a problem and what Lathe does not do. The approval log at ~/.local/state/lathe/approvals.jsonl records each request, approval, decline and refusal. It never records file contents.

tool-manifest.lock.json records a hash of every tool description, prompt and the server instructions. python3 scripts/tool_lock.py --check shows whether anything has changed since the release.

Develop

bash
uv venv -p 3.11 .venv && uv pip install -p .venv/bin/python -e '.[dev]'.venv/bin/pytest -qpython3 scripts/check_skills.py.venv/bin/python scripts/tool_lock.py --check.venv/bin/python scripts/security_card.py --check

The tests generate their own fixtures. Tests that need ffmpeg, tesseract or ghostscript are skipped when the program is missing.

License

MIT. Made by Seaynic Labs. Third-party libraries and programs are listed in CREDITS.md.


Built by Seaynic Labs. We build tools like this around a business's own systems: local-first, with a person approving every change. See custom integrations.

來源:README.md,提交 faa9114

工具

21

image_info

Image metadata: width, height, format, mode, file size, and EXIF tags (capped).

輸入參數input_path必填

image_resize

Resize an image by width, height, or percentage. Keeps the aspect ratio when only one dimension is given. Output format comes from the output extension.

輸入參數widthheightoverwriteinput_path必填percentageoutput_path必填

image_convert

Convert an image to png, jpeg, webp, avif or bmp. The output extension must match.

輸入參數format必填overwriteinput_path必填output_path必填

image_optimize

Shrink an image for web delivery. Metadata is stripped unless strip_metadata=false.

輸入參數qualityoverwriteinput_path必填output_path必填strip_metadata

image_crop

Crop a rectangle from an image. x and y are pixels from the top-left corner.

輸入參數x必填y必填width必填height必填overwriteinput_path必填output_path必填

image_thumbnail

Make a thumbnail that fits inside a square of the given size, keeping the aspect ratio.

輸入參數sizeoverwriteinput_path必填output_path必填

pdf_info

PDF metadata: page count, file size, encryption, title, author and creator.

輸入參數input_path必填

pdf_extract_text

Extract text from a PDF, or from some pages ("2-5"). Pages with no text layer are read with OCR when it is installed. Long text comes in parts: pass next_offset as offset to continue.

輸入參數pagesoffsetmax_charsinput_path必填ocr_fallback

pdf_merge

Merge several PDFs, in the order given, into one new PDF.

輸入參數overwriteinput_paths必填output_path必填

pdf_to_images

Render PDF pages to PNG or JPEG files in a folder, at a chosen DPI. Needs ghostscript.

輸入參數dpipagesformatoverwriteinput_path必填output_dir必填

pdf_split

Split a PDF into parts of N pages each. Writes new PDFs into a folder and never overwrites one unless overwrite=true.

輸入參數overwriteinput_path必填output_dir必填pages_per_file

pdf_compress

Write a smaller copy of a PDF. Lossless: it recompresses content streams and removes duplicate objects; images are not re-encoded. Writes one new file; never overwrites unless overwrite=true.

輸入參數overwriteinput_path必填output_path必填

audio_info

Audio metadata: duration, format, bitrate, sample rate, channels and codec.

輸入參數input_path必填

audio_convert

Convert audio to mp3, wav, flac, aac or ogg. A video input keeps only its audio. The output extension must match the format.

輸入參數format必填overwriteinput_path必填output_path必填

video_info

Video metadata: duration, resolution, codec, frame rate, bitrate and audio tracks.

輸入參數input_path必填

video_thumbnail

Save one frame of a video as a PNG or JPEG, at a time in seconds.

輸入參數overwritetimestampinput_path必填output_path必填

video_trim

Cut a section out of a video into a new file (stream copy, so it is fast and lossless; cuts land on keyframes). Never overwrites unless overwrite=true.

輸入參數endstartoverwriteinput_path必填output_path必填

video_to_gif

Make an animated GIF from part of a video (up to 30 seconds, palette-optimized). Writes one new file; never overwrites unless overwrite=true.

輸入參數fpsstartwidthdurationoverwriteinput_path必填output_path必填

ocr_image

Extract the text from an image with OCR. Long text comes in parts: pass next_offset as offset to continue. lang overrides LATHE_OCR_LANG.

輸入參數langoffsetmax_charsinput_path必填

health

Server status, version, working directory, and whether each external piece is installed.

無需輸入參數。

lathe_modules

Which modules are on, which pieces are missing (with the install command), and what each tool does. Pass a module name for its settings too.

輸入參數module

版本歷史

1
  1. v0.4.1最新Oct 29, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Lathe 整合