snapforge-mcp 1.1.0 → 1.2.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.
- package/index.js +22 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -96,5 +96,27 @@ server.registerTool(
|
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
|
|
99
|
+
server.registerTool(
|
|
100
|
+
'snapforge_markdown',
|
|
101
|
+
{
|
|
102
|
+
title: 'SnapForge URL to Markdown',
|
|
103
|
+
description: 'Extract a clean Markdown version of a public URL or raw HTML (article extraction + HTML→Markdown). Returns the Markdown and saves a .md file.',
|
|
104
|
+
inputSchema: { ...common }
|
|
105
|
+
},
|
|
106
|
+
async (args) => {
|
|
107
|
+
try {
|
|
108
|
+
const { buf } = await render('/v1/markdown', args);
|
|
109
|
+
const file = path.join(tmpdir(), `snapforge-${Date.now()}.md`);
|
|
110
|
+
await writeFile(file, buf);
|
|
111
|
+
return { content: [
|
|
112
|
+
{ type: 'text', text: buf.toString('utf8') },
|
|
113
|
+
{ type: 'text', text: `Saved to ${file}` }
|
|
114
|
+
] };
|
|
115
|
+
} catch (e) {
|
|
116
|
+
return { isError: true, content: [{ type: 'text', text: String(e.message || e) }] };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
|
|
99
121
|
const transport = new StdioServerTransport();
|
|
100
122
|
await server.connect(transport);
|