{"_id":"@99xio/markdown2pdf-mcp","_rev":"2-a753b824c2de929d477d7c49946dff31","name":"@99xio/markdown2pdf-mcp","dist-tags":{"latest":"2.2.0"},"versions":{"2.1.5":{"name":"@99xio/markdown2pdf-mcp","version":"2.1.5","keywords":["model","context","protocol","markdown","pdf","mcp","server","productivity","tool","cli","npx","converter","puppeteer"],"author":{"name":"2B3 PRODUCTIONS LLC"},"license":"MIT","_id":"@99xio/markdown2pdf-mcp@2.1.5","maintainers":[{"name":"hasithy","email":"hasithy@99x.io"}],"homepage":"https://github.com/2b3pro/markdown2pdf-mcp#readme","bugs":{"url":"https://github.com/2b3pro/markdown2pdf-mcp/issues"},"bin":{"markdown2pdf-mcp":"build/index.js"},"dist":{"shasum":"52e95540cd59abf89ef227561925ddd18b2b58c3","tarball":"https://registry.npmjs.org/@99xio/markdown2pdf-mcp/-/markdown2pdf-mcp-2.1.5.tgz","fileCount":9,"integrity":"sha512-jeUsdSUOBUri2IoKQztzzhKOB35be/f989CYEU2PmjkaDG3HxZot2Q+2QVtZjxK4ls8Bkr8FnNbY3HycGsYT9A==","signatures":[{"sig":"MEYCIQCwMdbw3a4YhJD5wvav6fGJGxrNGdvSY53FtcNlk+b1KwIhAO9+/l3Z6Ggjtjxk3VhZwni35rxc2oA+0RGpSDeFWg/r","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":989913},"main":"build/index.js","type":"module","gitHead":"43640551b265ba56f8a9695dda439dbf7c36ef59","scripts":{"test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","build":"npx tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\" && npm run copy-assets","start":"node build/index.js","copy-assets":"mkdir -p build/css build/puppeteer && cp src/css/pdf.css build/css/ && cp src/puppeteer/render.js build/puppeteer/ && cp src/runnings.js build/","prepublishOnly":"npm run build"},"_npmUser":{"name":"hasithy","email":"hasithy@99x.io"},"overrides":{"puppeteer":{"chrome-version":"131.0.6778.204"}},"repository":{"url":"git+https://github.com/2b3pro/markdown2pdf-mcp.git","type":"git"},"_npmVersion":"10.8.2","description":"MCP server for converting markdown to PDF - run with npx markdown2pdf-mcp to start the server","directories":{"test":"test"},"_nodeVersion":"18.20.8","dependencies":{"tmp":"^0.2.1","puppeteer":"23.11.1","remarkable":"^2.0.1","highlight.js":"^10.7.3","@modelcontextprotocol/sdk":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","@types/tmp":"^0.2.3","typescript":"^4.5.2","@types/jest":"^29.5.14","@types/node":"^16.11.7"},"_npmOperationalInternal":{"tmp":"tmp/markdown2pdf-mcp_2.1.5_1756486666233_0.8460125579532549","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@99xio/markdown2pdf-mcp","version":"2.2.0","description":"MCP server for converting markdown to PDF - run with npx markdown2pdf-mcp to start the server","keywords":["model","context","protocol","markdown","pdf","mcp","server","productivity","tool","cli","npx","converter","puppeteer"],"homepage":"https://github.com/2b3pro/markdown2pdf-mcp#readme","bugs":{"url":"https://github.com/2b3pro/markdown2pdf-mcp/issues"},"repository":{"type":"git","url":"git+https://github.com/2b3pro/markdown2pdf-mcp.git"},"license":"MIT","author":{"name":"2B3 PRODUCTIONS LLC"},"type":"module","main":"build/index.js","bin":{"markdown2pdf-mcp":"build/index.js"},"directories":{"test":"test"},"scripts":{"build":"npx tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\" && npm run copy-assets","copy-assets":"mkdir -p build/css build/puppeteer && cp src/css/pdf.css build/css/ && cp src/puppeteer/render.js build/puppeteer/ && cp src/runnings.js build/","start":"node build/index.js","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js","prepublishOnly":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.4","highlight.js":"^10.7.3","puppeteer":"23.11.1","remarkable":"^2.0.1","tmp":"^0.2.1"},"devDependencies":{"@types/jest":"^29.5.14","@types/node":"^16.11.7","@types/tmp":"^0.2.3","jest":"^29.7.0","ts-jest":"^29.2.5","typescript":"^4.5.2"},"overrides":{"puppeteer":{"chrome-version":"131.0.6778.204"}},"_id":"@99xio/markdown2pdf-mcp@2.2.0","gitHead":"b1849eecc8e3fdf3a1373a2cd9c42b63a6cf2c29","_nodeVersion":"18.20.8","_npmVersion":"10.8.2","dist":{"integrity":"sha512-76hnibdZybScNha//UseUjM5S+i8exoQn8uri67DMcyYnpW8a72DswvVOYzxSctPmI2mAGp7sHZbqflEGHwWUg==","shasum":"b304a562c6c6584c56486776c0d2afe0dfacaee7","tarball":"https://registry.npmjs.org/@99xio/markdown2pdf-mcp/-/markdown2pdf-mcp-2.2.0.tgz","fileCount":10,"unpackedSize":1000287,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDgWWa8aWDv2jiMQBqLvPkeG3UTZSaw8qaJSNs7fKQPygIhAKyW3rorsCu1JxlKHmEMhqfevLWYP7ly+ahnr7M++V9Z"}]},"_npmUser":{"name":"hasithy","email":"hasithy@99x.io"},"maintainers":[{"name":"hasithy","email":"hasithy@99x.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/markdown2pdf-mcp_2.2.0_1757327680676_0.3583102211272897"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-29T16:57:46.154Z","modified":"2025-09-08T10:34:41.074Z","2.1.5":"2025-08-29T16:57:46.456Z","2.2.0":"2025-09-08T10:34:40.892Z"},"bugs":{"url":"https://github.com/2b3pro/markdown2pdf-mcp/issues"},"author":{"name":"2B3 PRODUCTIONS LLC"},"license":"MIT","homepage":"https://github.com/2b3pro/markdown2pdf-mcp#readme","keywords":["model","context","protocol","markdown","pdf","mcp","server","productivity","tool","cli","npx","converter","puppeteer"],"repository":{"type":"git","url":"git+https://github.com/2b3pro/markdown2pdf-mcp.git"},"description":"MCP server for converting markdown to PDF - run with npx markdown2pdf-mcp to start the server","maintainers":[{"name":"hasithy","email":"hasithy@99x.io"}],"readme":"# Markdown2PDF MCP Server (markdown2pdf-mcp)\n\nAn MCP server for converting Markdown documents to PDF files. This server provides a simple and efficient way to generate PDFs from Markdown content with support for syntax highlighting and custom styling. Also allows for watermarking on page 1.\n\nInspired by Alan Shaw's [markdown-pdf](https://github.com/alanshaw/markdown-pdf).\n\n## Quick Start\n\n**Package:** `@99xio/markdown2pdf-mcp@2.1.5`\n\n**Install and run:**\n\n```bash\nnpx @99xio/markdown2pdf-mcp\n```\n\n**MCP Configuration:**\n\n```json\n{\n  \"mcpServers\": {\n    \"markdown2pdf\": {\n      \"command\": \"npx\",\n      \"args\": [\"@99xio/markdown2pdf-mcp\"],\n      \"env\": {\n        \"M2P_OUTPUT_DIR\": \"/path/to/output/directory\"\n      }\n    }\n  }\n}\n```\n\n## Features\n\n- Convert Markdown to PDF with a single command\n- Syntax highlighting for code blocks\n- Custom CSS styling for PDF output\n- Support for standard Markdown formatting\n- Mermaid diagram rendering\n- Modern PDF generation using Chrome's rendering engine\n- Excellent support for modern web features and fonts\n- Reliable resource loading and rendering\n\n## Limitations\n\nThe following markdown elements are not supported:\n\n- LaTeX math equations (e.g., `$x^2$` or `$$\\sum_{i=1}^n x_i$$`)\n- Complex mathematical formulas or scientific notation\n\nStick to these supported markdown elements:\n\n- Headers (all levels)\n- Text formatting (bold, italic, strikethrough)\n- Lists (ordered and unordered)\n- Code blocks with syntax highlighting\n- Tables\n- Blockquotes\n- Links\n- Images (both local files and external URLs)\n- Task lists\n- Mermaid diagrams\n\n### Mermaid Diagrams\n\nTo render a Mermaid diagram, use a `mermaid` code block:\n\n´´´markdown\n\n```mermaid\ngraph TD;\n    A-->B;\n    A-->C;\n    B-->D;\n    C-->D;\n```\n\n´´´\n\nIf there is a syntax error in your diagram, the error message will be rendered in the PDF, helping you to debug it.\n\n## Installation (from source)\n\n```bash\n# Clone the repository\ngit clone https://github.com/2b3pro/markdown2pdf-mcp.git\n\n# Navigate to the project directory\ncd markdown2pdf-mcp\n\n# Install dependencies\nnpm install\n\n# Build the project\nnpm run build\n```\n\n## Installation (via npm)\n\n```bash\n# Install globally\nnpm install -g @99xio/markdown2pdf-mcp\n\n# Or use with npx (no installation needed)\nnpx @99xio/markdown2pdf-mcp\n```\n\n## Usage\n\n### Starting the Server\n\n```bash\n# Using npx (recommended)\nnpx @99xio/markdown2pdf-mcp\n\n# Or if installed globally\n@99xio/markdown2pdf-mcp\n\n# Or from source\nnpm start\n```\n\n### Using the MCP Tools\n\nThe server provides two tools for converting markdown to PDF:\n\n#### 1. `create_pdf_from_markdown`\n\nConvert markdown content directly to PDF with the following parameters:\n\n```typescript\n{\n  // Required parameters\n  markdown: string;    // Markdown content to convert\n\n  // Optional parameters with defaults\n  outputFilename?: string;  // Filename for the PDF (e.g., \"output.pdf\")\n  paperFormat?: string;     // 'letter' (default), 'a4', 'a3', 'a5', 'legal', 'tabloid'\n  paperOrientation?: string; // 'portrait' (default), 'landscape'\n  paperBorder?: string;     // '2cm' (default), accepts decimal values with CSS units (e.g., '1.5cm', '2.5mm', '0.5in', '10.5px')\n  watermark?: string;       // Optional watermark text (max 15 characters, uppercase)\n}\n```\n\n#### 2. `create_pdf_from_markdown_file`\n\nConvert a markdown file to PDF by providing the file path with the following parameters:\n\n```typescript\n{\n  // Required parameters\n  filePath: string;    // Path to the markdown file to convert\n\n  // Optional parameters with defaults\n  outputFilename?: string;  // Filename for the PDF (e.g., \"output.pdf\")\n  paperFormat?: string;     // 'letter' (default), 'a4', 'a3', 'a5', 'legal', 'tabloid'\n  paperOrientation?: string; // 'portrait' (default), 'landscape'\n  paperBorder?: string;     // '2cm' (default), accepts decimal values with CSS units (e.g., '1.5cm', '2.5mm', '0.5in', '10.5px')\n  watermark?: string;       // Optional watermark text (max 15 characters, uppercase)\n}\n```\n\n### Examples\n\nExample with `create_pdf_from_markdown` (direct content):\n\n```typescript\nawait use_mcp_tool({\n  server_name: \"markdown2pdf\",\n  tool_name: \"create_pdf_from_markdown\",\n  arguments: {\n    markdown: \"# Hello World\\n\\nThis is a test document.\",\n    outputFilename: \"output.pdf\",\n    paperFormat: \"a4\",\n    paperOrientation: \"landscape\",\n    paperBorder: \"1.5cm\",\n    watermark: \"DRAFT\",\n  },\n});\n```\n\nExample with `create_pdf_from_markdown_file` (from file):\n\n```typescript\nawait use_mcp_tool({\n  server_name: \"markdown2pdf\",\n  tool_name: \"create_pdf_from_markdown_file\",\n  arguments: {\n    filePath: \"/path/to/your/document.md\",\n    outputFilename: \"output.pdf\",\n    paperFormat: \"a4\",\n    paperOrientation: \"landscape\",\n    paperBorder: \"1.5cm\",\n    watermark: \"DRAFT\",\n  },\n});\n```\n\nExample minimal usage (direct content):\n\n```typescript\nawait use_mcp_tool({\n  server_name: \"markdown2pdf\",\n  tool_name: \"create_pdf_from_markdown\",\n  arguments: {\n    markdown: \"# Hello World\\n\\nThis is a test document.\",\n    outputFilename: \"output.pdf\",\n  },\n});\n```\n\nExample minimal usage (from file):\n\n```typescript\nawait use_mcp_tool({\n  server_name: \"markdown2pdf\",\n  tool_name: \"create_pdf_from_markdown_file\",\n  arguments: {\n    filePath: \"/path/to/your/document.md\",\n  },\n});\n```\n\n## Configuration\n\n### Output Directory\n\nYou can configure the output directory in your MCP settings file for apps that use MCP such as Cline or Claude. If not configured, it will save files to $HOME:\n\n```json\n{\n  \"mcpServers\": {\n    \"markdown2pdf\": {\n      \"command\": \"npx\",\n      \"args\": [\"@99xio/markdown2pdf-mcp@2.1.5\"],\n      \"env\": {\n        \"M2P_OUTPUT_DIR\": \"/path/to/output/directory\"\n      }\n    }\n  }\n}\n```\n\n**Alternative configurations:**\n\nUsing latest version:\n\n```json\n{\n  \"mcpServers\": {\n    \"markdown2pdf\": {\n      \"command\": \"npx\",\n      \"args\": [\"@99xio/markdown2pdf-mcp\"],\n      \"env\": {\n        \"M2P_OUTPUT_DIR\": \"/path/to/output/directory\"\n      }\n    }\n  }\n}\n```\n\nUsing global installation:\n\n```json\n{\n  \"mcpServers\": {\n    \"markdown2pdf\": {\n      \"command\": \"@99xio/markdown2pdf-mcp\",\n      \"env\": {\n        \"M2P_OUTPUT_DIR\": \"/path/to/output/directory\"\n      }\n    }\n  }\n}\n```\n\nUsing local build (from source):\n\n```json\n{\n  \"mcpServers\": {\n    \"markdown2pdf\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/markdown2pdf-mcp/build/index.js\"],\n      \"env\": {\n        \"M2P_OUTPUT_DIR\": \"/path/to/output/directory\"\n      }\n    }\n  }\n}\n```\n\nThe tool automatically handles file name conflicts by appending incremental numbers (e.g., output.pdf, output-1.pdf, output-2.pdf).\n\n## Dependencies\n\n- [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/sdk) - MCP SDK for server implementation\n- [remarkable](https://github.com/jonschlinkert/remarkable) - Markdown parser\n- [highlight.js](https://github.com/highlightjs/highlight.js) - Syntax highlighting\n- [puppeteer](https://github.com/puppeteer/puppeteer) - Modern PDF generation using [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) (v131.0.6778.204)\n\n## Chrome Version\n\nThis package uses Chrome v131.0.6778.204 for consistent PDF generation across all installations. This version is automatically installed when you run `npm install`.\n\n- [tmp](https://github.com/raszi/node-tmp) - Temporary file handling\n\n## Development\n\n```bash\n# Build the project\nnpm run build\n\n# Start the server\nnpm start\n```\n\n## Publishing\n\nThis package uses automated publishing via GitHub Actions. To publish a new version:\n\n1. **Update the version** in `package.json`:\n\n   ```bash\n   npm version patch  # for bug fixes\n   npm version minor  # for new features\n   npm version major  # for breaking changes\n   ```\n\n2. **Create and push a version tag**:\n\n   ```bash\n   git push origin main\n   git push origin --tags\n   ```\n\n3. **The GitHub Action will automatically**:\n   - Build the project\n   - Run tests\n   - Verify build output\n   - Publish to npm\n   - Generate a release summary\n\n### Manual Publishing\n\nIf you need to publish manually:\n\n```bash\n# Make sure you're logged in to npm\nnpm login\n\n# Build and publish\nnpm run build\nnpm publish\n```\n\n### NPM Token Setup\n\nFor automated publishing, you need to set up an `NPM_TOKEN` secret in your GitHub repository:\n\n1. Go to [npmjs.com](https://www.npmjs.com) and create an access token\n2. In your GitHub repository, go to Settings → Secrets and variables → Actions\n3. Add a new secret named `NPM_TOKEN` with your npm access token\n\n## License\n\nMIT\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n","readmeFilename":"README.md"}