forkfeed-mcp 1.0.4 → 1.0.5

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/dist/index.js +17 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env node
2
+ import { mkdir, writeFile } from 'node:fs/promises';
3
+ import { join } from 'node:path';
2
4
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
5
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
6
  import { z } from 'zod';
@@ -65,6 +67,19 @@ server.tool('forkfeed_push', 'Push a generated manifest (forks, feeds, cards) to
65
67
  isError: true,
66
68
  };
67
69
  }
70
+ // Save manifest locally before uploading (best-effort, doesn't block push)
71
+ const forkId = manifest.forks?.[0]?._id;
72
+ const filename = `${forkId || `manifest-${Date.now()}`}.json`;
73
+ const dir = join(process.cwd(), 'forkfeed');
74
+ const filepath = join(dir, filename);
75
+ let saveError = '';
76
+ try {
77
+ await mkdir(dir, { recursive: true });
78
+ await writeFile(filepath, JSON.stringify(manifest, null, 2));
79
+ }
80
+ catch (err) {
81
+ saveError = `Warning: failed to save manifest to ${filepath}: ${err instanceof Error ? err.message : String(err)}`;
82
+ }
68
83
  try {
69
84
  const res = await fetch(`${APP_SERVER_URL}/api/content/push`, {
70
85
  method: 'POST',
@@ -117,6 +132,8 @@ server.tool('forkfeed_push', 'Push a generated manifest (forks, feeds, cards) to
117
132
  'Forks:',
118
133
  forkSummary || ' (none)',
119
134
  '',
135
+ saveError || `Manifest saved to ${filepath}`,
136
+ '',
120
137
  'Your content is now live in the forkfeed app. It starts as private.',
121
138
  'To make it public, change visibility in the app (requires admin approval).',
122
139
  qrBlock,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forkfeed-mcp",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "MCP server for pushing GitHub commits to forkfeed",
5
5
  "type": "module",
6
6
  "bin": {