@thiagocolen/kedin-pdf
v2.0.0
Published
Create multi-page PDFs from images, exposed as an MCP server tool for agents like Claude Code.
Maintainers
Readme
kedin-pdf
Create multi-page PDFs from a list of images. Ships as an MCP (Model
Context Protocol) server so agents like Claude Code and Claude Desktop can
call it as a tool, and as a plain Node.js library you can import directly.
Each image becomes one page, scaled to fit while preserving aspect ratio. Supported page formats (4:5 portrait, sized for image-carousel-style PDFs):
| Format | Description |
| --------- | -------------------------- |
| 640x800 | 4:5 portrait, larger (default) |
| 480x600 | 4:5 portrait, smaller |
Tools exposed over MCP
list_pdf_formats— no arguments. Lists the supported page formats.create_pdf— creates the PDF.{ "imagePaths": ["./images/page1.jpg", "./images/page2.png"], "outputPath": "./output/carousel.pdf", "format": "640x800" }imagePaths(required): array of image file paths, in page order.outputPath(required): where to write the PDF.format(optional):"640x800"or"480x600", defaults to"640x800".
Use it with Claude Code
Claude Code can register any MCP server with the claude mcp add command.
1. Install and register in one step, running the published package via npx:
claude mcp add kedin-pdf -- npx -y -p @thiagocolen/kedin-pdf kedin-pdf-mcpBy default this registers the server at local scope (only this project).
To make it available in every project, add --scope user:
claude mcp add kedin-pdf --scope user -- npx -y -p @thiagocolen/kedin-pdf kedin-pdf-mcp2. Verify it's registered:
claude mcp listYou should see kedin-pdf listed and connected.
3. Use it. In a Claude Code session, just ask in plain language, e.g.:
Turn these three screenshots into a single PDF, one per page, using the 480x600 format.
Claude Code will discover the create_pdf tool and call it with the right
arguments.
4. Remove it later, if needed:
claude mcp remove kedin-pdfUse it with Claude Desktop
Claude Desktop reads its MCP server list from a config file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
1. Open (or create) that file and add an entry under mcpServers:
{
"mcpServers": {
"kedin-pdf": {
"command": "npx",
"args": ["-y", "-p", "@thiagocolen/kedin-pdf", "kedin-pdf-mcp"]
}
}
}If the file already has other servers configured, just add the "kedin-pdf"
key alongside them inside the existing "mcpServers" object.
2. Restart Claude Desktop completely (quit, not just close the window) so it picks up the new config.
3. Confirm it loaded: open a new chat, click the tools/plug icon (or
"Search and tools"), and check that kedin-pdf appears with its two tools.
4. Use it by asking Claude, in plain language, to combine a set of local image files into a PDF. Claude Desktop will prompt you to approve the tool call the first time.
Use it with other MCP clients
Any client that can spawn an MCP server over stdio (Cursor, Windsurf,
Cline, a custom @modelcontextprotocol/sdk client, etc.) can use the same
command:
{
"command": "npx",
"args": ["-y", "-p", "@thiagocolen/kedin-pdf", "kedin-pdf-mcp"]
}Consult your client's documentation for exactly where this config goes —
the command and args above are the same everywhere. If your client only
accepts a single executable string rather than command/args, install
the package globally (npm install -g @thiagocolen/kedin-pdf) and point it
at kedin-pdf-mcp directly.
Use it as a plain Node.js library (no MCP)
npm install @thiagocolen/kedin-pdfimport { createPdfFromImages } from "@thiagocolen/kedin-pdf";
const outputPath = await createPdfFromImages(
["./images/page1.jpg", "./images/page2.png"],
"./output/carousel.pdf",
{ format: "480x600" } // optional, defaults to "640x800"
);
console.log("PDF created at", outputPath);Development
git clone https://github.com/thiagocolen/kedin-pdf.git
cd kedin-pdf
npm installNo build step — it's plain ESM JavaScript, run directly by Node (requires Node.js >= 18.3.0).
Testing locally before publishing
1. Run the MCP server directly and inspect it with the official MCP Inspector:
npx @modelcontextprotocol/inspector node mcp/server.jsThis opens a browser UI where you can call list_pdf_formats and create_pdf
by hand and see the raw responses.
2. Point Claude Code or Claude Desktop at your local checkout instead of the published package, so you're testing your working copy:
claude mcp add kedin-pdf-dev -- node D:\path\to\kedin-pdf\mcp\server.js(For Claude Desktop, use "command": "node", "args": ["D:\\path\\to\\kedin-pdf\\mcp\\server.js"].)
3. Exercise the library function directly, without MCP, from a scratch script:
// test.mjs, run from the repo root with `node test.mjs`
import { createPdfFromImages } from "./src/index.js";
await createPdfFromImages(["./img1.png", "./img2.png"], "./out.pdf", {
format: "640x800",
});4. Simulate a real npm install @thiagocolen/kedin-pdf in another project
without publishing: npm pack produces thiagocolen-kedin-pdf-<version>.tgz
in this directory — install that tarball from the other project with
npm install ../kedin-pdf/thiagocolen-kedin-pdf-<version>.tgz.
License
MIT
