@nannykeeper/mcp-server 1.15.0 → 1.16.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
@@ -11,6 +11,8 @@ Calculate US household employer (nanny) taxes for all 50 states + DC.
11
11
  - `run_payroll(employee_id, ..., employer_id?)` — run payroll with full tax calc, YTD tracking, and DB persistence (Starter+ required)
12
12
  - `get_payroll(payroll_id?, employer_id?)` — reads one payroll (every deduction, net pay, status) or lists them
13
13
  - `get_pay_stub(payroll_id, employer_id?)` — returns each employee's pay stub PDF
14
+ - `get_w2(employee_id, tax_year, copy?, employer_id?)`: returns `download_url`, a link that works for 15 minutes, for one copy of a W-2 the household has already generated in NannyKeeper. Give the user the link and tell them to open it in their browser. Never the PDF, and never open the link yourself. Never generates a W-2
15
+ - `get_schedule_h(tax_year, employer_id?)`: returns `download_url`, a link that works for 15 minutes, for the household's Schedule H, or `schedule_h_unavailable` with a reason. Give the user the link
14
16
  - `get_state_filing_status(employer_id?)` — reads masked state-account status. Pass an owned household ID when selecting a household; test-mode keys must explicitly select a sandbox household. Omitting it uses the key's default household. 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.
15
17
  - `get_autopilot(employer_id?, employee_id?)` — reads existing Autopilot enrollments
16
18
  - `manage_autopilot(employee_id, action, ..., employer_id?)` — pauses, resumes, skips, or disables an existing enrollment; never enrolls
@@ -31,8 +33,9 @@ obligation. Ask for missing household details when needed.
31
33
  ## After Calculation
32
34
  The `calculate_nanny_taxes` response includes `next_actions` and a `signup_url`.
33
35
  If the user wants to run payroll with persistence, use the `run_payroll` tool
34
- (requires Starter+ subscription). `get_pay_stub` returns pay stubs; W-2s,
35
- Schedule H and direct deposit setup are in the NannyKeeper web app.
36
+ (requires Starter+ subscription). `get_pay_stub` returns pay stubs as PDFs. `get_w2` and `get_schedule_h` return a
37
+ download link for the user to open. Generating a W-2 and direct deposit setup
38
+ are in the NannyKeeper web app.
36
39
 
37
40
  `employer_id` is optional on every tool. Leave it out for a single-household key.
38
41
 
package/CLAUDE.md CHANGED
@@ -7,6 +7,8 @@ Calculate nanny taxes for all 50 US states.
7
7
  - `list_employees` — The household's employer_id and every employee's id, pay setup and missing payroll items. The first call in any payroll flow (added 1.15.0)
8
8
  - `get_payroll` — One payroll by id (every deduction incl. local tax, net pay, employer taxes, status) or the household's payroll list (added 1.15.0)
9
9
  - `get_pay_stub` — Each employee's pay stub PDF for a payroll, returned as an embedded PDF resource, the dashboard's own stub (added 1.15.0)
10
+ - `get_w2`: a 15-minute DOWNLOAD LINK (`download_url`) for one copy of an employee's W-2 for an ended tax year. ⛔ Never the PDF: a W-2 prints the full SSN and a tool result is read by the assistant's model, so the tool always asks the API for `delivery: "link"` and the person opens the link. Do not "align" it with `get_pay_stub`'s attached file. Only a W-2 the household already generated in the dashboard; never generates one (`w2_not_generated`). Hosted and npm identical (added 1.16.0)
11
+ - `get_schedule_h`: a 15-minute download link for the household's Schedule H for an ended tax year, through the dashboard's own Download procedure; its refusals come back as `schedule_h_unavailable` with a `reason`. A link for the same reason as `get_w2` (added 1.16.0)
10
12
  - `calculate_nanny_taxes` — Full federal + state tax breakdown
11
13
  - `check_threshold` — Whether wages trigger employer tax obligations
12
14
  - `preview_payroll` — Dry-run payroll calc, returns taxes/net pay without creating a record (Starter+ required)
package/README.md CHANGED
@@ -73,6 +73,30 @@ Only a paid payroll has stubs; anything else answers `payroll_not_completed`.
73
73
  - `employee_id` (optional) — One employee's stub instead of everyone's
74
74
  - `employer_id` (optional)
75
75
 
76
+ ### `get_w2`
77
+
78
+ A download link for one copy of an employee's W-2, for a tax year that has ended. It is the same W-2 the household downloads in the dashboard.
79
+
80
+ The tool returns `download_url`, a link on nannykeeper.com that works for 15 minutes. The assistant gives the link to the person, who opens it in their browser. The PDF itself is never a tool result: a W-2 shows the employee's full Social Security number, so it goes from NannyKeeper to the person and not through the assistant.
81
+
82
+ The household generates the W-2 in the dashboard first (Taxes, then W-2s). Until then the answer is `w2_not_generated`; this tool never generates one.
83
+
84
+ **Parameters:**
85
+ - `employee_id` (required): from `list_employees`
86
+ - `tax_year` (required): a tax year that has ended
87
+ - `copy` (optional): `A`, `B`, `C`, `D`, `1` or `2`. Defaults to `B`
88
+ - `employer_id` (optional)
89
+
90
+ ### `get_schedule_h`
91
+
92
+ A download link for the household's Schedule H, for a tax year that has ended. It is the same form the household downloads in the dashboard. Like `get_w2`, it returns `download_url`, a link that works for 15 minutes, and never the PDF.
93
+
94
+ When the dashboard would not produce the form, the answer is `schedule_h_unavailable` with a `reason`: `year_not_ended`, `no_household_data`, `prior_wage_overlap`, `prior_wage_withholding_unknown` or `futa_prior_year_unanswered`. NannyKeeper does not file the form.
95
+
96
+ **Parameters:**
97
+ - `tax_year` (required): a tax year that has ended
98
+ - `employer_id` (optional)
99
+
76
100
  ### `calculate_nanny_taxes`
77
101
 
78
102
  Calculate employer and employee tax obligations for a household employee.
@@ -8,6 +8,8 @@ export const publicDescriptions = {
8
8
  list_employees: "List the connected household's employees with their pay setup and what is still missing for payroll. Returns the employee IDs the payroll tools need. Read-only.",
9
9
  get_payroll: "Read one payroll by ID, or list the household's payrolls. Returns status, dates, gross pay, each deduction, net pay, and employer taxes. Report the exact status; scheduled or processing does not mean paid.",
10
10
  get_pay_stub: "Get the pay stub PDF for each employee on a paid payroll, the same stub the household downloads in NannyKeeper. A payroll that is not paid yet answers payroll_not_completed. Safe to repeat.",
11
+ get_w2: "Get a download link for one copy of an employee's W-2 for a tax year that has ended. Returns download_url, a link on nannykeeper.com that works for 15 minutes; give it to the user and tell them to open it in their browser. This tool never returns the PDF, and you must not open the link yourself. The household generates the W-2 in NannyKeeper first; until then this answers w2_not_generated, and this tool never generates one. Safe to repeat.",
12
+ get_schedule_h: "Get a download link for the household's Schedule H for a tax year that has ended. Returns download_url, a link on nannykeeper.com that works for 15 minutes; give it to the user and tell them to open it in their browser. This tool never returns the PDF, and you must not open the link yourself. When NannyKeeper would not produce the form this answers schedule_h_unavailable with a reason; report that reason faithfully. NannyKeeper does not file the form. Safe to repeat.",
11
13
  get_autopilot: "Read existing recurring payroll enrollment status for a household, optionally for one employee. Returns status and available schedule information; it does not enroll anyone or change payroll.",
12
14
  manage_autopilot: "Pause, resume, skip, or disable an existing recurring payroll enrollment. Confirm the employee and exact action before calling. Resume can restart future payroll generation and Stripe processing. Pausing does not cancel a payroll that is already scheduled. To cancel an existing payroll, use NannyKeeper. Initial enrollment and its standing authorization happen in NannyKeeper.",
13
15
  };
package/dist/server.js CHANGED
@@ -6,7 +6,7 @@ import { executePreviewPayroll } from "./tools/preview-payroll.js";
6
6
  import { executeRunPayroll } from "./tools/run-payroll.js";
7
7
  import { executeStateFilingStatus, stateFilingStatusTool, } from "./tools/state-filing-status.js";
8
8
  import { executeGetAutopilot, executeManageAutopilot } from "./tools/autopilot.js";
9
- import { executeGetPayStub, executeGetPayroll, executeListEmployees, } from "./tools/household.js";
9
+ import { executeGetPayStub, executeGetW2, executeGetScheduleH, executeGetPayroll, executeListEmployees, } from "./tools/household.js";
10
10
  import { publicDescriptions, toolResult } from "./public-profile.js";
11
11
  /**
12
12
  * `employer_id` on every household tool (1.15.0). The API defaults it to the
@@ -343,5 +343,47 @@ export function createNannyKeeperServer(version, context) {
343
343
  }
344
344
  return result;
345
345
  });
346
+ // ⛔ get_w2 and get_schedule_h return a download LINK, never the PDF, on the
347
+ // hosted connector and the npm package alike. A
348
+ // W-2 prints the employee's full Social Security number and a tool result is
349
+ // read by the assistant's model, so the form goes from NannyKeeper to the
350
+ // person's browser and the assistant only passes the link along.
351
+ // Register get_w2 tool (1.16.0)
352
+ server.tool("get_w2", context?.publicConnection ? publicDescriptions.get_w2 : ("Get a download link for one copy of an employee's W-2, for a tax year that has ended. Returns download_url, " +
353
+ "a link on nannykeeper.com that works for 15 minutes: give it to the user and tell them to open it in their " +
354
+ "browser to download the PDF. This tool never returns the PDF itself, and you must not open the link " +
355
+ "yourself. The family generates the W-2 in the dashboard first (Taxes, then W-2s); until then this answers " +
356
+ "w2_not_generated with a link to that page, and this tool never generates one. " +
357
+ "For a household other than the key's own, pass its employer_id."), {
358
+ employee_id: z.string().uuid().describe("The employee id from list_employees."),
359
+ tax_year: z.number().int().describe("A tax year that has ended, for example 2025."),
360
+ copy: z.enum(["A", "B", "C", "D", "1", "2"]).optional().describe("Optional. Which copy of the W-2. Defaults to B. Each PDF says on its face who that copy is for."),
361
+ employer_id: EMPLOYER_ID_OPTIONAL,
362
+ }, {
363
+ title: "Get W-2 Download Link",
364
+ // Not read-only: making a link writes an audit row. Safe to repeat.
365
+ readOnlyHint: false,
366
+ destructiveHint: false,
367
+ idempotentHint: true,
368
+ openWorldHint: true,
369
+ }, async (args) => toolResult(await executeGetW2(args, context), context?.publicConnection));
370
+ // Register get_schedule_h tool (1.16.0)
371
+ server.tool("get_schedule_h", context?.publicConnection ? publicDescriptions.get_schedule_h : ("Get a download link for the household's Schedule H, for a tax year that has ended. Returns download_url, a " +
372
+ "link on nannykeeper.com that works for 15 minutes: give it to the user and tell them to open it in their " +
373
+ "browser to download the PDF. This tool never returns the PDF itself, and you must not open the link " +
374
+ "yourself. When the dashboard would not produce the form this answers schedule_h_unavailable with a reason " +
375
+ "(for example year_not_ended, or a question the family still has to answer in the dashboard); report that " +
376
+ "reason faithfully. NannyKeeper does not file the form. " +
377
+ "For a household other than the key's own, pass its employer_id."), {
378
+ tax_year: z.number().int().describe("A tax year that has ended, for example 2025."),
379
+ employer_id: EMPLOYER_ID_OPTIONAL,
380
+ }, {
381
+ title: "Get Schedule H Download Link",
382
+ // Not read-only: making a link writes an audit row. Safe to repeat.
383
+ readOnlyHint: false,
384
+ destructiveHint: false,
385
+ idempotentHint: true,
386
+ openWorldHint: true,
387
+ }, async (args) => toolResult(await executeGetScheduleH(args, context), context?.publicConnection));
346
388
  return server;
347
389
  }
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Household read tools: list_employees, get_payroll, get_pay_stub (1.15.0).
2
+ * Household read tools: list_employees, get_payroll, get_pay_stub (1.15.0),
3
+ * get_w2 and get_schedule_h (1.16.0).
3
4
  *
4
5
  * list_employees is how an agent learns the employee_id every payroll tool
5
6
  * needs (and the household's employer_id). Without it, an agent with a
@@ -37,4 +38,14 @@ export declare function executeGetPayStub(args: {
37
38
  content: ToolContent[];
38
39
  isError?: true;
39
40
  }>;
41
+ export declare function executeGetW2(args: {
42
+ employee_id: string;
43
+ tax_year: number;
44
+ copy?: string;
45
+ employer_id?: string;
46
+ }, context?: ToolContext): Promise<string>;
47
+ export declare function executeGetScheduleH(args: {
48
+ tax_year: number;
49
+ employer_id?: string;
50
+ }, context?: ToolContext): Promise<string>;
40
51
  export {};
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Household read tools: list_employees, get_payroll, get_pay_stub (1.15.0).
2
+ * Household read tools: list_employees, get_payroll, get_pay_stub (1.15.0),
3
+ * get_w2 and get_schedule_h (1.16.0).
3
4
  *
4
5
  * list_employees is how an agent learns the employee_id every payroll tool
5
6
  * needs (and the household's employer_id). Without it, an agent with a
@@ -26,6 +27,10 @@ async function getJson(path, init, context) {
26
27
  ok: false,
27
28
  text: JSON.stringify({
28
29
  error: data.error?.message || `API error: ${response.status}`,
30
+ // The stable name of the refusal (payroll_not_completed,
31
+ // w2_not_generated, schedule_h_unavailable), which the tool
32
+ // descriptions tell an agent to look for.
33
+ code: data.error?.code,
29
34
  details: data.error?.details,
30
35
  }),
31
36
  };
@@ -107,3 +112,45 @@ export async function executeGetPayStub(args, context) {
107
112
  }
108
113
  return { content };
109
114
  }
115
+ /**
116
+ * One tax form, as a DOWNLOAD LINK and never as the PDF (1.16.0).
117
+ *
118
+ * ⛔ A W-2 prints the employee's full Social Security number, and a tool
119
+ * result is read by the assistant's model. So these tools always ask the API
120
+ * for `delivery: "link"`: the result is a link on nannykeeper.com that works
121
+ * for 15 minutes, and the person opens it in their own browser. The pay stub
122
+ * is attached as a file because it shows only the last four digits; do not
123
+ * "align" these two with it.
124
+ */
125
+ async function getTaxFormLink(path, body, context) {
126
+ const result = await getJson(path, { method: "POST", body: JSON.stringify({ ...body, delivery: "link" }) }, context);
127
+ if (!result.ok)
128
+ return result.text;
129
+ const data = result.data.data;
130
+ const { download, document: _document, ...rest } = data ?? {};
131
+ if (!download?.url) {
132
+ return JSON.stringify({ error: "NannyKeeper did not return a download link. Ask again in a minute." });
133
+ }
134
+ return JSON.stringify({
135
+ ...rest,
136
+ file_name: download.file_name,
137
+ download_url: download.url,
138
+ expires_at: download.expires_at,
139
+ instructions: "Give the user this link and tell them to open it in their browser to download the PDF. " +
140
+ "It works for 15 minutes. Do not open or fetch the link yourself.",
141
+ });
142
+ }
143
+ export async function executeGetW2(args, context) {
144
+ return getTaxFormLink("/api/v1/documents/w2", {
145
+ employee_id: args.employee_id,
146
+ tax_year: args.tax_year,
147
+ ...(args.copy ? { copy: args.copy } : {}),
148
+ ...(args.employer_id ? { employer_id: args.employer_id } : {}),
149
+ }, context);
150
+ }
151
+ export async function executeGetScheduleH(args, context) {
152
+ return getTaxFormLink("/api/v1/documents/schedule-h", {
153
+ tax_year: args.tax_year,
154
+ ...(args.employer_id ? { employer_id: args.employer_id } : {}),
155
+ }, context);
156
+ }
package/manifest.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "manifest_version": "0.3",
3
3
  "name": "nannykeeper",
4
- "version": "1.15.0",
5
- "description": "Calculate US household employer (nanny) taxes for all 50 states. List employees, preview and run payroll, read payrolls and pay stubs, list state agency account numbers, and manage existing Autopilot enrollments. 10 tools: calculate_nanny_taxes, check_threshold, list_employees, preview_payroll, run_payroll, get_payroll, get_pay_stub, get_state_filing_status, get_autopilot, manage_autopilot.",
4
+ "version": "1.16.0",
5
+ "description": "Calculate US household employer (nanny) taxes for all 50 states. List employees, preview and run payroll, read payrolls and pay stubs, get download links for W-2s and Schedule H, list state agency account numbers, and manage existing Autopilot enrollments. 12 tools: calculate_nanny_taxes, check_threshold, list_employees, preview_payroll, run_payroll, get_payroll, get_pay_stub, get_w2, get_schedule_h, 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.15.0",
3
+ "version": "1.16.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": [