@nannykeeper/mcp-server 1.9.0 → 1.10.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/index.d.ts +4 -1
- package/dist/index.js +118 -19
- package/dist/tools/autopilot.d.ts +21 -0
- package/dist/tools/autopilot.js +72 -0
- package/dist/tools/calculate.d.ts +13 -31
- package/dist/tools/calculate.js +13 -42
- package/dist/tools/run-payroll.d.ts +1 -0
- package/dist/tools/run-payroll.js +1 -0
- package/dist/tools/state-filing-status.d.ts +32 -6
- package/dist/tools/state-filing-status.js +56 -10
- package/dist/tools/threshold.d.ts +14 -23
- package/dist/tools/threshold.js +14 -26
- package/manifest.json +1 -1
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
* NannyKeeper MCP Server
|
|
4
4
|
*
|
|
5
5
|
* Model Context Protocol server for calculating US household employer
|
|
6
|
-
* (nanny) taxes. Provides
|
|
6
|
+
* (nanny) taxes. Provides these tools:
|
|
7
7
|
* - calculate_nanny_taxes: Full tax breakdown for any US state
|
|
8
8
|
* - check_threshold: Whether wages trigger employer obligations
|
|
9
9
|
* - preview_payroll: Dry-run payroll calc (no record created)
|
|
10
10
|
* - run_payroll: Run payroll with YTD tracking and DB persistence
|
|
11
|
+
* - get_state_filing_status: State agency account numbers (last-four)
|
|
12
|
+
* - get_autopilot: Read recurring auto-run payroll status/enrollments
|
|
13
|
+
* - manage_autopilot: Pause/resume/skip/disable an existing enrollment
|
|
11
14
|
*
|
|
12
15
|
* Requires NANNYKEEPER_API_KEY environment variable.
|
|
13
16
|
* Get a free key at: https://www.nannykeeper.com/developers/keys
|
package/dist/index.js
CHANGED
|
@@ -3,27 +3,61 @@
|
|
|
3
3
|
* NannyKeeper MCP Server
|
|
4
4
|
*
|
|
5
5
|
* Model Context Protocol server for calculating US household employer
|
|
6
|
-
* (nanny) taxes. Provides
|
|
6
|
+
* (nanny) taxes. Provides these tools:
|
|
7
7
|
* - calculate_nanny_taxes: Full tax breakdown for any US state
|
|
8
8
|
* - check_threshold: Whether wages trigger employer obligations
|
|
9
9
|
* - preview_payroll: Dry-run payroll calc (no record created)
|
|
10
10
|
* - run_payroll: Run payroll with YTD tracking and DB persistence
|
|
11
|
+
* - get_state_filing_status: State agency account numbers (last-four)
|
|
12
|
+
* - get_autopilot: Read recurring auto-run payroll status/enrollments
|
|
13
|
+
* - manage_autopilot: Pause/resume/skip/disable an existing enrollment
|
|
11
14
|
*
|
|
12
15
|
* Requires NANNYKEEPER_API_KEY environment variable.
|
|
13
16
|
* Get a free key at: https://www.nannykeeper.com/developers/keys
|
|
14
17
|
*/
|
|
15
18
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
16
19
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
20
|
+
import { createRequire } from "node:module";
|
|
17
21
|
import { z } from "zod";
|
|
18
22
|
import { executeCalculate } from "./tools/calculate.js";
|
|
19
23
|
import { executeThreshold } from "./tools/threshold.js";
|
|
20
24
|
import { executePreviewPayroll } from "./tools/preview-payroll.js";
|
|
21
25
|
import { executeRunPayroll } from "./tools/run-payroll.js";
|
|
22
|
-
import { executeStateFilingStatus } from "./tools/state-filing-status.js";
|
|
26
|
+
import { executeStateFilingStatus, stateFilingStatusTool, } from "./tools/state-filing-status.js";
|
|
27
|
+
import { executeGetAutopilot, executeManageAutopilot } from "./tools/autopilot.js";
|
|
28
|
+
/**
|
|
29
|
+
* ⛔ DERIVED, never hardcoded. This is the version the client sees in the
|
|
30
|
+
* `initialize` handshake — the one an MCP host displays and the first thing
|
|
31
|
+
* anyone reads when asking "which version am I running?".
|
|
32
|
+
*
|
|
33
|
+
* It was a literal, and it drifted: it sat at "1.9.0" from the Autopilot commit
|
|
34
|
+
* while package.json, manifest.json and server.json all moved to 1.10.0. The
|
|
35
|
+
* release runbook's "version has to bump in all three files" checklist did not
|
|
36
|
+
* list it, so nothing bumped it and nothing noticed — the published 1.10.0
|
|
37
|
+
* introduced itself as 1.9.0 (NK-696).
|
|
38
|
+
*
|
|
39
|
+
* `createRequire` rather than an import attribute: this package targets Node
|
|
40
|
+
* >=18, where `with { type: "json" }` is still behind a flag on the older
|
|
41
|
+
* runtimes in that range. npm always ships package.json, and `dist/index.js`
|
|
42
|
+
* sits one level down, so `../package.json` resolves in the published layout.
|
|
43
|
+
*/
|
|
44
|
+
const { version: SERVER_VERSION } = createRequire(import.meta.url)("../package.json");
|
|
23
45
|
const server = new McpServer({
|
|
24
46
|
name: "nannykeeper",
|
|
25
|
-
version:
|
|
47
|
+
version: SERVER_VERSION,
|
|
26
48
|
});
|
|
49
|
+
/**
|
|
50
|
+
* Authority: SSA Contribution and Benefit Base; IRS Pubs. 15 and 926 (2026).
|
|
51
|
+
* Fact: the 2026 Social Security wage base is $184,500; Social Security is
|
|
52
|
+
* 6.2% for both employer and employee; Medicare is 1.45% for each with no cap.
|
|
53
|
+
* Sources: https://www.ssa.gov/oact/COLA/cbb.html
|
|
54
|
+
* https://www.irs.gov/publications/p15
|
|
55
|
+
* https://www.irs.gov/publications/p926
|
|
56
|
+
* Accessed: 2026-08-25.
|
|
57
|
+
* Reasoning: the compiled tool description is shipped inside the MCPB and is
|
|
58
|
+
* independently customer-visible, so its tax facts require the same source
|
|
59
|
+
* provenance as the application calculators.
|
|
60
|
+
*/
|
|
27
61
|
// Register calculate tool
|
|
28
62
|
server.tool("calculate_nanny_taxes", "Calculate employer and employee tax obligations for a household employee (nanny, caregiver, housekeeper) in any US state. " +
|
|
29
63
|
"Returns Social Security, Medicare, FUTA, state unemployment, and income tax breakdown. " +
|
|
@@ -59,13 +93,13 @@ server.tool("calculate_nanny_taxes", "Calculate employer and employee tax obliga
|
|
|
59
93
|
return { content: [{ type: "text", text: result }] };
|
|
60
94
|
});
|
|
61
95
|
// Register threshold tool
|
|
62
|
-
server.tool("check_threshold", "Check
|
|
63
|
-
"($3,000 for 2026)
|
|
64
|
-
"
|
|
65
|
-
"
|
|
96
|
+
server.tool("check_threshold", "Check whether one household employee's annual wages cross the IRS Social Security and Medicare threshold " +
|
|
97
|
+
"($3,000 for 2026). The response discloses, but cannot assess, household-wide quarterly FUTA and state thresholds " +
|
|
98
|
+
"because this tool does not receive quarterly wages for every employee. It also cannot assess family-employee exemptions " +
|
|
99
|
+
"because it has no relationship input. Never interpret the result as a complete tax-obligation decision.", {
|
|
66
100
|
state: z.string().describe("2-letter US state code (e.g., CA, NY, TX)"),
|
|
67
101
|
annual_wages: z.number().describe("Annual wages paid (or planned) to the household employee"),
|
|
68
|
-
tax_year: z.number().optional().describe("
|
|
102
|
+
tax_year: z.number().min(2024).max(2026).optional().describe("Supported tax year to check (2024-2026; default: current year)"),
|
|
69
103
|
}, {
|
|
70
104
|
title: "Check Tax Threshold",
|
|
71
105
|
readOnlyHint: true,
|
|
@@ -167,6 +201,10 @@ server.tool("run_payroll", "Run payroll for a household employee end-to-end in a
|
|
|
167
201
|
.boolean()
|
|
168
202
|
.optional()
|
|
169
203
|
.describe("Required for first-time direct-deposit payroll or when the last DD authorization is >30 days old."),
|
|
204
|
+
off_cycle: z
|
|
205
|
+
.boolean()
|
|
206
|
+
.optional()
|
|
207
|
+
.describe("Deprecated and ignored. Runs for an Autopilot-covered employee are classified by pay period: a past/current period Autopilot has NOT scheduled runs normally; a period Autopilot already scheduled returns 409 with error code 'autopilot_run_scheduled' (it must be replaced in the NannyKeeper app, or Autopilot turned off first); a period beyond Autopilot's next run returns 409 'period_ahead_of_anchor'. Do NOT retry with off_cycle=true — there is no additive off-cycle run. On a 409, surface the message to the user rather than retrying."),
|
|
170
208
|
voluntary_set_aside: z
|
|
171
209
|
.object({
|
|
172
210
|
skip: z.boolean().optional().describe("Skip the active set-aside rule for this paycheck only"),
|
|
@@ -189,22 +227,83 @@ server.tool("run_payroll", "Run payroll for a household employee end-to-end in a
|
|
|
189
227
|
return { content: [{ type: "text", text: result }] };
|
|
190
228
|
});
|
|
191
229
|
// Register get_state_filing_status tool
|
|
192
|
-
server.tool(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
230
|
+
server.tool(stateFilingStatusTool.name,
|
|
231
|
+
// ⛔ IMPORTED, not restated. The inline copy that used to sit here was the
|
|
232
|
+
// one agents actually read, and it drifted out of date the moment NK-395
|
|
233
|
+
// edited the exported descriptor instead — promising "a registration URL for
|
|
234
|
+
// any that are missing" long after that stopped being true.
|
|
235
|
+
stateFilingStatusTool.description, {
|
|
236
|
+
// ⛔ THIS is the shape agents actually see — the `{}` that used to sit here
|
|
237
|
+
// is why the descriptor's own `inputSchema` was read by nothing and has now
|
|
238
|
+
// been deleted rather than extended (NK-695). Declaring a parameter there
|
|
239
|
+
// would have reached zero agents, which is the fifth time on this issue
|
|
240
|
+
// that a second copy turned out to be the dead one.
|
|
241
|
+
employer_id: z
|
|
242
|
+
.string()
|
|
243
|
+
.uuid()
|
|
244
|
+
.optional()
|
|
245
|
+
.describe("Optional. The household to read, when the account has more than one. " +
|
|
246
|
+
"Defaults to the household this API key belongs to — leave unset for " +
|
|
247
|
+
"a single-household customer. Needed for a test-mode (nk_test_) key, " +
|
|
248
|
+
"whose default household is the REAL one: pass the sandbox id."),
|
|
249
|
+
}, {
|
|
201
250
|
title: "Get State Filing Status",
|
|
202
251
|
readOnlyHint: true,
|
|
203
252
|
destructiveHint: false,
|
|
204
253
|
idempotentHint: true,
|
|
205
254
|
openWorldHint: true,
|
|
206
|
-
}, async () => {
|
|
207
|
-
const result = await executeStateFilingStatus();
|
|
255
|
+
}, async ({ employer_id }) => {
|
|
256
|
+
const result = await executeStateFilingStatus({ employer_id });
|
|
257
|
+
return { content: [{ type: "text", text: result }] };
|
|
258
|
+
});
|
|
259
|
+
// Register get_autopilot tool (read)
|
|
260
|
+
server.tool("get_autopilot", "Read Autopilot status (recurring auto-run payroll). With employee_id: the live enrollment " +
|
|
261
|
+
"(status, standard hours, expected net, next pay date) plus eligibility and a 3-payday schedule " +
|
|
262
|
+
"preview — or, if not enrolled, WHY (the eligibility reason, e.g. not_plus / insufficient_history). " +
|
|
263
|
+
"Without employee_id: the list of the employer's active enrollments. Read-only. " +
|
|
264
|
+
"Requires a Plus/Professional key. To get employer_id/employee_id: GET /api/v1/employees?employer_id=YOUR_ID.", {
|
|
265
|
+
employer_id: z.string().uuid().describe("Employer UUID — visible in your NannyKeeper dashboard URL"),
|
|
266
|
+
employee_id: z
|
|
267
|
+
.string()
|
|
268
|
+
.uuid()
|
|
269
|
+
.optional()
|
|
270
|
+
.describe("Employee UUID — omit to list all active enrollments for the employer"),
|
|
271
|
+
}, {
|
|
272
|
+
title: "Get Autopilot Status",
|
|
273
|
+
readOnlyHint: true,
|
|
274
|
+
destructiveHint: false,
|
|
275
|
+
idempotentHint: true,
|
|
276
|
+
openWorldHint: true,
|
|
277
|
+
}, async (args) => {
|
|
278
|
+
const result = await executeGetAutopilot(args);
|
|
279
|
+
return { content: [{ type: "text", text: result }] };
|
|
280
|
+
});
|
|
281
|
+
// Register manage_autopilot tool (pause/resume/skip/disable)
|
|
282
|
+
server.tool("manage_autopilot", "Manage an EXISTING Autopilot enrollment for a household employee. Actions: " +
|
|
283
|
+
"`pause` (stop new generation — an already-scheduled run still fires unless voided from the payroll page), " +
|
|
284
|
+
"`resume` (re-checks eligibility + clears the failure counter), " +
|
|
285
|
+
"`skip` (skip the next period; with through_date, skip every period up to that date for a vacation), " +
|
|
286
|
+
"`disable` (turn Autopilot off — soft-deleted so the ledger + ACH authorization are retained; the employee can re-enroll in-app). " +
|
|
287
|
+
"Turning Autopilot ON is NOT available here — it captures a standing recurring ACH authorization that must be " +
|
|
288
|
+
"done by the employer in the app. Requires a Plus/Professional key. Confirm the action with the user before calling.", {
|
|
289
|
+
employer_id: z.string().uuid().describe("Employer UUID"),
|
|
290
|
+
employee_id: z.string().uuid().describe("Employee UUID whose enrollment to manage"),
|
|
291
|
+
action: z
|
|
292
|
+
.enum(["pause", "resume", "skip", "disable"])
|
|
293
|
+
.describe("What to do: pause | resume | skip | disable"),
|
|
294
|
+
through_date: z
|
|
295
|
+
.string()
|
|
296
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/)
|
|
297
|
+
.optional()
|
|
298
|
+
.describe("skip only: skip every upcoming period up to this date (YYYY-MM-DD) for a multi-week vacation"),
|
|
299
|
+
}, {
|
|
300
|
+
title: "Manage Autopilot",
|
|
301
|
+
readOnlyHint: false,
|
|
302
|
+
destructiveHint: false,
|
|
303
|
+
idempotentHint: false,
|
|
304
|
+
openWorldHint: true,
|
|
305
|
+
}, async (args) => {
|
|
306
|
+
const result = await executeManageAutopilot(args);
|
|
208
307
|
return { content: [{ type: "text", text: result }] };
|
|
209
308
|
});
|
|
210
309
|
// Start server
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot MCP tools (manage-only).
|
|
3
|
+
*
|
|
4
|
+
* Autopilot = opt-in recurring auto-run of payroll. The MCP surface can READ
|
|
5
|
+
* status/history and MANAGE an existing enrollment (pause / resume / skip /
|
|
6
|
+
* disable). Enrollment itself is intentionally NOT exposed — turning Autopilot
|
|
7
|
+
* on captures a standing recurring ACH authorization that must be employer-
|
|
8
|
+
* driven in the app. Requires a Plus/Professional key (the `ach` scope).
|
|
9
|
+
*/
|
|
10
|
+
/** Read Autopilot status for one employee, or list the employer's active enrollments. */
|
|
11
|
+
export declare function executeGetAutopilot(args: {
|
|
12
|
+
employer_id: string;
|
|
13
|
+
employee_id?: string;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
/** Manage an existing enrollment: pause / resume / skip / disable. */
|
|
16
|
+
export declare function executeManageAutopilot(args: {
|
|
17
|
+
employer_id: string;
|
|
18
|
+
employee_id: string;
|
|
19
|
+
action: "pause" | "resume" | "skip" | "disable";
|
|
20
|
+
through_date?: string;
|
|
21
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autopilot MCP tools (manage-only).
|
|
3
|
+
*
|
|
4
|
+
* Autopilot = opt-in recurring auto-run of payroll. The MCP surface can READ
|
|
5
|
+
* status/history and MANAGE an existing enrollment (pause / resume / skip /
|
|
6
|
+
* disable). Enrollment itself is intentionally NOT exposed — turning Autopilot
|
|
7
|
+
* on captures a standing recurring ACH authorization that must be employer-
|
|
8
|
+
* driven in the app. Requires a Plus/Professional key (the `ach` scope).
|
|
9
|
+
*/
|
|
10
|
+
const API_BASE = process.env.NANNYKEEPER_API_URL || "https://www.nannykeeper.com";
|
|
11
|
+
function missingKey() {
|
|
12
|
+
return JSON.stringify({
|
|
13
|
+
error: "NANNYKEEPER_API_KEY environment variable is not set. Autopilot management requires a Plus/Professional key: nannykeeper.com/developers/keys",
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/** Read Autopilot status for one employee, or list the employer's active enrollments. */
|
|
17
|
+
export async function executeGetAutopilot(args) {
|
|
18
|
+
const apiKey = process.env.NANNYKEEPER_API_KEY;
|
|
19
|
+
if (!apiKey)
|
|
20
|
+
return missingKey();
|
|
21
|
+
try {
|
|
22
|
+
const params = new URLSearchParams({ employer_id: args.employer_id });
|
|
23
|
+
if (args.employee_id)
|
|
24
|
+
params.set("employee_id", args.employee_id);
|
|
25
|
+
const response = await fetch(`${API_BASE}/api/v1/autopilot?${params.toString()}`, {
|
|
26
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
27
|
+
});
|
|
28
|
+
const data = await response.json();
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
return JSON.stringify({ error: data.error?.message || `API error: ${response.status}` });
|
|
31
|
+
}
|
|
32
|
+
return JSON.stringify(data);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return JSON.stringify({
|
|
36
|
+
error: `Network error: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Manage an existing enrollment: pause / resume / skip / disable. */
|
|
41
|
+
export async function executeManageAutopilot(args) {
|
|
42
|
+
const apiKey = process.env.NANNYKEEPER_API_KEY;
|
|
43
|
+
if (!apiKey)
|
|
44
|
+
return missingKey();
|
|
45
|
+
try {
|
|
46
|
+
const body = {
|
|
47
|
+
employer_id: args.employer_id,
|
|
48
|
+
employee_id: args.employee_id,
|
|
49
|
+
};
|
|
50
|
+
if (args.action === "skip" && args.through_date) {
|
|
51
|
+
body.through_date = args.through_date;
|
|
52
|
+
}
|
|
53
|
+
const response = await fetch(`${API_BASE}/api/v1/autopilot/${args.action}`, {
|
|
54
|
+
method: "POST",
|
|
55
|
+
headers: {
|
|
56
|
+
Authorization: `Bearer ${apiKey}`,
|
|
57
|
+
"Content-Type": "application/json",
|
|
58
|
+
},
|
|
59
|
+
body: JSON.stringify(body),
|
|
60
|
+
});
|
|
61
|
+
const data = await response.json();
|
|
62
|
+
if (!response.ok) {
|
|
63
|
+
return JSON.stringify({ error: data.error?.message || `API error: ${response.status}` });
|
|
64
|
+
}
|
|
65
|
+
return JSON.stringify(data);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
return JSON.stringify({
|
|
69
|
+
error: `Network error: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -3,37 +3,19 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Calls the NannyKeeper API to calculate household employer taxes.
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
pay_frequency: {
|
|
21
|
-
type: string;
|
|
22
|
-
enum: string[];
|
|
23
|
-
description: string;
|
|
24
|
-
};
|
|
25
|
-
residence_state: {
|
|
26
|
-
type: string;
|
|
27
|
-
description: string;
|
|
28
|
-
};
|
|
29
|
-
reciprocity_certificate_on_file: {
|
|
30
|
-
type: string;
|
|
31
|
-
description: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
required: string[];
|
|
35
|
-
};
|
|
36
|
-
};
|
|
6
|
+
/**
|
|
7
|
+
* ⛔ THE DESCRIPTOR CONST THAT USED TO LIVE HERE WAS DEAD AND HAS BEEN REMOVED.
|
|
8
|
+
*
|
|
9
|
+
* `index.ts` registers this tool with its own description, so the exported
|
|
10
|
+
* const was imported by nothing — and had already drifted from the shipped
|
|
11
|
+
* text in both directions. It cost NK-395 a HIGH on the sibling tool: a
|
|
12
|
+
* customer-facing prompt was rewritten in the dead copy while every agent kept
|
|
13
|
+
* reading the stale live one.
|
|
14
|
+
*
|
|
15
|
+
* If you want a single definition here, export it AND import it in `index.ts`
|
|
16
|
+
* (see `state-filing-status.ts`, which now does). A second copy nobody reads is
|
|
17
|
+
* worse than no copy: it looks like the source of truth and silently is not.
|
|
18
|
+
*/
|
|
37
19
|
export declare function executeCalculate(args: {
|
|
38
20
|
state: string;
|
|
39
21
|
annual_wages: number;
|
package/dist/tools/calculate.js
CHANGED
|
@@ -4,48 +4,19 @@
|
|
|
4
4
|
* Calls the NannyKeeper API to calculate household employer taxes.
|
|
5
5
|
*/
|
|
6
6
|
const API_BASE = process.env.NANNYKEEPER_API_URL || "https://www.nannykeeper.com";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"Use the signup_url in the response to help the user get started.",
|
|
21
|
-
inputSchema: {
|
|
22
|
-
type: "object",
|
|
23
|
-
properties: {
|
|
24
|
-
state: {
|
|
25
|
-
type: "string",
|
|
26
|
-
description: "2-letter US state code where the employee WORKS (e.g., CA, NY, TX, FL)",
|
|
27
|
-
},
|
|
28
|
-
annual_wages: {
|
|
29
|
-
type: "number",
|
|
30
|
-
description: "Annual wages paid to the household employee",
|
|
31
|
-
},
|
|
32
|
-
pay_frequency: {
|
|
33
|
-
type: "string",
|
|
34
|
-
enum: ["weekly", "biweekly", "semimonthly", "monthly"],
|
|
35
|
-
description: "How often the employee is paid (default: biweekly)",
|
|
36
|
-
},
|
|
37
|
-
residence_state: {
|
|
38
|
-
type: "string",
|
|
39
|
-
description: "Employee's residence state (2-letter code) when it differs from the work state. Triggers reciprocity detection for reciprocal pairs (IN/KY, VA/MD, NJ/PA, etc.).",
|
|
40
|
-
},
|
|
41
|
-
reciprocity_certificate_on_file: {
|
|
42
|
-
type: "boolean",
|
|
43
|
-
description: "True when the work state's reciprocity exemption certificate (e.g., Indiana WH-47) is on file with the employer — suppresses the work state's income-tax estimate for reciprocal pairs.",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
required: ["state", "annual_wages"],
|
|
47
|
-
},
|
|
48
|
-
};
|
|
7
|
+
/**
|
|
8
|
+
* ⛔ THE DESCRIPTOR CONST THAT USED TO LIVE HERE WAS DEAD AND HAS BEEN REMOVED.
|
|
9
|
+
*
|
|
10
|
+
* `index.ts` registers this tool with its own description, so the exported
|
|
11
|
+
* const was imported by nothing — and had already drifted from the shipped
|
|
12
|
+
* text in both directions. It cost NK-395 a HIGH on the sibling tool: a
|
|
13
|
+
* customer-facing prompt was rewritten in the dead copy while every agent kept
|
|
14
|
+
* reading the stale live one.
|
|
15
|
+
*
|
|
16
|
+
* If you want a single definition here, export it AND import it in `index.ts`
|
|
17
|
+
* (see `state-filing-status.ts`, which now does). A second copy nobody reads is
|
|
18
|
+
* worse than no copy: it looks like the source of truth and silently is not.
|
|
19
|
+
*/
|
|
49
20
|
export async function executeCalculate(args) {
|
|
50
21
|
const apiKey = process.env.NANNYKEEPER_API_KEY;
|
|
51
22
|
if (!apiKey) {
|
|
@@ -50,6 +50,7 @@ export async function executeRunPayroll(args) {
|
|
|
50
50
|
...(args.confirm_ach_debit !== undefined
|
|
51
51
|
? { confirm_ach_debit: args.confirm_ach_debit }
|
|
52
52
|
: {}),
|
|
53
|
+
...(args.off_cycle !== undefined ? { off_cycle: args.off_cycle } : {}),
|
|
53
54
|
}),
|
|
54
55
|
});
|
|
55
56
|
const data = await response.json();
|
|
@@ -18,13 +18,39 @@
|
|
|
18
18
|
* via /settings/states or call the REST API explicitly with
|
|
19
19
|
* confirmation context.
|
|
20
20
|
*/
|
|
21
|
+
/**
|
|
22
|
+
* ⛔ THE SINGLE DEFINITION, and `index.ts` now imports it.
|
|
23
|
+
*
|
|
24
|
+
* It did not. `index.ts` registered this tool with its OWN inline description
|
|
25
|
+
* string, so this const was exported and imported by nothing — dead. NK-395
|
|
26
|
+
* carefully rewrote it to define `not_required` and to say "never tell them to
|
|
27
|
+
* go register for it", and none of that reached a single agent: the live
|
|
28
|
+
* registration still promised "a registration URL for any that are missing",
|
|
29
|
+
* which is now false, and the word `not_required` appeared in no prompt any
|
|
30
|
+
* model would ever see.
|
|
31
|
+
*
|
|
32
|
+
* 🔑 That is the fourth time on this issue that a fix landed somewhere nothing
|
|
33
|
+
* reads — after a guard keyed on an unbackfilled column, a parameter no caller
|
|
34
|
+
* passed, and a tRPC option nothing forwarded. The pattern is the same every
|
|
35
|
+
* time: **a second copy is the defect generator.** Two of the other tool
|
|
36
|
+
* descriptors in this package are dead the same way and have already drifted
|
|
37
|
+
* from what ships, which is what makes this worth removing rather than
|
|
38
|
+
* policing. Import this; never restate it.
|
|
39
|
+
*/
|
|
21
40
|
export declare const stateFilingStatusTool: {
|
|
22
41
|
name: string;
|
|
23
42
|
description: string;
|
|
24
|
-
inputSchema: {
|
|
25
|
-
type: "object";
|
|
26
|
-
properties: {};
|
|
27
|
-
required: never[];
|
|
28
|
-
};
|
|
29
43
|
};
|
|
30
|
-
|
|
44
|
+
/**
|
|
45
|
+
* ⛔ The `employer_id` passthrough is not optional plumbing.
|
|
46
|
+
*
|
|
47
|
+
* `/api/v1/state-registrations` enforces the test/live boundary (NK-695), and
|
|
48
|
+
* an API key's stamped household is always the user's REAL one. So a server
|
|
49
|
+
* configured with a `nk_test_` key and no way to name a household would get a
|
|
50
|
+
* permanent 403 here — the endpoint "enforced" by being unreachable, which is
|
|
51
|
+
* the exact failure the route's own docblock argues against, just moved one
|
|
52
|
+
* layer up into the tool that calls it. Found by `/code-review` on NK-695.
|
|
53
|
+
*/
|
|
54
|
+
export declare function executeStateFilingStatus(args?: {
|
|
55
|
+
employer_id?: string;
|
|
56
|
+
}): Promise<string>;
|
|
@@ -19,22 +19,57 @@
|
|
|
19
19
|
* confirmation context.
|
|
20
20
|
*/
|
|
21
21
|
const API_BASE = process.env.NANNYKEEPER_API_URL || "https://www.nannykeeper.com";
|
|
22
|
+
/**
|
|
23
|
+
* ⛔ THE SINGLE DEFINITION, and `index.ts` now imports it.
|
|
24
|
+
*
|
|
25
|
+
* It did not. `index.ts` registered this tool with its OWN inline description
|
|
26
|
+
* string, so this const was exported and imported by nothing — dead. NK-395
|
|
27
|
+
* carefully rewrote it to define `not_required` and to say "never tell them to
|
|
28
|
+
* go register for it", and none of that reached a single agent: the live
|
|
29
|
+
* registration still promised "a registration URL for any that are missing",
|
|
30
|
+
* which is now false, and the word `not_required` appeared in no prompt any
|
|
31
|
+
* model would ever see.
|
|
32
|
+
*
|
|
33
|
+
* 🔑 That is the fourth time on this issue that a fix landed somewhere nothing
|
|
34
|
+
* reads — after a guard keyed on an unbackfilled column, a parameter no caller
|
|
35
|
+
* passed, and a tRPC option nothing forwarded. The pattern is the same every
|
|
36
|
+
* time: **a second copy is the defect generator.** Two of the other tool
|
|
37
|
+
* descriptors in this package are dead the same way and have already drifted
|
|
38
|
+
* from what ships, which is what makes this worth removing rather than
|
|
39
|
+
* policing. Import this; never restate it.
|
|
40
|
+
*/
|
|
22
41
|
export const stateFilingStatusTool = {
|
|
23
42
|
name: "get_state_filing_status",
|
|
24
43
|
description: "List the employer's state agency account numbers (last-four only) per " +
|
|
25
44
|
"(state, registration_type) tuple. Returns whether each state has a UC, " +
|
|
26
|
-
"withholding, and SDI account on file, the agency name
|
|
27
|
-
"
|
|
45
|
+
"withholding, and SDI account on file, and the agency name. Each " +
|
|
46
|
+
"account has a status: registered, pending, required, or not_required. " +
|
|
47
|
+
"A registration URL is returned for status=required and status=pending — " +
|
|
48
|
+
"the accounts the employer still has to open or finish. It is null for " +
|
|
49
|
+
"status=registered and status=not_required. status=not_required means " +
|
|
50
|
+
"this household does not owe that registration (e.g. they and their " +
|
|
51
|
+
"employee agreed not to withhold state income tax), so never tell them " +
|
|
52
|
+
"to go register for it. Use before generating " +
|
|
28
53
|
"quarterly filing instructions, or when a customer asks 'do I have my " +
|
|
29
54
|
"state account numbers set up?' Read-only — to update, use the REST " +
|
|
30
55
|
"API or direct the customer to /settings/states.",
|
|
31
|
-
inputSchema
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
56
|
+
// ⛔ No `inputSchema` here on purpose. There used to be one, and it was read
|
|
57
|
+
// by NOTHING — `index.ts` passes its own zod shape to `server.tool()`, so the
|
|
58
|
+
// declaration here reached zero agents exactly the way the inline description
|
|
59
|
+
// above it did. Declare parameters in `index.ts`; a second copy is the defect
|
|
60
|
+
// generator, and on this issue it has now been the dead one five times.
|
|
36
61
|
};
|
|
37
|
-
|
|
62
|
+
/**
|
|
63
|
+
* ⛔ The `employer_id` passthrough is not optional plumbing.
|
|
64
|
+
*
|
|
65
|
+
* `/api/v1/state-registrations` enforces the test/live boundary (NK-695), and
|
|
66
|
+
* an API key's stamped household is always the user's REAL one. So a server
|
|
67
|
+
* configured with a `nk_test_` key and no way to name a household would get a
|
|
68
|
+
* permanent 403 here — the endpoint "enforced" by being unreachable, which is
|
|
69
|
+
* the exact failure the route's own docblock argues against, just moved one
|
|
70
|
+
* layer up into the tool that calls it. Found by `/code-review` on NK-695.
|
|
71
|
+
*/
|
|
72
|
+
export async function executeStateFilingStatus(args) {
|
|
38
73
|
const apiKey = process.env.NANNYKEEPER_API_KEY;
|
|
39
74
|
if (!apiKey) {
|
|
40
75
|
return JSON.stringify({
|
|
@@ -42,7 +77,11 @@ export async function executeStateFilingStatus() {
|
|
|
42
77
|
});
|
|
43
78
|
}
|
|
44
79
|
try {
|
|
45
|
-
const
|
|
80
|
+
const url = new URL(`${API_BASE}/api/v1/state-registrations`);
|
|
81
|
+
if (args?.employer_id) {
|
|
82
|
+
url.searchParams.set("employer_id", args.employer_id);
|
|
83
|
+
}
|
|
84
|
+
const response = await fetch(url, {
|
|
46
85
|
headers: {
|
|
47
86
|
Authorization: `Bearer ${apiKey}`,
|
|
48
87
|
},
|
|
@@ -68,7 +107,14 @@ export async function executeStateFilingStatus() {
|
|
|
68
107
|
agency: r.agency,
|
|
69
108
|
last_four: r.account_number_last_four,
|
|
70
109
|
status: r.status,
|
|
71
|
-
|
|
110
|
+
// ⛔ `not_required` joins `registered` here (NK-395). The upstream
|
|
111
|
+
// route already nulls it, so this is belt-and-braces — but this tool
|
|
112
|
+
// is what an agent actually reads, and handing it a URL for a
|
|
113
|
+
// registration we just said is not required is how the agent ends up
|
|
114
|
+
// nagging the family about an account they do not need.
|
|
115
|
+
registration_url: r.status === "registered" || r.status === "not_required"
|
|
116
|
+
? null
|
|
117
|
+
: r.registration_url,
|
|
72
118
|
})),
|
|
73
119
|
}));
|
|
74
120
|
return JSON.stringify({
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* check_threshold MCP tool
|
|
3
3
|
*
|
|
4
|
-
* Calls the NannyKeeper API to check
|
|
4
|
+
* Calls the NannyKeeper API to check one worker's annual FICA threshold.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* ⛔ THE DESCRIPTOR CONST THAT USED TO LIVE HERE WAS DEAD AND HAS BEEN REMOVED.
|
|
8
|
+
*
|
|
9
|
+
* `index.ts` registers this tool with its own description, so the exported
|
|
10
|
+
* const was imported by nothing — and had already drifted from the shipped
|
|
11
|
+
* text in both directions. It cost NK-395 a HIGH on the sibling tool: a
|
|
12
|
+
* customer-facing prompt was rewritten in the dead copy while every agent kept
|
|
13
|
+
* reading the stale live one.
|
|
14
|
+
*
|
|
15
|
+
* If you want a single definition here, export it AND import it in `index.ts`
|
|
16
|
+
* (see `state-filing-status.ts`, which now does). A second copy nobody reads is
|
|
17
|
+
* worse than no copy: it looks like the source of truth and silently is not.
|
|
5
18
|
*/
|
|
6
|
-
export declare const thresholdTool: {
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
inputSchema: {
|
|
10
|
-
type: "object";
|
|
11
|
-
properties: {
|
|
12
|
-
state: {
|
|
13
|
-
type: string;
|
|
14
|
-
description: string;
|
|
15
|
-
};
|
|
16
|
-
annual_wages: {
|
|
17
|
-
type: string;
|
|
18
|
-
description: string;
|
|
19
|
-
};
|
|
20
|
-
tax_year: {
|
|
21
|
-
type: string;
|
|
22
|
-
description: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
required: string[];
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
19
|
export declare function executeThreshold(args: {
|
|
29
20
|
state: string;
|
|
30
21
|
annual_wages: number;
|
package/dist/tools/threshold.js
CHANGED
|
@@ -1,34 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* check_threshold MCP tool
|
|
3
3
|
*
|
|
4
|
-
* Calls the NannyKeeper API to check
|
|
4
|
+
* Calls the NannyKeeper API to check one worker's annual FICA threshold.
|
|
5
5
|
*/
|
|
6
6
|
const API_BASE = process.env.NANNYKEEPER_API_URL || "https://www.nannykeeper.com";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
annual_wages: {
|
|
21
|
-
type: "number",
|
|
22
|
-
description: "Annual wages paid (or planned) to the household employee",
|
|
23
|
-
},
|
|
24
|
-
tax_year: {
|
|
25
|
-
type: "number",
|
|
26
|
-
description: "Tax year to check (default: current year)",
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
required: ["state", "annual_wages"],
|
|
30
|
-
},
|
|
31
|
-
};
|
|
7
|
+
/**
|
|
8
|
+
* ⛔ THE DESCRIPTOR CONST THAT USED TO LIVE HERE WAS DEAD AND HAS BEEN REMOVED.
|
|
9
|
+
*
|
|
10
|
+
* `index.ts` registers this tool with its own description, so the exported
|
|
11
|
+
* const was imported by nothing — and had already drifted from the shipped
|
|
12
|
+
* text in both directions. It cost NK-395 a HIGH on the sibling tool: a
|
|
13
|
+
* customer-facing prompt was rewritten in the dead copy while every agent kept
|
|
14
|
+
* reading the stale live one.
|
|
15
|
+
*
|
|
16
|
+
* If you want a single definition here, export it AND import it in `index.ts`
|
|
17
|
+
* (see `state-filing-status.ts`, which now does). A second copy nobody reads is
|
|
18
|
+
* worse than no copy: it looks like the source of truth and silently is not.
|
|
19
|
+
*/
|
|
32
20
|
export async function executeThreshold(args) {
|
|
33
21
|
const apiKey = process.env.NANNYKEEPER_API_KEY;
|
|
34
22
|
if (!apiKey) {
|
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "nannykeeper",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.10.1",
|
|
5
5
|
"description": "Calculate US household employer (nanny) taxes for all 50 states. Preview and run payroll, list state agency account numbers, and manage existing Autopilot enrollments. 7 tools: calculate_nanny_taxes, check_threshold, preview_payroll, run_payroll, get_state_filing_status, get_autopilot, manage_autopilot.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "nannykeeper",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nannykeeper/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"mcpName": "com.nannykeeper.www/mcp-server",
|
|
5
5
|
"description": "MCP server for calculating US household employer (nanny) taxes. All 50 states. Works with Claude, ChatGPT, and any MCP-compatible AI agent.",
|
|
6
6
|
"keywords": [
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
"AGENTS.md"
|
|
45
45
|
],
|
|
46
46
|
"scripts": {
|
|
47
|
+
"_comment_prepublishOnly": "⛔ dist/ is gitignored, so it NEVER updates from a git pull — only from a build in that exact directory. 1.9.0 shipped from a checkout whose dist/ was 2.5 months old: no autopilot tools, no NK-395 description, no NK-695 employer_id. A version number said 1.9.0 over mid-June code, and npm versions are immutable, so the only remedy was to burn the number and cut 1.10.0. npm runs this hook in the publish directory immediately before packing, which is the one place a build cannot be in the wrong tree. Do not remove it (NK-696).",
|
|
48
|
+
"prepublishOnly": "npm run build",
|
|
47
49
|
"build": "tsc",
|
|
48
50
|
"dev": "tsc --watch",
|
|
49
51
|
"start": "node dist/index.js",
|