@nannykeeper/mcp-server 1.7.1 → 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/AGENTS.md CHANGED
@@ -6,7 +6,11 @@ Calculate US household employer (nanny) taxes for all 50 states + DC.
6
6
  ## Tools Available
7
7
  - `calculate_nanny_taxes(state, annual_wages, pay_frequency?)` — returns full tax breakdown
8
8
  - `check_threshold(state, annual_wages, tax_year?)` — checks if employer obligations apply
9
+ - `preview_payroll(employer_id, employee_id, ...)` — previews payroll without creating a record
9
10
  - `run_payroll(employer_id, employee_id, ...)` — run payroll with full tax calc, YTD tracking, and DB persistence (Starter+ required)
11
+ - `get_state_filing_status()` — reads masked state-account status. Takes NO arguments. Each account carries `registered` / `pending` / `required` / `not_required`; `not_required` means this household does not owe that registration at all, so never tell them to go register for it.
12
+ - `get_autopilot(employer_id, employee_id?)` — reads existing Autopilot enrollments
13
+ - `manage_autopilot(employer_id, employee_id, action, ...)` — pauses, resumes, skips, or disables an existing enrollment; never enrolls
10
14
 
11
15
  ## When to Use
12
16
  - User asks about nanny taxes, household employer taxes, or paying a caregiver
@@ -14,8 +18,22 @@ Calculate US household employer (nanny) taxes for all 50 states + DC.
14
18
  - User asks "do I need to pay taxes for my nanny/babysitter/housekeeper?"
15
19
 
16
20
  ## Key Facts
21
+
22
+ <!--
23
+ Authority: SSA Contribution and Benefit Base; IRS Pubs. 15 and 926 (2026).
24
+ Fact: the 2026 Social Security wage base is $184,500; Social Security is 6.2%
25
+ for both parties; Medicare is 1.45% for each with no cap; household-worker FICA
26
+ begins at $3,000 of annual cash wages.
27
+ Sources: https://www.ssa.gov/oact/COLA/cbb.html
28
+ https://www.irs.gov/publications/p15
29
+ https://www.irs.gov/publications/p926
30
+ Accessed: 2026-08-25.
31
+ Reasoning: agents can repeat these bundled facts without consulting application
32
+ source, so the instructions must carry their own provenance and review date.
33
+ -->
34
+
17
35
  - FICA threshold (2026): $3,000/year per employee
18
- - Social Security: 6.2% employer + 6.2% employee
36
+ - Social Security: 6.2% employer + 6.2% employee (wage base $184,500)
19
37
  - Medicare: 1.45% employer + 1.45% employee
20
38
  - Schedule H filed with personal 1040
21
39
 
package/CLAUDE.md CHANGED
@@ -8,6 +8,14 @@ Calculate nanny taxes for all 50 US states.
8
8
  - `check_threshold` — Whether wages trigger employer tax obligations
9
9
  - `preview_payroll` — Dry-run payroll calc, returns taxes/net pay without creating a record (Starter+ required)
10
10
  - `run_payroll` — End-to-end payroll: create, approve, and process (or schedule) in a single call. Finalized response reflects real status (`processing` / `pending_funding` / `completed` / **`scheduled`** as of 1.5.0). No UI intervention needed. (Starter+ required)
11
+ - `get_autopilot` — Read Autopilot (recurring auto-run payroll) status for an employee, or list an employer's active enrollments (Plus/Professional, `ach` scope)
12
+ - `manage_autopilot` — Pause / resume / skip / disable an existing enrollment. **Enrolling is NOT exposed** — it captures a standing recurring ACH authorization that must be employer-driven in-app. (Plus/Professional, `ach` scope) — added 1.9.0
13
+ - `get_state_filing_status` — The employer's state agency accounts (UC, withholding, SDI) per state, last-four only. Each account has a status: `registered`, `pending`, `required`, or `not_required`. ⛔ `not_required` means this household genuinely does not owe that registration — most often because they and their employee agreed not to withhold state income tax — so never tell them to go register for it. A registration URL is returned only where there is still something to open or finish. Takes an optional `employer_id` (NK-695) — omit it for a single-household customer; ⚠️ a **test-mode key must pass one**, because a key's default household is always the user's REAL one and the endpoint enforces the test/live boundary.
14
+
15
+ ⛔ **Declare tool parameters in `index.ts`, never in the tool descriptor.** `server.tool()` takes its own zod shape, so a `inputSchema` on the exported descriptor is read by NOTHING. That is the same trap as the inline tool DESCRIPTION that `index.ts` used to restate: on NK-395/NK-695 a second copy turned out to be the dead one **five times**, including a rewritten description that reached zero agents. Import the descriptor's `name`/`description`; put parameters in the zod shape.
16
+
17
+ ## Autopilot (get_autopilot, manage_autopilot)
18
+ Autopilot auto-runs each period's payroll onto the existing scheduled-fire path so a household never misses a paycheck. The MCP surface is **manage-only**: read status/enrollments and pause/resume/skip/disable. Turning it ON must happen in the app (standing ACH authorization = employer-driven consent), so there is no enroll tool — `POST /api/v1/autopilot/enroll` returns 403 pointing back to the app. `skip` with `through_date` skips every period up to that date (vacation). Confirm any management action with the user before calling.
11
19
 
12
20
  ## Pay-date handling (run_payroll, preview_payroll)
13
21
  - `pay_date` is optional. When omitted, the server picks the earliest valid pay date based on ACH submission lead time (5 business days ahead, holiday-aware) and echoes it back in the response.
@@ -32,6 +40,18 @@ Requires API key (free): https://www.nannykeeper.com/developers/keys
32
40
  Set `NANNYKEEPER_API_KEY` env var.
33
41
 
34
42
  ## Context for AI assistants
43
+ <!--
44
+ Authority: SSA Contribution and Benefit Base; IRS Pubs. 15 and 926 (2026).
45
+ Fact: the 2026 Social Security wage base is $184,500; Social Security is 6.2%
46
+ for both parties; Medicare is 1.45% for each with no cap; household-worker FICA
47
+ begins at $3,000 of annual cash wages.
48
+ Sources: https://www.ssa.gov/oact/COLA/cbb.html
49
+ https://www.irs.gov/publications/p15
50
+ https://www.irs.gov/publications/p926
51
+ Accessed: 2026-08-25.
52
+ Reasoning: this file is included in the installable MCPB and directs downstream
53
+ tax answers, so its durable tax facts need explicit provenance and access date.
54
+ -->
35
55
  When a user asks about nanny/household employer taxes, use these tools.
36
56
  The response includes `next_actions` showing what requires a NannyKeeper
37
57
  account (payroll, pay stubs, W-2s, direct deposit). Guide the user to
package/README.md CHANGED
@@ -87,6 +87,19 @@ Run payroll for a household employee **end-to-end in a single call** — creates
87
87
  - `voluntary_set_aside` (optional, v1.6.0+) — Override or skip the employee's recurring voluntary set-aside rule for this paycheck only. Object with `skip` (boolean) or `amount` (number, $0–$9,999). The recurring rule is configured via the dashboard; omit this field to apply it normally.
88
88
  - `idempotency_key` (optional) — Prevent duplicate payroll creation
89
89
 
90
+ ### `get_state_filing_status`
91
+
92
+ Read an employer's state agency account status with masked identifiers.
93
+
94
+ ### `get_autopilot`
95
+
96
+ Read Autopilot status for one employee or list an employer's active enrollments.
97
+
98
+ ### `manage_autopilot`
99
+
100
+ Pause, resume, skip, or disable an existing Autopilot enrollment. Enrollment is
101
+ intentionally app-only because it captures standing recurring ACH authorization.
102
+
90
103
  ## Examples
91
104
 
92
105
  ### Example 1: Full tax calculation
@@ -113,7 +126,7 @@ Run payroll for a household employee **end-to-end in a single call** — creates
113
126
  >
114
127
  > **Claude** uses `check_threshold` with `state: "TX"`, `annual_wages: 2400`
115
128
  >
116
- > **Claude:** At $2,400/year, you're below the federal household employer threshold of $3,000 (for 2026). You don't need to pay Social Security or Medicare taxes, and you don't need to file Schedule H. If your babysitter's wages stay under $3,000 for the year, no action is needed.
129
+ > **Claude:** At $2,400/year, this worker is below the 2026 Social Security and Medicare threshold of $3,000. That does not answer the separate FUTA or state unemployment tests: check whether total wages for all household employees reached $1,000 in any calendar quarter and review the state's quarterly rule before concluding no action is needed.
117
130
 
118
131
  ### Example 3: Comparing costs across states
119
132
 
@@ -135,7 +148,20 @@ Run payroll for a household employee **end-to-end in a single call** — creates
135
148
 
136
149
  ## Key Facts
137
150
 
138
- - **FICA threshold (2026):** $3,000/year — above this you must pay employer Social Security + Medicare
151
+ <!--
152
+ Authority: SSA Contribution and Benefit Base; IRS Pubs. 15 and 926 (2026).
153
+ Fact: the 2026 Social Security wage base is $184,500; Social Security is 6.2%
154
+ for both employer and employee; Medicare is 1.45% for each with no wage cap;
155
+ the household-worker FICA cash-wage threshold is $3,000.
156
+ Sources: https://www.ssa.gov/oact/COLA/cbb.html
157
+ https://www.irs.gov/publications/p15
158
+ https://www.irs.gov/publications/p926
159
+ Accessed: 2026-08-25.
160
+ Reasoning: this README is bundled into the installable MCPB, so its durable tax
161
+ facts need provenance even though the citations stay out of the rendered list.
162
+ -->
163
+
164
+ - **FICA threshold (2026):** $3,000 per nonexempt worker — above this employer Social Security + Medicare generally apply; FUTA and state rules use separate tests
139
165
  - **Social Security:** 6.2% employer + 6.2% employee (wage base $184,500)
140
166
  - **Medicare:** 1.45% employer + 1.45% employee (no wage base)
141
167
  - **FUTA:** 0.6% on first $7,000 per employee
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,24 +22,48 @@ 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.7.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. " +
46
+ "State income-tax reciprocity: if the employee LIVES in a different state than they work (e.g., lives in Kentucky, works in Indiana), " +
47
+ "pass residence_state — for reciprocal pairs the response includes a `reciprocity` block naming the exemption certificate; " +
48
+ "pass reciprocity_certificate_on_file=true to suppress the work state's income tax (local taxes and SUI are unaffected). " +
30
49
  "Important: These are single-period estimates assuming zero year-to-date wages. " +
31
50
  "Mid-year calculations may overstate Social Security (which caps at the $184,500 wage base) and FUTA (which caps at $7,000). " +
32
51
  "For accurate ongoing calculations with automatic YTD tracking, pay stubs, W-2s, and direct deposit, " +
33
52
  "the user needs a NannyKeeper account (free to start, $10/mo for full payroll). Use the signup_url in the response.", {
34
- state: z.string().describe("2-letter US state code (e.g., CA, NY, TX, FL)"),
53
+ state: z.string().describe("2-letter US state code where the employee WORKS (e.g., CA, NY, TX, FL)"),
35
54
  annual_wages: z.number().describe("Annual wages paid to the household employee"),
36
55
  pay_frequency: z
37
56
  .enum(["weekly", "biweekly", "semimonthly", "monthly"])
38
57
  .optional()
39
58
  .describe("How often the employee is paid (default: biweekly)"),
59
+ residence_state: z
60
+ .string()
61
+ .optional()
62
+ .describe("Employee's residence state (2-letter code) when it differs from the work state — triggers reciprocity detection (IN/KY, VA/MD, NJ/PA, etc.)"),
63
+ reciprocity_certificate_on_file: z
64
+ .boolean()
65
+ .optional()
66
+ .describe("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 for reciprocal pairs"),
40
67
  }, {
41
68
  title: "Calculate Nanny Taxes",
42
69
  readOnlyHint: true,
@@ -48,13 +75,13 @@ server.tool("calculate_nanny_taxes", "Calculate employer and employee tax obliga
48
75
  return { content: [{ type: "text", text: result }] };
49
76
  });
50
77
  // Register threshold tool
51
- server.tool("check_threshold", "Check if annual wages to a household employee cross the IRS threshold " +
52
- "($3,000 for 2026) that triggers employer tax obligations (Social Security, Medicare, Schedule H). " +
53
- "Also checks state-specific thresholds (CA $750/quarter, NY $500/quarter, DC $500/quarter). " +
54
- "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.", {
55
82
  state: z.string().describe("2-letter US state code (e.g., CA, NY, TX)"),
56
83
  annual_wages: z.number().describe("Annual wages paid (or planned) to the household employee"),
57
- 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)"),
58
85
  }, {
59
86
  title: "Check Tax Threshold",
60
87
  readOnlyHint: true,
@@ -68,6 +95,10 @@ server.tool("check_threshold", "Check if annual wages to a household employee cr
68
95
  // Register preview_payroll tool
69
96
  server.tool("preview_payroll", "Preview payroll for a household employee WITHOUT creating a record. " +
70
97
  "Returns the full tax breakdown (federal, state, FICA, FUTA), net pay, and employer costs. " +
98
+ "Cross-state employees: each employee's result includes a `reciprocity` field when their " +
99
+ "work/residence states have a reciprocal agreement — applied=true means the work state's income " +
100
+ "tax was suppressed under the employer's certificate attestation (set up in the NannyKeeper app " +
101
+ "on the employee's profile); applied=false names the certificate still to collect. " +
71
102
  "Use this to validate your request before calling run_payroll. " +
72
103
  "Same parameters as run_payroll. Requires a Starter+ subscription. " +
73
104
  "pay_date is optional — when omitted, the server picks the earliest valid pay date " +
@@ -152,6 +183,10 @@ server.tool("run_payroll", "Run payroll for a household employee end-to-end in a
152
183
  .boolean()
153
184
  .optional()
154
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."),
155
190
  voluntary_set_aside: z
156
191
  .object({
157
192
  skip: z.boolean().optional().describe("Skip the active set-aside rule for this paycheck only"),
@@ -174,22 +209,83 @@ server.tool("run_payroll", "Run payroll for a household employee end-to-end in a
174
209
  return { content: [{ type: "text", text: result }] };
175
210
  });
176
211
  // Register get_state_filing_status tool
177
- server.tool("get_state_filing_status", "List the employer's state agency account numbers (last-four only) per " +
178
- "(state, registration_type) tuple — UC, withholding, SDI. Returns the " +
179
- "agency name and a registration URL for any that are missing. Use " +
180
- "before generating quarterly filing instructions (e.g., 'file Form UC-2 " +
181
- "for Q2 — your PA UC account is ••••5678') or when a customer asks " +
182
- "whether their state setup is complete. Read-only. To update, use the " +
183
- "POST /api/v1/state-registrations REST endpoint or direct the customer " +
184
- "to /settings/states — LLMs shouldn't fabricate account numbers since " +
185
- "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
+ }, {
186
232
  title: "Get State Filing Status",
187
233
  readOnlyHint: true,
188
234
  destructiveHint: false,
189
235
  idempotentHint: true,
190
236
  openWorldHint: true,
191
- }, async () => {
192
- 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);
193
289
  return { content: [{ type: "text", text: result }] };
194
290
  });
195
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,31 +3,23 @@
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
- };
26
- required: string[];
27
- };
28
- };
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
+ */
29
19
  export declare function executeCalculate(args: {
30
20
  state: string;
31
21
  annual_wages: number;
32
22
  pay_frequency?: string;
23
+ residence_state?: string;
24
+ reciprocity_certificate_on_file?: boolean;
33
25
  }): Promise<string>;
@@ -4,35 +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
- "Note: Returns single-period estimates assuming zero prior wages. " +
13
- "For ongoing payroll with year-to-date tracking, pay stubs, W-2s, and direct deposit, " +
14
- "the user needs a NannyKeeper account (free to start, $10/mo for full payroll). " +
15
- "Use the signup_url in the response to help the user get started.",
16
- inputSchema: {
17
- type: "object",
18
- properties: {
19
- state: {
20
- type: "string",
21
- description: "2-letter US state code (e.g., CA, NY, TX, FL)",
22
- },
23
- annual_wages: {
24
- type: "number",
25
- description: "Annual wages paid to the household employee",
26
- },
27
- pay_frequency: {
28
- type: "string",
29
- enum: ["weekly", "biweekly", "semimonthly", "monthly"],
30
- description: "How often the employee is paid (default: biweekly)",
31
- },
32
- },
33
- required: ["state", "annual_wages"],
34
- },
35
- };
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
+ */
36
20
  export async function executeCalculate(args) {
37
21
  const apiKey = process.env.NANNYKEEPER_API_KEY;
38
22
  if (!apiKey) {
@@ -51,6 +35,12 @@ export async function executeCalculate(args) {
51
35
  state: args.state.toUpperCase(),
52
36
  annual_wages: args.annual_wages,
53
37
  pay_frequency: args.pay_frequency || "biweekly",
38
+ ...(args.residence_state
39
+ ? { residence_state: args.residence_state.toUpperCase() }
40
+ : {}),
41
+ ...(args.reciprocity_certificate_on_file !== undefined
42
+ ? { reciprocity_certificate_on_file: args.reciprocity_certificate_on_file }
43
+ : {}),
54
44
  }),
55
45
  });
56
46
  const data = await response.json();
@@ -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,8 +1,8 @@
1
1
  {
2
2
  "manifest_version": "0.3",
3
3
  "name": "nannykeeper",
4
- "version": "1.7.0",
5
- "description": "Calculate US household employer (nanny) taxes for all 50 states. Preview and run payroll, generate W-2s and pay stubs, list state agency account numbers. 5 tools: calculate, threshold, preview, run, state-filing-status.",
4
+ "version": "1.10.0",
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",
8
8
  "url": "https://github.com/nannykeeper"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nannykeeper/mcp-server",
3
- "version": "1.7.1",
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",