Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions scripts/build-mcpb.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ filesToCopy.forEach(file => {
}
});

// Step 6: Create package.json in bundle with production dependencies
// Step 6: Create package.json in bundle with production dependencies from main package.json
// This ensures MCPB bundle always has the same dependencies as the npm package
const bundlePackageJson = {
name: manifest.name,
version: manifest.version,
Expand All @@ -115,27 +116,7 @@ const bundlePackageJson = {
author: manifest.author,
license: manifest.license,
repository: manifest.repository,
dependencies: {
"@modelcontextprotocol/sdk": "^1.9.0",
"@opendocsg/pdf2md": "^0.2.2",
"@vscode/ripgrep": "^1.15.9",
"cross-fetch": "^4.1.0",
"exceljs": "^4.4.0",
"fastest-levenshtein": "^1.0.16",
"file-type": "^21.1.1",
"glob": "^10.3.10",
"isbinaryfile": "^5.0.4",
"md-to-pdf": "^5.2.5",
"pdf-lib": "^1.17.1",
"remark": "^15.0.1",
"remark-gfm": "^4.0.1",
"remark-parse": "^11.0.0",
"sharp": "^0.34.5",
"unified": "^11.0.5",
"unpdf": "^1.4.0",
"zod": "^3.24.1",
"zod-to-json-schema": "^3.23.5"
}
dependencies: packageJson.dependencies // Use dependencies directly from package.json
};

fs.writeFileSync(
Expand Down
17 changes: 15 additions & 2 deletions src/data/onboarding-prompts.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
{
"version": "2.0.0",
"description": "Desktop Commander onboarding prompts - V2 simplified (5 prompts only)",
"version": "2.1.0",
"description": "Desktop Commander prompts - onboarding and best practices",
"prompts": [
{
"id": "bp_pdf_styling",
"title": "PDF Styling Best Practices",
"description": "Best practices for creating well-styled PDFs with write_pdf tool",
"prompt": "# PDF Styling Best Practices for write_pdf\n\n## PDF Options (Landscape, Page Size)\nUse `options` parameter with `pdf_options` key:\n```\noptions: {\"pdf_options\": {\"format\": \"A4\", \"landscape\": true, \"margin\": {\"top\": \"0\", \"left\": \"0\", \"right\": \"0\", \"bottom\": \"0\"}, \"printBackground\": true}}\n```\nSupported options:\n- `format`: 'A4', 'Letter', 'Legal', etc.\n- `landscape`: true/false\n- `margin`: {top, right, bottom, left} - use \"0\" for edge-to-edge\n- `printBackground`: true (required for background colors!)\n\n## Full-Page Slides (Multi-Page Decks)\nFor slide decks with full-page backgrounds, use `height: 100vh` with `box-sizing: border-box`:\n```html\n<div style=\"background: #6366f1; color: white; padding: 60px; height: 100vh; box-sizing: border-box;\">\n <h2>Slide Title</h2>\n <p>Content here</p>\n</div>\n<div style=\"page-break-before: always;\"></div>\n<div style=\"background: #10b981; color: white; padding: 60px; height: 100vh; box-sizing: border-box;\">\n <h2>Next Slide</h2>\n</div>\n```\nThis fills the entire page with no white gaps at bottom.\n\n## Layout - Use Tables, Not Flexbox\nCSS flexbox often breaks in PDF rendering. Use HTML tables for multi-column layouts:\n```html\n<table style=\"width: 100%; border-collapse: separate; border-spacing: 12px 0;\">\n<tr>\n<td style=\"width: 50%; vertical-align: top;\">Column 1</td>\n<td style=\"width: 50%; vertical-align: top;\">Column 2</td>\n</tr>\n</table>\n```\n\n## Page Breaks\n- Use explicit: `<div style=\"page-break-before: always;\"></div>`\n- Place between slide divs, not inside them\n- Content splits unpredictably without explicit breaks\n\n## Rounded Corners on Headers\nNegative margins break border-radius. Use a container:\n```html\n<div style=\"padding: 10px;\">\n <div style=\"border-radius: 20px; background: #0f172a; padding: 40px;\">\n Header content\n </div>\n</div>\n```\n\n## Reliable Card Pattern\n```html\n<td style=\"background: #f8fafc; border-radius: 12px; padding: 16px; border-left: 4px solid #6366f1; vertical-align: top;\">\n <div style=\"font-size: 16px; color: #6366f1; font-weight: 700;\">Title</div>\n <div style=\"font-size: 14px; color: #64748b;\">Description</div>\n</td>\n```\n\n## Colors That Work Well Together\n- Dark gradient: `linear-gradient(135deg, #0f172a, #1e293b)`\n- Card backgrounds: `#f8fafc` (light gray), `#fef2f2` (light red)\n- Accent colors: `#6366f1` (indigo), `#10b981` (green), `#8b5cf6` (purple), `#f59e0b` (amber), `#ef4444` (red)\n- Text: `#0f172a` (dark), `#64748b` (muted)\n\nApply these patterns for professional, well-rendered PDFs!",
"categories": ["best-practices"],
"secondaryTag": "PDF",
"votes": 0,
"gaClicks": 0,
"icon": "FileText",
"author": "DC team",
"verified": true
},
{
"id": "onb2_01",
"title": "Organize my Downloads folder",
Expand Down
10 changes: 10 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,16 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {

Supports standard markdown features including headers, lists, code blocks, tables, and basic formatting.

PDF OPTIONS:
Use 'options' parameter with 'pdf_options' key for page settings:
- Landscape: options: {"pdf_options": {"landscape": true}}
- Page size: options: {"pdf_options": {"format": "A4"}} (A4, Letter, Legal, etc.)
- Margins: options: {"pdf_options": {"margin": {"top": "10mm", "left": "10mm"}}}

STYLED PDF BEST PRACTICES:
For complex styled PDFs, use get_prompts(action='get_prompt', promptId='bp_pdf_styling')
to get detailed best practices for layouts, colors, and avoiding common rendering issues.

Only works within allowed directories.

${PATH_GUIDANCE}
Expand Down
13 changes: 13 additions & 0 deletions test/samples/01_sample_simple.pdf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Hello World

This is a test PDF created from markdown.

## Features

Simple text Bold text Italic text Link

## Code

console.log('Hello World');


37 changes: 37 additions & 0 deletions test/samples/02_sample_invoice.pdf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## POWERED BY

#### 1

Sub Total 20,000.00 Total Rs.20,000.00

### Balance Due Rs.20,000.00

Authorized Signature

Total In Words Indian Rupee Twenty Thousand Only

Notes

Thanks for your business.

Payment Options

Terms & Conditions GST not applicable

## Tattva Trails Private Limited

Some street 12 Panjim Goa 999888 India 12344321 tattva.trails.official@gmail.com

# TAX INVOICE

#### # : INV-000007

Invoice Date : 20/11/2025 Terms : Due on Receipt Due Date : 20/11/2025

Bill To

### Shanti Spa Ayurveda

# Item & Description Qty Rate Amount 1 Referral Fee – Panchakarma Treatment Package (14 Days) 1.00 20,000.00 20,000.00


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading