Skip to content

MCP server: expose the PDF and audio tools that already run in Node #58

Closed

Description

@kingrishabdugar

Part of #57.

Goal

A small local MCP server, runnable with npx, that lets AI agents use Fizzdoc's PDF and audio engines on the user's own files.

Tools for the first version

Tool Engine
merge_pdf, split_pdf, extract_pdf_pages, delete_pdf_pages, reorder_pdf_pages, rotate_pdf src/engine/pdf.ts (qpdf)
protect_pdf, unlock_pdf, clean_pdf (remove metadata) src/engine/pdf.ts (qpdf)
trim_audio, split_audio, merge_audio (MP3/M4A, no re-encoding) src/engine/audio.ts

Suggested shape

  • Location: a new mcp/ package in this repo, using the official MCP TypeScript SDK over stdio.
  • Engines: call the engines directly. The Web Worker in src/engine/worker.ts exists only to keep the browser tab responsive, and Node doesn't need it.
  • Inputs and outputs: inputs are absolute file paths. Outputs are written next to the input (or to an output_dir argument) and never overwrite an existing file. Each tool returns the paths it wrote.
  • Errors: reuse the existing error codes (PdfError, AudioError) and turn them into readable messages. Page ranges use the same syntax as the website, e.g. 1-3, 8.
  • Privacy: no network access at all. Please don't add dependencies that phone home.

Done when

  • Running npx fizzdoc-mcp (or similar) starts the server, and every tool above works on the fixtures in tests/fixtures/.
  • Each tool has a Vitest test that checks the output: for example, page count after a split, or duration after a trim.
  • A short mcp/README.md explains how to add it to an MCP client.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions