ofw-mcp 1.0.6 → 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.
- package/dist/client.js +5 -1
- package/dist/tools/messages.js +17 -3
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import 'dotenv
|
|
1
|
+
import { config as loadDotenv } from 'dotenv';
|
|
2
|
+
import { dirname, join } from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
loadDotenv({ path: join(__dirname, '..', '.env'), override: false, quiet: true });
|
|
2
6
|
const BASE_URL = 'https://ofw.ourfamilywizard.com';
|
|
3
7
|
const STATIC_HEADERS = {
|
|
4
8
|
'ofw-client': 'WebApplication',
|
package/dist/tools/messages.js
CHANGED
|
@@ -33,7 +33,7 @@ export const toolDefinitions = [
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
name: 'ofw_send_message',
|
|
36
|
-
description: 'Send a message via OurFamilyWizard',
|
|
36
|
+
description: 'Send a message via OurFamilyWizard. If sending from a draft, pass draftId to automatically delete the draft after sending.',
|
|
37
37
|
annotations: { destructiveHint: true },
|
|
38
38
|
inputSchema: {
|
|
39
39
|
type: 'object',
|
|
@@ -45,6 +45,14 @@ export const toolDefinitions = [
|
|
|
45
45
|
items: { type: 'number' },
|
|
46
46
|
description: 'Array of recipient user IDs (get from ofw_get_profile)',
|
|
47
47
|
},
|
|
48
|
+
replyToId: {
|
|
49
|
+
type: 'number',
|
|
50
|
+
description: 'ID of the message being replied to. When provided, the original message thread is included (like a standard email reply).',
|
|
51
|
+
},
|
|
52
|
+
draftId: {
|
|
53
|
+
type: 'number',
|
|
54
|
+
description: 'ID of the draft to delete after sending (omit if not sending from a draft)',
|
|
55
|
+
},
|
|
48
56
|
},
|
|
49
57
|
required: ['subject', 'body', 'recipientIds'],
|
|
50
58
|
},
|
|
@@ -119,13 +127,19 @@ export async function handleTool(name, args, client) {
|
|
|
119
127
|
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
120
128
|
}
|
|
121
129
|
case 'ofw_send_message': {
|
|
122
|
-
const { subject, body, recipientIds } = args;
|
|
130
|
+
const { subject, body, recipientIds, replyToId = null, draftId } = args;
|
|
123
131
|
const data = await client.request('POST', '/pub/v3/messages', {
|
|
124
132
|
subject, body, recipientIds,
|
|
125
133
|
attachments: { myFileIDs: [] },
|
|
126
134
|
draft: false,
|
|
127
|
-
includeOriginal:
|
|
135
|
+
includeOriginal: replyToId !== null,
|
|
136
|
+
replyToId,
|
|
128
137
|
});
|
|
138
|
+
if (draftId !== undefined) {
|
|
139
|
+
const form = new FormData();
|
|
140
|
+
form.append('messageIds', String(draftId));
|
|
141
|
+
await client.request('DELETE', '/pub/v1/messages', form);
|
|
142
|
+
}
|
|
129
143
|
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
130
144
|
}
|
|
131
145
|
case 'ofw_list_drafts': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ofw-mcp",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "OurFamilyWizard MCP server for Claude — developed and maintained by AI (Claude Sonnet 4.6)",
|
|
5
5
|
"author": "Claude Sonnet 4.6 (AI) <https://www.anthropic.com/claude>",
|
|
6
6
|
"repository": {
|