ofw-mcp 1.0.1 → 1.0.2
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 +12 -6
- package/dist/index.js +1 -0
- package/dist/tools/messages.js +3 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -14,13 +14,19 @@ export class OFWClient {
|
|
|
14
14
|
return this.doRequest(method, path, body, false);
|
|
15
15
|
}
|
|
16
16
|
async doRequest(method, path, body, isRetry) {
|
|
17
|
+
const isFormData = body instanceof FormData;
|
|
18
|
+
const headers = {
|
|
19
|
+
'ofw-client': 'WebApplication',
|
|
20
|
+
'ofw-version': '1.0.0',
|
|
21
|
+
Accept: 'application/json',
|
|
22
|
+
Authorization: `Bearer ${this.token}`,
|
|
23
|
+
};
|
|
24
|
+
if (!isFormData)
|
|
25
|
+
headers['Content-Type'] = 'application/json';
|
|
17
26
|
const response = await fetch(`${BASE_URL}${path}`, {
|
|
18
27
|
method,
|
|
19
|
-
headers
|
|
20
|
-
|
|
21
|
-
...(this.token ? { Authorization: `Bearer ${this.token}` } : {}),
|
|
22
|
-
},
|
|
23
|
-
...(body !== undefined ? { body: JSON.stringify(body) } : {}),
|
|
28
|
+
headers,
|
|
29
|
+
...(body !== undefined ? { body: isFormData ? body : JSON.stringify(body) } : {}),
|
|
24
30
|
});
|
|
25
31
|
if (response.status === 401 && !isRetry) {
|
|
26
32
|
this.token = null;
|
|
@@ -59,7 +65,7 @@ export class OFWClient {
|
|
|
59
65
|
});
|
|
60
66
|
// Extract just the SESSION=value part (strip attributes like Path, Secure, etc.)
|
|
61
67
|
const setCookie = initResponse.headers.get('set-cookie') ?? '';
|
|
62
|
-
const sessionCookie = setCookie.split(';')[0]
|
|
68
|
+
const sessionCookie = setCookie.split(';')[0]; // split always returns a string; empty string is falsy
|
|
63
69
|
const response = await fetch(`${BASE_URL}/ofw/login`, {
|
|
64
70
|
method: 'POST',
|
|
65
71
|
headers: {
|
package/dist/index.js
CHANGED
|
@@ -48,5 +48,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
+
console.error('[ofw-mcp] This project was developed and is maintained by AI (Claude Sonnet 4.6). Use at your own discretion.');
|
|
51
52
|
const transport = new StdioServerTransport();
|
|
52
53
|
await server.connect(transport);
|
package/dist/tools/messages.js
CHANGED
|
@@ -151,7 +151,9 @@ export async function handleTool(name, args, client) {
|
|
|
151
151
|
}
|
|
152
152
|
case 'ofw_delete_draft': {
|
|
153
153
|
const { messageId } = args;
|
|
154
|
-
const
|
|
154
|
+
const form = new FormData();
|
|
155
|
+
form.append('messageIds', String(messageId));
|
|
156
|
+
const data = await client.request('DELETE', '/pub/v1/messages', form);
|
|
155
157
|
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
156
158
|
}
|
|
157
159
|
default:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ofw-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
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
|
"type": "module",
|