@nannykeeper/mcp-server 1.9.0 → 1.10.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/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 four tools:
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,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 four tools:
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
@@ -19,11 +22,24 @@ import { executeCalculate } from "./tools/calculate.js";
19
22
  import { executeThreshold } from "./tools/threshold.js";
20
23
  import { executePreviewPayroll } from "./tools/preview-payroll.js";
21
24
  import { executeRunPayroll } from "./tools/run-payroll.js";
22
- import { executeStateFilingStatus } from "./tools/state-filing-status.js";
25
+ import { executeStateFilingStatus, stateFilingStatusTool, } from "./tools/state-filing-status.js";
26
+ import { executeGetAutopilot, executeManageAutopilot } from "./tools/autopilot.js";
23
27
  const server = new McpServer({
24
28
  name: "nannykeeper",
25
- version: "1.8.0",
29
+ version: "1.9.0",
26
30
  });
31
+ /**
32
+ * Authority: SSA Contribution and Benefit Base; IRS Pubs. 15 and 926 (2026).
33
+ * Fact: the 2026 Social Security wage base is $184,500; Social Security is
34
+ * 6.2% for both employer and employee; Medicare is 1.45% for each with no cap.
35
+ * Sources: https://www.ssa.gov/oact/COLA/cbb.html
36
+ * https://www.irs.gov/publications/p15
37
+ * https://www.irs.gov/publications/p926
38
+ * Accessed: 2026-08-25.
39
+ * Reasoning: the compiled tool description is shipped inside the MCPB and is
40
+ * independently customer-visible, so its tax facts require the same source
41
+ * provenance as the application calculators.
42
+ */
27
43
  // Register calculate tool
28
44
  server.tool("calculate_nanny_taxes", "Calculate employer and employee tax obligations for a household employee (nanny, caregiver, housekeeper) in any US state. " +
29
45
  "Returns Social Security, Medicare, FUTA, state unemployment, and income tax breakdown. " +
@@ -59,13 +75,13 @@ server.tool("calculate_nanny_taxes", "Calculate employer and employee tax obliga
59
75
  return { content: [{ type: "text", text: result }] };
60
76
  });
61
77
  // Register threshold tool
62
- server.tool("check_threshold", "Check if annual wages to a household employee cross the IRS threshold " +
63
- "($3,000 for 2026) that triggers employer tax obligations (Social Security, Medicare, Schedule H). " +
64
- "Also checks state-specific thresholds (CA $750/quarter, NY $500/quarter, DC $500/quarter). " +
65
- "Use this when someone asks 'Do I need to pay nanny taxes?' or 'Am I a household employer?'", {
78
+ server.tool("check_threshold", "Check whether one household employee's annual wages cross the IRS Social Security and Medicare threshold " +
79
+ "($3,000 for 2026). The response discloses, but cannot assess, household-wide quarterly FUTA and state thresholds " +
80
+ "because this tool does not receive quarterly wages for every employee. It also cannot assess family-employee exemptions " +
81
+ "because it has no relationship input. Never interpret the result as a complete tax-obligation decision.", {
66
82
  state: z.string().describe("2-letter US state code (e.g., CA, NY, TX)"),
67
83
  annual_wages: z.number().describe("Annual wages paid (or planned) to the household employee"),
68
- tax_year: z.number().optional().describe("Tax year to check (default: current year)"),
84
+ tax_year: z.number().min(2024).max(2026).optional().describe("Supported tax year to check (2024-2026; default: current year)"),
69
85
  }, {
70
86
  title: "Check Tax Threshold",
71
87
  readOnlyHint: true,
@@ -167,6 +183,10 @@ server.tool("run_payroll", "Run payroll for a household employee end-to-end in a
167
183
  .boolean()
168
184
  .optional()
169
185
  .describe("Required for first-time direct-deposit payroll or when the last DD authorization is >30 days old."),
186
+ off_cycle: z
187
+ .boolean()
188
+ .optional()
189
+ .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
190
  voluntary_set_aside: z
171
191
  .object({
172
192
  skip: z.boolean().optional().describe("Skip the active set-aside rule for this paycheck only"),
@@ -189,22 +209,83 @@ server.tool("run_payroll", "Run payroll for a household employee end-to-end in a
189
209
  return { content: [{ type: "text", text: result }] };
190
210
  });
191
211
  // Register get_state_filing_status tool
192
- server.tool("get_state_filing_status", "List the employer's state agency account numbers (last-four only) per " +
193
- "(state, registration_type) tuple — UC, withholding, SDI. Returns the " +
194
- "agency name and a registration URL for any that are missing. Use " +
195
- "before generating quarterly filing instructions (e.g., 'file Form UC-2 " +
196
- "for Q2 — your PA UC account is ••••5678') or when a customer asks " +
197
- "whether their state setup is complete. Read-only. To update, use the " +
198
- "POST /api/v1/state-registrations REST endpoint or direct the customer " +
199
- "to /settings/states — LLMs shouldn't fabricate account numbers since " +
200
- "they land on real tax filings.", {}, {
212
+ server.tool(stateFilingStatusTool.name,
213
+ // ⛔ IMPORTED, not restated. The inline copy that used to sit here was the
214
+ // one agents actually read, and it drifted out of date the moment NK-395
215
+ // edited the exported descriptor instead — promising "a registration URL for
216
+ // any that are missing" long after that stopped being true.
217
+ stateFilingStatusTool.description, {
218
+ // ⛔ THIS is the shape agents actually see — the `{}` that used to sit here
219
+ // is why the descriptor's own `inputSchema` was read by nothing and has now
220
+ // been deleted rather than extended (NK-695). Declaring a parameter there
221
+ // would have reached zero agents, which is the fifth time on this issue
222
+ // that a second copy turned out to be the dead one.
223
+ employer_id: z
224
+ .string()
225
+ .uuid()
226
+ .optional()
227
+ .describe("Optional. The household to read, when the account has more than one. " +
228
+ "Defaults to the household this API key belongs to — leave unset for " +
229
+ "a single-household customer. Needed for a test-mode (nk_test_) key, " +
230
+ "whose default household is the REAL one: pass the sandbox id."),
231
+ }, {
201
232
  title: "Get State Filing Status",
202
233
  readOnlyHint: true,
203
234
  destructiveHint: false,
204
235
  idempotentHint: true,
205
236
  openWorldHint: true,
206
- }, async () => {
207
- const result = await executeStateFilingStatus();
237
+ }, async ({ employer_id }) => {
238
+ const result = await executeStateFilingStatus({ employer_id });
239
+ return { content: [{ type: "text", text: result }] };
240
+ });
241
+ // Register get_autopilot tool (read)
242
+ server.tool("get_autopilot", "Read Autopilot status (recurring auto-run payroll). With employee_id: the live enrollment " +
243
+ "(status, standard hours, expected net, next pay date) plus eligibility and a 3-payday schedule " +
244
+ "preview — or, if not enrolled, WHY (the eligibility reason, e.g. not_plus / insufficient_history). " +
245
+ "Without employee_id: the list of the employer's active enrollments. Read-only. " +
246
+ "Requires a Plus/Professional key. To get employer_id/employee_id: GET /api/v1/employees?employer_id=YOUR_ID.", {
247
+ employer_id: z.string().uuid().describe("Employer UUID — visible in your NannyKeeper dashboard URL"),
248
+ employee_id: z
249
+ .string()
250
+ .uuid()
251
+ .optional()
252
+ .describe("Employee UUID — omit to list all active enrollments for the employer"),
253
+ }, {
254
+ title: "Get Autopilot Status",
255
+ readOnlyHint: true,
256
+ destructiveHint: false,
257
+ idempotentHint: true,
258
+ openWorldHint: true,
259
+ }, async (args) => {
260
+ const result = await executeGetAutopilot(args);
261
+ return { content: [{ type: "text", text: result }] };
262
+ });
263
+ // Register manage_autopilot tool (pause/resume/skip/disable)
264
+ server.tool("manage_autopilot", "Manage an EXISTING Autopilot enrollment for a household employee. Actions: " +
265
+ "`pause` (stop new generation — an already-scheduled run still fires unless voided from the payroll page), " +
266
+ "`resume` (re-checks eligibility + clears the failure counter), " +
267
+ "`skip` (skip the next period; with through_date, skip every period up to that date for a vacation), " +
268
+ "`disable` (turn Autopilot off — soft-deleted so the ledger + ACH authorization are retained; the employee can re-enroll in-app). " +
269
+ "Turning Autopilot ON is NOT available here — it captures a standing recurring ACH authorization that must be " +
270
+ "done by the employer in the app. Requires a Plus/Professional key. Confirm the action with the user before calling.", {
271
+ employer_id: z.string().uuid().describe("Employer UUID"),
272
+ employee_id: z.string().uuid().describe("Employee UUID whose enrollment to manage"),
273
+ action: z
274
+ .enum(["pause", "resume", "skip", "disable"])
275
+ .describe("What to do: pause | resume | skip | disable"),
276
+ through_date: z
277
+ .string()
278
+ .regex(/^\d{4}-\d{2}-\d{2}$/)
279
+ .optional()
280
+ .describe("skip only: skip every upcoming period up to this date (YYYY-MM-DD) for a multi-week vacation"),
281
+ }, {
282
+ title: "Manage Autopilot",
283
+ readOnlyHint: false,
284
+ destructiveHint: false,
285
+ idempotentHint: false,
286
+ openWorldHint: true,
287
+ }, async (args) => {
288
+ const result = await executeManageAutopilot(args);
208
289
  return { content: [{ type: "text", text: result }] };
209
290
  });
210
291
  // 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
- export declare const calculateTool: {
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
- 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;
@@ -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
- export const calculateTool = {
8
- name: "calculate_nanny_taxes",
9
- description: "Calculate employer and employee tax obligations for a household employee (nanny, caregiver, housekeeper) in any US state. " +
10
- "Returns Social Security, Medicare, FUTA, state unemployment, and income tax breakdown. " +
11
- "Also includes per-paycheck cost and threshold status. " +
12
- "State income-tax reciprocity: if the employee LIVES in a different state than they work " +
13
- "(e.g., lives in Kentucky, works in Indiana), pass residence_state — for reciprocal pairs the " +
14
- "response includes a `reciprocity` block naming the exemption certificate; pass " +
15
- "reciprocity_certificate_on_file=true to suppress the work state's income tax " +
16
- "(local taxes and unemployment insurance are unaffected). " +
17
- "Note: Returns single-period estimates assuming zero prior wages. " +
18
- "For ongoing payroll with year-to-date tracking, pay stubs, W-2s, and direct deposit, " +
19
- "the user needs a NannyKeeper account (free to start, $10/mo for full payroll). " +
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) {
@@ -23,5 +23,6 @@ export declare function executeRunPayroll(args: {
23
23
  skip?: boolean;
24
24
  amount?: number;
25
25
  };
26
+ off_cycle?: boolean;
26
27
  idempotency_key?: string;
27
28
  }): Promise<string>;
@@ -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
- export declare function executeStateFilingStatus(): Promise<string>;
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, and a " +
27
- "registration URL for any that are missing. Use before generating " +
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
- type: "object",
33
- properties: {},
34
- required: [],
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
- export async function executeStateFilingStatus() {
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 response = await fetch(`${API_BASE}/api/v1/state-registrations`, {
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
- registration_url: r.status === "registered" ? null : r.registration_url,
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 if wages cross the household employer threshold.
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;
@@ -1,34 +1,22 @@
1
1
  /**
2
2
  * check_threshold MCP tool
3
3
  *
4
- * Calls the NannyKeeper API to check if wages cross the household employer threshold.
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
- export const thresholdTool = {
8
- name: "check_threshold",
9
- description: "Check if annual wages to a household employee cross the IRS threshold " +
10
- "($3,000 for 2026) that triggers employer tax obligations (Social Security, Medicare, Schedule H). " +
11
- "Also checks state-specific thresholds where applicable (CA $750/quarter, NY $500/quarter, DC $500/quarter). " +
12
- "Use this when someone asks 'Do I need to pay nanny taxes?' or 'Am I a household employer?'",
13
- inputSchema: {
14
- type: "object",
15
- properties: {
16
- state: {
17
- type: "string",
18
- description: "2-letter US state code (e.g., CA, NY, TX)",
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.9.0",
4
+ "version": "1.10.0",
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.9.0",
3
+ "version": "1.10.0",
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",