snapforge-mcp 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +10 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -55,7 +55,15 @@ server.registerTool(
55
55
  async (args) => {
56
56
  try {
57
57
  const { buf, contentType } = await render('/v1/screenshot', args);
58
- return { content: [{ type: 'image', data: buf.toString('base64'), mimeType: contentType }] };
58
+ const ext = contentType.includes('jpeg') ? 'jpg' : 'png';
59
+ const file = path.join(tmpdir(), `snapforge-${Date.now()}.${ext}`);
60
+ await writeFile(file, buf);
61
+ return {
62
+ content: [
63
+ { type: 'image', data: buf.toString('base64'), mimeType: contentType },
64
+ { type: 'text', text: `Saved to ${file} (${buf.length} bytes).` }
65
+ ]
66
+ };
59
67
  } catch (e) {
60
68
  return { isError: true, content: [{ type: 'text', text: String(e.message || e) }] };
61
69
  }
@@ -69,6 +77,7 @@ server.registerTool(
69
77
  description: 'Render a public URL or raw HTML to a PDF. The PDF is written to a temp file and its path is returned.',
70
78
  inputSchema: {
71
79
  ...common,
80
+ singlePage: z.boolean().optional().describe('One continuous page sized to the content height (no A4 pagination)'),
72
81
  pageFormat: z.enum(['Letter', 'Legal', 'Tabloid', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6']).optional(),
73
82
  landscape: z.boolean().optional(),
74
83
  printBackground: z.boolean().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snapforge-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "MCP server for SnapForge — screenshot & HTML-to-PDF API as agent tools",
5
5
  "type": "module",
6
6
  "bin": { "snapforge-mcp": "index.js" },