@mindstone/mcp-server-xero 0.1.0 → 0.1.1
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/tools/create/create-bank-transaction.tool.js +2 -1
- package/dist/tools/create/create-contact.tool.js +2 -0
- package/dist/tools/create/create-credit-note.tool.js +1 -0
- package/dist/tools/create/create-invoice.tool.js +1 -0
- package/dist/tools/create/create-item.tool.js +1 -0
- package/dist/tools/create/create-manual-journal.tool.js +2 -0
- package/dist/tools/create/create-payment.tool.js +1 -0
- package/dist/tools/create/create-payroll-timesheet.tool.js +1 -0
- package/dist/tools/create/create-purchase-order.tool.js +1 -0
- package/dist/tools/create/create-quote.tool.js +1 -0
- package/dist/tools/create/create-tracking-category.tool.js +2 -1
- package/dist/tools/create/create-tracking-options.tool.js +2 -1
- package/dist/tools/delete/delete-payroll-timesheet.tool.js +1 -0
- package/dist/tools/get/get-invoice-attachment.tool.js +1 -0
- package/dist/tools/get/get-payroll-timesheet.tool.js +1 -0
- package/dist/tools/history/index.js +2 -0
- package/dist/tools/list/list-accounts.tool.js +1 -0
- package/dist/tools/list/list-aged-payables-by-contact.tool.js +1 -0
- package/dist/tools/list/list-aged-receivables-by-contact.tool.js +1 -0
- package/dist/tools/list/list-bank-summary.tool.js +1 -0
- package/dist/tools/list/list-bank-transactions.tool.js +2 -1
- package/dist/tools/list/list-budget-summary.tool.js +1 -0
- package/dist/tools/list/list-contact-groups.tool.js +1 -0
- package/dist/tools/list/list-contacts.tool.js +1 -0
- package/dist/tools/list/list-credit-notes.tool.js +1 -0
- package/dist/tools/list/list-currencies.tool.js +1 -0
- package/dist/tools/list/list-executive-summary.tool.js +1 -0
- package/dist/tools/list/list-invoice-attachments.tool.js +1 -0
- package/dist/tools/list/list-invoices.tool.js +1 -0
- package/dist/tools/list/list-items.tool.js +1 -0
- package/dist/tools/list/list-manual-journals.tool.js +1 -0
- package/dist/tools/list/list-organisation-details.tool.js +1 -0
- package/dist/tools/list/list-payments.tool.js +1 -0
- package/dist/tools/list/list-payroll-employee-leave-balances.tool.js +1 -0
- package/dist/tools/list/list-payroll-employee-leave-types.tool.js +1 -0
- package/dist/tools/list/list-payroll-employee-leave.tool.js +1 -0
- package/dist/tools/list/list-payroll-employees.tool.js +1 -0
- package/dist/tools/list/list-payroll-leave-periods.tool.js +1 -0
- package/dist/tools/list/list-payroll-leave-types.tool.js +1 -0
- package/dist/tools/list/list-payroll-timesheets.tool.js +1 -0
- package/dist/tools/list/list-profit-and-loss.tool.js +1 -0
- package/dist/tools/list/list-purchase-orders.tool.js +1 -0
- package/dist/tools/list/list-quotes.tool.js +1 -0
- package/dist/tools/list/list-report-balance-sheet.tool.js +1 -0
- package/dist/tools/list/list-tax-rates.tool.js +1 -0
- package/dist/tools/list/list-tracking-categories.tool.js +2 -1
- package/dist/tools/list/list-trial-balance.tool.js +1 -0
- package/dist/tools/update/approve-payroll-timesheet.tool.js +1 -0
- package/dist/tools/update/email-invoice.tool.js +1 -0
- package/dist/tools/update/revert-payroll-timesheet.tool.js +1 -0
- package/dist/tools/update/update-bank-transaction.tool.js +1 -0
- package/dist/tools/update/update-contact.tool.js +2 -0
- package/dist/tools/update/update-credit-note.tool.js +1 -0
- package/dist/tools/update/update-invoice.tool.js +1 -0
- package/dist/tools/update/update-item.tool.js +1 -0
- package/dist/tools/update/update-manual-journal-tool.js +2 -0
- package/dist/tools/update/update-payroll-timesheet-add-line.tool.js +1 -0
- package/dist/tools/update/update-payroll-timesheet-update-line.tool.js +1 -0
- package/dist/tools/update/update-quote.tool.js +1 -0
- package/dist/tools/update/update-tracking-category.tool.js +2 -1
- package/dist/tools/update/update-tracking-options.tool.js +2 -1
- package/dist/untrusted-content.js +27 -16
- package/package.json +2 -2
|
@@ -21,6 +21,7 @@ const CreateContactTool = CreateXeroTool("create-contact", "Create a contact in
|
|
|
21
21
|
text: `Error creating contact: ${response.error}`,
|
|
22
22
|
},
|
|
23
23
|
],
|
|
24
|
+
isError: true,
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
const contact = response.result;
|
|
@@ -49,6 +50,7 @@ const CreateContactTool = CreateXeroTool("create-contact", "Create a contact in
|
|
|
49
50
|
text: `Error creating contact: ${formatError(error)}`,
|
|
50
51
|
},
|
|
51
52
|
],
|
|
53
|
+
isError: true,
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
56
|
});
|
|
@@ -56,6 +56,7 @@ const CreateManualJournalTool = CreateXeroTool("create-manual-journal", "Create
|
|
|
56
56
|
text: `Error creating manual journal: ${response.error}`,
|
|
57
57
|
},
|
|
58
58
|
],
|
|
59
|
+
isError: true,
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
62
|
const manualJournal = response.result;
|
|
@@ -109,6 +110,7 @@ const CreateManualJournalTool = CreateXeroTool("create-manual-journal", "Create
|
|
|
109
110
|
text: `Error creating manual journal: ${formatError(error)}`,
|
|
110
111
|
},
|
|
111
112
|
],
|
|
113
|
+
isError: true,
|
|
112
114
|
};
|
|
113
115
|
}
|
|
114
116
|
});
|
|
@@ -73,6 +73,7 @@ function createGetHistoryTool(def) {
|
|
|
73
73
|
text: `Error retrieving ${def.entity} history: ${response.error}`,
|
|
74
74
|
},
|
|
75
75
|
],
|
|
76
|
+
isError: true,
|
|
76
77
|
};
|
|
77
78
|
}
|
|
78
79
|
const records = response.result;
|
|
@@ -115,6 +116,7 @@ function createAddNoteTool(def) {
|
|
|
115
116
|
text: `Error adding note to ${def.entity}: ${response.error}`,
|
|
116
117
|
},
|
|
117
118
|
],
|
|
119
|
+
isError: true,
|
|
118
120
|
};
|
|
119
121
|
}
|
|
120
122
|
const record = response.result;
|
|
@@ -34,6 +34,7 @@ const UpdateContactTool = CreateXeroTool("update-contact", "Update a contact in
|
|
|
34
34
|
text: `Error updating contact: ${response.error}`,
|
|
35
35
|
},
|
|
36
36
|
],
|
|
37
|
+
isError: true,
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
const contact = response.result;
|
|
@@ -62,6 +63,7 @@ const UpdateContactTool = CreateXeroTool("update-contact", "Update a contact in
|
|
|
62
63
|
text: `Error updating contact: ${formatError(error)}`,
|
|
63
64
|
},
|
|
64
65
|
],
|
|
66
|
+
isError: true,
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
69
|
});
|
|
@@ -54,6 +54,7 @@ const UpdateManualJournalTool = CreateXeroTool("update-manual-journal", "Update
|
|
|
54
54
|
text: `Error updating manual journal: ${response.error}`,
|
|
55
55
|
},
|
|
56
56
|
],
|
|
57
|
+
isError: true,
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
60
|
const manualJournal = response.result;
|
|
@@ -82,6 +83,7 @@ const UpdateManualJournalTool = CreateXeroTool("update-manual-journal", "Update
|
|
|
82
83
|
text: `Error updating manual journal: ${formatError(error)}`,
|
|
83
84
|
},
|
|
84
85
|
],
|
|
86
|
+
isError: true,
|
|
85
87
|
};
|
|
86
88
|
}
|
|
87
89
|
});
|
|
@@ -18,34 +18,44 @@
|
|
|
18
18
|
* `untrusted-content` in any connector that talks to an external system; this
|
|
19
19
|
* file (and the call sites that import from it) is what satisfies that gate.
|
|
20
20
|
*/
|
|
21
|
-
const UNTRUSTED_CLOSE_TAG_VARIANT = /<\/untrusted-content
|
|
21
|
+
const UNTRUSTED_CLOSE_TAG_VARIANT = /<\/untrusted-content(?:\s[^>]*)?>/gi;
|
|
22
22
|
const ESCAPED_UNTRUSTED_CLOSE_TAG = '<\\/untrusted-content>';
|
|
23
|
+
const UNTRUSTED_OPEN_TAG_VARIANT = /<untrusted-content(?:\s[^>]*)?>/gi;
|
|
24
|
+
const ESCAPED_UNTRUSTED_OPEN_TAG = '<\\untrusted-content>';
|
|
23
25
|
const UNTRUSTED_ENVELOPE = /^<untrusted-content source="[^"]*">([\s\S]*)<\/untrusted-content>$/;
|
|
24
26
|
function escapeAttr(s) {
|
|
25
27
|
return s.replaceAll('&', '&').replaceAll('"', '"').replaceAll('<', '<').replaceAll('>', '>');
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
|
-
* Rewrite every `</untrusted-content>`
|
|
29
|
-
* whitespace before `>`) inside `s`
|
|
30
|
-
*
|
|
30
|
+
* Rewrite every `</untrusted-content>` and `<untrusted-content …>` variant
|
|
31
|
+
* (case-insensitive, optional whitespace / attributes before `>`) inside `s`
|
|
32
|
+
* to a benign textual form, so an attacker who controls the wrapped content
|
|
33
|
+
* can neither terminate the envelope early nor spoof a nested open tag that a
|
|
34
|
+
* downstream parser could re-read as a fresh envelope. An LLM parsing the
|
|
35
|
+
* markup plausibly accepts attribute-bearing close forms such as
|
|
36
|
+
* `</untrusted-content foo>` — the matcher must cover them too.
|
|
31
37
|
*/
|
|
32
|
-
function
|
|
33
|
-
return s
|
|
38
|
+
function escapeTagSentinels(s) {
|
|
39
|
+
return s
|
|
40
|
+
.replace(UNTRUSTED_OPEN_TAG_VARIANT, ESCAPED_UNTRUSTED_OPEN_TAG)
|
|
41
|
+
.replace(UNTRUSTED_CLOSE_TAG_VARIANT, ESCAPED_UNTRUSTED_CLOSE_TAG);
|
|
34
42
|
}
|
|
35
|
-
function
|
|
36
|
-
return s
|
|
43
|
+
function unescapeTagSentinels(s) {
|
|
44
|
+
return s
|
|
45
|
+
.replaceAll(ESCAPED_UNTRUSTED_OPEN_TAG, '<untrusted-content>')
|
|
46
|
+
.replaceAll(ESCAPED_UNTRUSTED_CLOSE_TAG, '</untrusted-content>');
|
|
37
47
|
}
|
|
38
48
|
/**
|
|
39
49
|
* Wrap a single untrusted string in an `<untrusted-content source="…">`
|
|
40
|
-
* envelope, escaping any embedded close-tag variant so the envelope
|
|
41
|
-
* broken out of.
|
|
50
|
+
* envelope, escaping any embedded open/close-tag variant so the envelope can
|
|
51
|
+
* neither be broken out of nor have a spoofed nested envelope planted inside.
|
|
42
52
|
*
|
|
43
53
|
* `undefined` and `null` are passed through untouched so callers can apply the wrapper
|
|
44
54
|
* uniformly to optional fields without branching.
|
|
45
55
|
*
|
|
46
56
|
* Idempotent: when `text` is already a properly-shaped envelope for the SAME
|
|
47
57
|
* `source` (starts with the matching OPEN tag, ends with CLOSE, and contains no
|
|
48
|
-
* internal close-tag variants), the original string is returned unchanged so
|
|
58
|
+
* internal open/close-tag variants), the original string is returned unchanged so
|
|
49
59
|
* `wrapUntrusted(wrapUntrusted(s, src), src) === wrapUntrusted(s, src)`.
|
|
50
60
|
*/
|
|
51
61
|
export function wrapUntrusted(text, source) {
|
|
@@ -55,13 +65,14 @@ export function wrapUntrusted(text, source) {
|
|
|
55
65
|
const close = '</untrusted-content>';
|
|
56
66
|
if (text.startsWith(open) && text.endsWith(close) && text.length >= open.length + close.length) {
|
|
57
67
|
const inner = text.slice(open.length, text.length - close.length);
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
const hasVariant = UNTRUSTED_CLOSE_TAG_VARIANT.test(inner) || UNTRUSTED_OPEN_TAG_VARIANT.test(inner);
|
|
69
|
+
UNTRUSTED_CLOSE_TAG_VARIANT.lastIndex = 0; // reset stateful /g regexes
|
|
70
|
+
UNTRUSTED_OPEN_TAG_VARIANT.lastIndex = 0;
|
|
71
|
+
if (!hasVariant) {
|
|
60
72
|
return text;
|
|
61
73
|
}
|
|
62
|
-
UNTRUSTED_CLOSE_TAG_VARIANT.lastIndex = 0;
|
|
63
74
|
}
|
|
64
|
-
return `${open}${
|
|
75
|
+
return `${open}${escapeTagSentinels(text)}${close}`;
|
|
65
76
|
}
|
|
66
77
|
/**
|
|
67
78
|
* Strip one `<untrusted-content>` envelope from `text` if present, returning raw
|
|
@@ -73,7 +84,7 @@ export function unwrapUntrusted(text) {
|
|
|
73
84
|
const match = UNTRUSTED_ENVELOPE.exec(text);
|
|
74
85
|
if (!match)
|
|
75
86
|
return text;
|
|
76
|
-
return
|
|
87
|
+
return unescapeTagSentinels(match[1]);
|
|
77
88
|
}
|
|
78
89
|
/**
|
|
79
90
|
* Recursively wrap every string key and value reachable inside `value` (strings,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstone/mcp-server-xero",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"mcpName": "io.github.mindstone/mcp-server-xero",
|
|
5
5
|
"description": "Xero MCP server for invoices, contacts, payments, quotes, and financial reports",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "connectors/xero"
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/mindstone/mcp-servers/tree/main/connectors/xero",
|
|
14
|
-
"author": "
|
|
14
|
+
"author": "Mindstone <support@mindstone.ai>",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"bin": {
|
|
17
17
|
"mcp-server-xero": "dist/index.js"
|