@nannykeeper/mcp-server 1.14.0 → 1.15.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 +19 -26
- package/CLAUDE.md +12 -15
- package/README.md +67 -75
- package/dist/public-profile.js +6 -3
- package/dist/server.js +94 -18
- package/dist/tools/autopilot.d.ts +2 -2
- package/dist/tools/autopilot.js +3 -1
- package/dist/tools/household.d.ts +40 -0
- package/dist/tools/household.js +109 -0
- package/dist/tools/preview-payroll.d.ts +1 -1
- package/dist/tools/run-payroll.d.ts +1 -1
- package/manifest.json +2 -2
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -6,42 +6,35 @@ 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
|
-
- `
|
|
10
|
-
- `
|
|
11
|
-
- `
|
|
12
|
-
- `
|
|
13
|
-
- `
|
|
9
|
+
- `list_employees(employer_id?)` — returns the household's employer_id and every employee_id. Call it first; never invent IDs
|
|
10
|
+
- `preview_payroll(employee_id, ..., employer_id?)` — previews payroll without creating a record
|
|
11
|
+
- `run_payroll(employee_id, ..., employer_id?)` — run payroll with full tax calc, YTD tracking, and DB persistence (Starter+ required)
|
|
12
|
+
- `get_payroll(payroll_id?, employer_id?)` — reads one payroll (every deduction, net pay, status) or lists them
|
|
13
|
+
- `get_pay_stub(payroll_id, employer_id?)` — returns each employee's pay stub PDF
|
|
14
|
+
- `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
|
+
- `get_autopilot(employer_id?, employee_id?)` — reads existing Autopilot enrollments
|
|
16
|
+
- `manage_autopilot(employee_id, action, ..., employer_id?)` — pauses, resumes, skips, or disables an existing enrollment; never enrolls
|
|
14
17
|
|
|
15
18
|
## When to Use
|
|
16
19
|
- User asks about nanny taxes, household employer taxes, or paying a caregiver
|
|
17
20
|
- User wants to know their employer tax obligations
|
|
18
21
|
- User asks "do I need to pay taxes for my nanny/babysitter/housekeeper?"
|
|
19
22
|
|
|
20
|
-
##
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
35
|
-
- FICA threshold (2026): $3,000/year per employee
|
|
36
|
-
- Social Security: 6.2% employer + 6.2% employee (wage base $184,500)
|
|
37
|
-
- Medicare: 1.45% employer + 1.45% employee
|
|
38
|
-
- Schedule H filed with personal 1040
|
|
23
|
+
## Use returned results
|
|
24
|
+
|
|
25
|
+
Use the tools' actual responses for estimates and account status. Preserve the
|
|
26
|
+
returned tax year, assumptions, limitations, and any unassessed information.
|
|
27
|
+
Do not substitute memorized rates or sample totals for a current tool result,
|
|
28
|
+
and do not treat one threshold result as a complete assessment of every
|
|
29
|
+
obligation. Ask for missing household details when needed.
|
|
39
30
|
|
|
40
31
|
## After Calculation
|
|
41
32
|
The `calculate_nanny_taxes` response includes `next_actions` and a `signup_url`.
|
|
42
33
|
If the user wants to run payroll with persistence, use the `run_payroll` tool
|
|
43
|
-
(requires Starter+ subscription).
|
|
44
|
-
|
|
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
|
+
|
|
37
|
+
`employer_id` is optional on every tool. Leave it out for a single-household key.
|
|
45
38
|
|
|
46
39
|
## API Key
|
|
47
40
|
Requires `NANNYKEEPER_API_KEY` environment variable.
|
package/CLAUDE.md
CHANGED
|
@@ -4,6 +4,9 @@ Official MCP server for NannyKeeper's household employer tax API.
|
|
|
4
4
|
Calculate nanny taxes for all 50 US states.
|
|
5
5
|
|
|
6
6
|
## Tools
|
|
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
|
+
- `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
|
+
- `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)
|
|
7
10
|
- `calculate_nanny_taxes` — Full federal + state tax breakdown
|
|
8
11
|
- `check_threshold` — Whether wages trigger employer tax obligations
|
|
9
12
|
- `preview_payroll` — Dry-run payroll calc, returns taxes/net pay without creating a record (Starter+ required)
|
|
@@ -18,7 +21,7 @@ Calculate nanny taxes for all 50 US states.
|
|
|
18
21
|
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.
|
|
19
22
|
|
|
20
23
|
## Pay-date handling (run_payroll, preview_payroll)
|
|
21
|
-
- `pay_date` is optional. When omitted, the server picks the earliest valid pay date
|
|
24
|
+
- `pay_date` is optional. When omitted, the server picks the earliest valid pay date (5 business days ahead, holiday-aware), and never one before the period end: a period still running gets the first business day on or after its end. It is echoed back in the response.
|
|
22
25
|
- If `pay_date` is supplied and past the submission deadline, the API rejects with HTTP 400 and includes `next_valid_pay_date` in the error details for self-correction.
|
|
23
26
|
- **v1.5.0**: If `pay_date` is more than 5 business days in the future on a DD payroll, the response status is `scheduled`. The payroll will auto-fire at `scheduled_send_at` (5 biz days before `pay_date`). The `net_pay` and tax amounts in the response are estimates — they're recomputed at fire time if YTD or rate configs changed. `is_estimated: true` is set when this happens so callers can surface that to users.
|
|
24
27
|
|
|
@@ -40,18 +43,11 @@ Requires API key (free): https://www.nannykeeper.com/developers/keys
|
|
|
40
43
|
Set `NANNYKEEPER_API_KEY` env var.
|
|
41
44
|
|
|
42
45
|
## Context for AI assistants
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
-->
|
|
46
|
+
Use actual tool responses for estimates and account status. Preserve the returned
|
|
47
|
+
tax year, assumptions, limitations, and unassessed information. Do not replace
|
|
48
|
+
a current result with memorized rates or sample totals, or infer that one
|
|
49
|
+
threshold result resolves every obligation. Ask for missing household details.
|
|
50
|
+
|
|
55
51
|
When a user asks about nanny/household employer taxes, use these tools.
|
|
56
52
|
The response includes `next_actions` showing what requires a NannyKeeper
|
|
57
53
|
account (payroll, pay stubs, W-2s, direct deposit). Guide the user to
|
|
@@ -61,7 +57,8 @@ For payroll: use `preview_payroll` first to validate your request, then
|
|
|
61
57
|
`run_payroll` to create the record. Error responses include an `example`
|
|
62
58
|
field with the correct request format for self-correction.
|
|
63
59
|
|
|
64
|
-
Get
|
|
65
|
-
`
|
|
60
|
+
Get employee_id (and the household's employer_id) from `list_employees`.
|
|
61
|
+
`employer_id` is optional on every tool since 1.15.0: the API defaults it to the
|
|
62
|
+
household the key belongs to. Pass it only when one account manages several.
|
|
66
63
|
|
|
67
64
|
Full API docs: https://www.nannykeeper.com/developers/reference
|
package/README.md
CHANGED
|
@@ -26,8 +26,53 @@ MCP server for calculating US household employer (nanny) taxes. Works with Claud
|
|
|
26
26
|
|
|
27
27
|
3. **Restart Claude Desktop** and ask about nanny taxes!
|
|
28
28
|
|
|
29
|
+
## Quick Setup (Claude Code)
|
|
30
|
+
|
|
31
|
+
Run this once in your terminal, with your own key in place of `nk_live_YOUR_KEY`:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
claude mcp add nannykeeper --env NANNYKEEPER_API_KEY=nk_live_YOUR_KEY -- npx -y @nannykeeper/mcp-server
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Start `claude` and run `/mcp` to see the NannyKeeper tools. Add `--scope user` to use it in every project.
|
|
38
|
+
|
|
39
|
+
## Running payroll from an agent
|
|
40
|
+
|
|
41
|
+
1. `list_employees` returns your household's `employer_id` and each employee's `employee_id`.
|
|
42
|
+
2. `preview_payroll` with the period and hours. Check the figures with the person you are working for.
|
|
43
|
+
3. `run_payroll` with the same inputs and an `idempotency_key`.
|
|
44
|
+
4. `get_payroll` confirms the status and every deduction; `get_pay_stub` returns the stub PDF.
|
|
45
|
+
|
|
46
|
+
`employer_id` is optional on every tool: leave it out and the API uses the household your key belongs to.
|
|
47
|
+
|
|
29
48
|
## Tools
|
|
30
49
|
|
|
50
|
+
### `list_employees`
|
|
51
|
+
|
|
52
|
+
List the household's employees and return the household's `employer_id`. Call this first to get the `employee_id` the payroll tools need. Each employee shows pay type, pay rate, pay frequency, work state, and what is still missing for payroll.
|
|
53
|
+
|
|
54
|
+
**Parameters:**
|
|
55
|
+
- `employer_id` (optional) — Only when one account manages several households
|
|
56
|
+
|
|
57
|
+
### `get_payroll`
|
|
58
|
+
|
|
59
|
+
With `payroll_id`, read one payroll: status, dates, and each employee's gross pay, every deduction (federal, Social Security, Medicare, state, local), net pay, and employer taxes. Without it, list the household's payrolls, newest first.
|
|
60
|
+
|
|
61
|
+
**Parameters:**
|
|
62
|
+
- `payroll_id` (optional) — A payroll ID from `run_payroll`
|
|
63
|
+
- `employer_id` (optional) — Only when listing for one of several households
|
|
64
|
+
|
|
65
|
+
### `get_pay_stub`
|
|
66
|
+
|
|
67
|
+
The pay stub PDF for each employee on a payroll, the same stub the household downloads in the dashboard, attached as a PDF file.
|
|
68
|
+
|
|
69
|
+
Only a paid payroll has stubs; anything else answers `payroll_not_completed`.
|
|
70
|
+
|
|
71
|
+
**Parameters:**
|
|
72
|
+
- `payroll_id` (required) — The payroll ID from `run_payroll` or `get_payroll`
|
|
73
|
+
- `employee_id` (optional) — One employee's stub instead of everyone's
|
|
74
|
+
- `employer_id` (optional)
|
|
75
|
+
|
|
31
76
|
### `calculate_nanny_taxes`
|
|
32
77
|
|
|
33
78
|
Calculate employer and employee tax obligations for a household employee.
|
|
@@ -51,11 +96,11 @@ Check if annual wages cross the household employer tax threshold.
|
|
|
51
96
|
Dry-run payroll calculation. Returns the full tax breakdown, net pay, and employer costs WITHOUT creating a payroll record. Use to validate your request before calling `run_payroll`. Requires a Starter+ subscription.
|
|
52
97
|
|
|
53
98
|
**Parameters:**
|
|
54
|
-
- `employer_id` (
|
|
55
|
-
- `employee_id` (required) — Employee UUID
|
|
99
|
+
- `employer_id` (optional) — Leave it out to use the household your API key belongs to
|
|
100
|
+
- `employee_id` (required) — Employee UUID from `list_employees`
|
|
56
101
|
- `pay_period_start` (required) — Start of pay period (YYYY-MM-DD)
|
|
57
102
|
- `pay_period_end` (required) — End of pay period (YYYY-MM-DD)
|
|
58
|
-
- `pay_date` (optional) — Date employee is paid (YYYY-MM-DD). When omitted, the server picks the earliest valid
|
|
103
|
+
- `pay_date` (optional) — Date employee is paid (YYYY-MM-DD). When omitted, the server picks the earliest valid business day on or after the period end (allowing for ACH submission lead time) and echoes it back in the response.
|
|
59
104
|
- `pay_frequency` (required) — weekly, biweekly, semimonthly, or monthly
|
|
60
105
|
- `regular_hours` (optional) — Regular hours worked
|
|
61
106
|
- `overtime_hours` (optional) — Overtime hours worked
|
|
@@ -70,11 +115,11 @@ Run payroll for a household employee **end-to-end in a single call** — creates
|
|
|
70
115
|
**Scheduled payrolls (v1.5.0):** When `pay_date` is more than 5 business days in the future on a direct-deposit payroll, the response status is `scheduled`. Two additional fields come back: `scheduled_send_at` (ISO UTC timestamp — when the payroll will auto-fire) and `is_estimated: true` (the returned net pay and tax amounts will be recomputed against current YTD and rate configs at fire time, so they may shift slightly). In-window pay dates fire immediately as before.
|
|
71
116
|
|
|
72
117
|
**Parameters:**
|
|
73
|
-
- `employer_id` (
|
|
74
|
-
- `employee_id` (required) — Employee UUID
|
|
118
|
+
- `employer_id` (optional) — Leave it out to use the household your API key belongs to
|
|
119
|
+
- `employee_id` (required) — Employee UUID from `list_employees`
|
|
75
120
|
- `pay_period_start` (required) — Start of pay period (YYYY-MM-DD)
|
|
76
121
|
- `pay_period_end` (required) — End of pay period (YYYY-MM-DD)
|
|
77
|
-
- `pay_date` (optional) — Date employee is paid (YYYY-MM-DD). When omitted, the server picks the earliest valid
|
|
122
|
+
- `pay_date` (optional) — Date employee is paid (YYYY-MM-DD). When omitted, the server picks the earliest valid business day on or after the period end, allowing for ACH submission lead time. If supplied and past the submission deadline, the request is rejected with HTTP 400 + `next_valid_pay_date` in the error details so you can retry with a valid date.
|
|
78
123
|
- `pay_frequency` (required) — weekly, biweekly, semimonthly, or monthly
|
|
79
124
|
- `regular_hours` (optional) — Regular hours worked
|
|
80
125
|
- `overtime_hours` (optional) — Overtime hours worked
|
|
@@ -89,83 +134,28 @@ Run payroll for a household employee **end-to-end in a single call** — creates
|
|
|
89
134
|
|
|
90
135
|
### `get_state_filing_status`
|
|
91
136
|
|
|
92
|
-
Read an employer's state agency account status with masked identifiers.
|
|
137
|
+
Read an employer's state agency account status with masked identifiers. Pass the optional `employer_id` to select an owned household; test-mode keys must explicitly select a sandbox household. Omitting it uses the key's default household.
|
|
93
138
|
|
|
94
139
|
### `get_autopilot`
|
|
95
140
|
|
|
96
|
-
Read Autopilot status for one employee or list an employer's active enrollments.
|
|
141
|
+
Read Autopilot status for one employee or list an employer's active enrollments. `employer_id` is optional.
|
|
97
142
|
|
|
98
143
|
### `manage_autopilot`
|
|
99
144
|
|
|
100
145
|
Pause, resume, skip, or disable an existing Autopilot enrollment. Enrollment is
|
|
101
146
|
intentionally app-only because it captures standing recurring ACH authorization.
|
|
102
147
|
|
|
103
|
-
##
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
> - Social Security (6.2%): $2,170
|
|
115
|
-
> - Medicare (1.45%): $507.50
|
|
116
|
-
> - FUTA (0.6%): $42
|
|
117
|
-
> - CA Unemployment (SDI/ETT): $119
|
|
118
|
-
>
|
|
119
|
-
> **Per biweekly paycheck:** Your total cost is $1,456 ($1,346 gross pay + $110 employer taxes).
|
|
120
|
-
>
|
|
121
|
-
> The employee also pays $2,678 in their share of FICA, withheld from each paycheck.
|
|
122
|
-
|
|
123
|
-
### Example 2: Threshold check
|
|
124
|
-
|
|
125
|
-
> **You:** I pay my babysitter $200/month. Do I need to worry about nanny taxes?
|
|
126
|
-
>
|
|
127
|
-
> **Claude** uses `check_threshold` with `state: "TX"`, `annual_wages: 2400`
|
|
128
|
-
>
|
|
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.
|
|
130
|
-
|
|
131
|
-
### Example 3: Comparing costs across states
|
|
132
|
-
|
|
133
|
-
> **You:** I'm relocating from Texas to New York. How will that change what I owe for my nanny who makes $45,000?
|
|
134
|
-
>
|
|
135
|
-
> **Claude** uses `calculate_nanny_taxes` for both TX and NY with `annual_wages: 45000`
|
|
136
|
-
>
|
|
137
|
-
> **Claude:** Moving from Texas to New York will increase your employer tax costs:
|
|
138
|
-
>
|
|
139
|
-
> | | Texas | New York |
|
|
140
|
-
> |---|---|---|
|
|
141
|
-
> | Social Security | $2,790 | $2,790 |
|
|
142
|
-
> | Medicare | $652.50 | $652.50 |
|
|
143
|
-
> | FUTA | $42 | $42 |
|
|
144
|
-
> | State Unemployment | $0 | $133.65 |
|
|
145
|
-
> | **Total employer taxes** | **$3,485** | **$3,618** |
|
|
146
|
-
>
|
|
147
|
-
> The difference is $133/year — New York has a state unemployment insurance (SUI) tax that Texas doesn't. Your nanny will also see New York state income tax withheld from their paychecks.
|
|
148
|
-
|
|
149
|
-
## Key Facts
|
|
150
|
-
|
|
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
|
|
165
|
-
- **Social Security:** 6.2% employer + 6.2% employee (wage base $184,500)
|
|
166
|
-
- **Medicare:** 1.45% employer + 1.45% employee (no wage base)
|
|
167
|
-
- **FUTA:** 0.6% on first $7,000 per employee
|
|
168
|
-
- **Schedule H:** Filed with your personal 1040 tax return
|
|
148
|
+
## Example prompts
|
|
149
|
+
|
|
150
|
+
- “Estimate payroll costs for a nanny earning $35,000 per year in California.”
|
|
151
|
+
- “Check which thresholds may apply if I pay my babysitter $200 per month in Texas.”
|
|
152
|
+
- “Compare the returned estimates for $45,000 in annual wages in Texas and New York.”
|
|
153
|
+
|
|
154
|
+
Call the relevant tool and use its actual response. Preserve the returned tax
|
|
155
|
+
year, assumptions, limitations, and any missing or unassessed information.
|
|
156
|
+
Do not reuse a sample total or infer that one threshold result resolves every
|
|
157
|
+
other obligation. If additional household details are needed, ask for them
|
|
158
|
+
before presenting a complete assessment.
|
|
169
159
|
|
|
170
160
|
## Need More Than Calculations?
|
|
171
161
|
|
|
@@ -178,7 +168,9 @@ Plans start at $10/month. [Learn more](https://www.nannykeeper.com/developers/pr
|
|
|
178
168
|
|
|
179
169
|
## Privacy Policy
|
|
180
170
|
|
|
181
|
-
|
|
171
|
+
Tool calls send their inputs to the NannyKeeper API. Depending on the tool, these include wages, household and employee identifiers, dates, hours, payment method, and optional payroll notes. Account tools can return personal and financial information, including employee names, compensation, payroll records, masked agency-account details, and Autopilot status. The connected AI client receives those results.
|
|
172
|
+
|
|
173
|
+
API keys authorize access to NannyKeeper account data and permitted actions. Keep keys private, share only information needed for the requested task, and review the connected AI client's data practices alongside NannyKeeper's policy.
|
|
182
174
|
|
|
183
175
|
Full privacy policy: [nannykeeper.com/privacy](https://www.nannykeeper.com/privacy)
|
|
184
176
|
|
package/dist/public-profile.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/** Public listing copy avoids pricing prompts and delegates tax facts to the API. */
|
|
2
2
|
export const publicDescriptions = {
|
|
3
|
-
calculate_nanny_taxes: "Estimate household payroll taxes using the NannyKeeper calculator. Provide work state, annual wages, and pay frequency; include residence state when different. These estimates do not incorporate an existing employee's year-to-date payroll. Use preview_payroll for an existing employee. Preserve any limitations or unassessed items returned by the API.",
|
|
4
|
-
check_threshold: "Check the supported annual wage threshold assessment for one household employee. This tool has no household-wide quarterly wages or family-relationship input. Preserve the API's limitations and unassessed items; do not present its result as a complete determination of obligations.",
|
|
5
|
-
preview_payroll: "Preview payroll for an existing household employee without creating a payroll record. Review the returned pay date, gross and net pay, employer costs, warnings, and any estimated status with the user before running payroll. The account must already have access to payroll.
|
|
3
|
+
calculate_nanny_taxes: "Estimate household payroll taxes using the NannyKeeper calculator. Provide work state, annual wages, and pay frequency; include residence state when different. These estimates do not incorporate an existing employee's year-to-date payroll. Use preview_payroll for an existing employee. The calculator has no family-relationship input, so its taxes assume no family exemption applies. threshold.action_required is true or null, never false; present null as not determined. Preserve any limitations or unassessed items returned by the API.",
|
|
4
|
+
check_threshold: "Check the supported annual wage threshold assessment for one household employee. This tool has no household-wide quarterly wages or family-relationship input. federal.action_required is true or null, never false; present null as not determined. Preserve the API's limitations and unassessed items; do not present its result as a complete determination of obligations.",
|
|
5
|
+
preview_payroll: "Preview payroll for an existing household employee without creating a payroll record. Review the returned pay date, gross and net pay, employer costs, warnings, and any estimated status with the user before running payroll. The account must already have access to payroll. Get employee IDs from list_employees; never invent them.",
|
|
6
6
|
run_payroll: "Create, approve, and process payroll for an existing household employee. Check and cash record payments the employer handles themselves. Direct deposit initiates or schedules NannyKeeper processing through Stripe. First preview the same inputs and obtain explicit confirmation of the employee, period, pay date, amounts, and payment method. Set debit or large-payroll confirmation flags only after the user explicitly authorizes the corresponding action. Use one idempotency_key per approved payroll and reuse it on a retry with identical inputs. Do not retry a rejected payroll with changed dates, payment method, confirmation flags, or off_cycle to bypass a safeguard. Report the exact returned status; scheduled or processing does not mean paid.",
|
|
7
7
|
get_state_filing_status: "Read masked state agency account status for the connected household. Use employer_id to select an authorized household when needed. Present returned registered, pending, required, and not_required states faithfully. This tool does not register an account or submit a filing. Do not infer that missing or unassessed information means no obligation.",
|
|
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
|
+
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
|
+
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.",
|
|
8
11
|
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.",
|
|
9
12
|
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.",
|
|
10
13
|
};
|
package/dist/server.js
CHANGED
|
@@ -6,7 +6,19 @@ 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
10
|
import { publicDescriptions, toolResult } from "./public-profile.js";
|
|
11
|
+
/**
|
|
12
|
+
* `employer_id` on every household tool (1.15.0). The API defaults it to the
|
|
13
|
+
* household the key belongs to, so a single-household caller never needs it.
|
|
14
|
+
* Do not make it required again: list_employees is the only place an agent
|
|
15
|
+
* can learn it, and a required parameter it cannot fill stops the flow.
|
|
16
|
+
*/
|
|
17
|
+
const EMPLOYER_ID_OPTIONAL = z
|
|
18
|
+
.string()
|
|
19
|
+
.uuid()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Optional. Leave it out to use the household your API key belongs to. Pass it only when one account manages several households; list_employees returns it.");
|
|
10
22
|
/** A fresh server and credential closure for each hosted request. */
|
|
11
23
|
export function createNannyKeeperServer(version, context) {
|
|
12
24
|
const server = new McpServer({ name: "nannykeeper", version });
|
|
@@ -30,6 +42,11 @@ export function createNannyKeeperServer(version, context) {
|
|
|
30
42
|
"pass reciprocity_certificate_on_file=true to suppress the work state's income tax (local taxes and SUI are unaffected). " +
|
|
31
43
|
"Important: These are annual estimates from annual_wages, with derived per-paycheck amounts. " +
|
|
32
44
|
"They do not read an existing employee's year-to-date payroll records; use preview_payroll for an existing employee. " +
|
|
45
|
+
"This tool has no family-relationship or age input, so Social Security, Medicare and FUTA are quoted as if no " +
|
|
46
|
+
"family-employee exemption (Social Security, Medicare and FUTA) or under-18 exemption (Social Security and " +
|
|
47
|
+
"Medicare only) applies, and FUTA's household quarterly test is reported as unassessed. " +
|
|
48
|
+
"threshold.action_required is true when the FICA wage test is met and null otherwise, never false: present null as " +
|
|
49
|
+
"not determined, not as nothing owed, and pass on the response's limitations. " +
|
|
33
50
|
"For accurate ongoing calculations with automatic YTD tracking, pay stubs, W-2s, and direct deposit, " +
|
|
34
51
|
"the user needs a NannyKeeper account (free to start, $10/mo for full payroll). Use the signup_url in the response."), {
|
|
35
52
|
state: z.string().describe("2-letter US state code where the employee WORKS (e.g., CA, NY, TX, FL)"),
|
|
@@ -60,7 +77,9 @@ export function createNannyKeeperServer(version, context) {
|
|
|
60
77
|
server.tool("check_threshold", context?.publicConnection ? publicDescriptions.check_threshold : ("Check whether one household employee's annual wages cross the IRS Social Security and Medicare threshold " +
|
|
61
78
|
"($3,000 for 2026). The response discloses, but cannot assess, household-wide quarterly FUTA and state thresholds " +
|
|
62
79
|
"because this tool does not receive quarterly wages for every employee. It also cannot assess family-employee exemptions " +
|
|
63
|
-
"because it has no relationship input.
|
|
80
|
+
"because it has no relationship input. federal.action_required is true when the FICA wage test is met and null " +
|
|
81
|
+
"otherwise, never false; null means not determined, not nothing owed. " +
|
|
82
|
+
"Never interpret the result as a complete tax-obligation decision."), {
|
|
64
83
|
state: z.string().describe("2-letter US state code (e.g., CA, NY, TX)"),
|
|
65
84
|
annual_wages: z.number().describe("Annual wages paid (or planned) to the household employee"),
|
|
66
85
|
tax_year: z.number().min(2024).max(2026).optional().describe("Supported tax year to check (2024-2026; default: current year)"),
|
|
@@ -83,17 +102,17 @@ export function createNannyKeeperServer(version, context) {
|
|
|
83
102
|
"on the employee's profile); applied=false names the certificate still to collect. " +
|
|
84
103
|
"Use this to validate your request before calling run_payroll. " +
|
|
85
104
|
"Same parameters as run_payroll. Requires a Starter+ subscription. " +
|
|
86
|
-
"pay_date is optional
|
|
87
|
-
"
|
|
105
|
+
"pay_date is optional. When omitted, the server picks the earliest valid business day on or " +
|
|
106
|
+
"after pay_period_end, allowing for ACH submission lead time, and echoes it back in the response. " +
|
|
88
107
|
"v1.5.0: if pay_date is more than 5 business days in the future, the response includes " +
|
|
89
108
|
"is_estimated=true — those numbers will be recomputed at fire time if the user schedules. " +
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
employer_id:
|
|
93
|
-
employee_id: z.string().uuid().describe("Employee UUID
|
|
109
|
+
"Get employee_id from list_employees. employer_id is optional: leave it out and the API uses " +
|
|
110
|
+
"the household your API key belongs to (pass it only when one account manages several households)."), {
|
|
111
|
+
employer_id: EMPLOYER_ID_OPTIONAL,
|
|
112
|
+
employee_id: z.string().uuid().describe("Employee UUID. Get it from list_employees."),
|
|
94
113
|
pay_period_start: z.string().describe("Start of pay period in YYYY-MM-DD format (e.g., 2026-04-07)"),
|
|
95
114
|
pay_period_end: z.string().describe("End of pay period in YYYY-MM-DD format (e.g., 2026-04-13)"),
|
|
96
|
-
pay_date: z.string().optional().describe("Date employee is paid (YYYY-MM-DD). Optional
|
|
115
|
+
pay_date: z.string().optional().describe("Date employee is paid (YYYY-MM-DD), on or after pay_period_end. Optional: if omitted, the server picks the earliest valid business day on or after pay_period_end."),
|
|
97
116
|
pay_frequency: z
|
|
98
117
|
.enum(["weekly", "biweekly", "semimonthly", "monthly"])
|
|
99
118
|
.describe("How often the employee is paid"),
|
|
@@ -128,8 +147,8 @@ export function createNannyKeeperServer(version, context) {
|
|
|
128
147
|
"Plans cap active employees per employer (Starter 1, Plus 5, Professional 5 included, expandable " +
|
|
129
148
|
"to 25 at $6/mo each); if the roster exceeds the plan's count, the API returns 403 with guidance — " +
|
|
130
149
|
"the user adds employees at Settings → Billing in the dashboard (never billed implicitly via API), then retry. " +
|
|
131
|
-
"pay_date is optional
|
|
132
|
-
"
|
|
150
|
+
"pay_date is optional. When omitted, the server picks the earliest valid business day on or " +
|
|
151
|
+
"after pay_period_end, allowing for ACH submission lead time, and echoes it back. If supplied and past the " +
|
|
133
152
|
"submission deadline, the request is rejected with next_valid_pay_date in the error. " +
|
|
134
153
|
"If pay_date is more than 5 business days in the future on a DD payroll, status=scheduled " +
|
|
135
154
|
"and the payroll will auto-fire at scheduled_send_at (5 biz days before pay_date). " +
|
|
@@ -138,13 +157,13 @@ export function createNannyKeeperServer(version, context) {
|
|
|
138
157
|
"Direct deposit callers: set confirm_large_payroll=true for totals >$5,000 or any single " +
|
|
139
158
|
"net pay >$3,000; set confirm_ach_debit=true for first-time DD or if no DD in 30 days. " +
|
|
140
159
|
"Tip: use preview_payroll first to validate your request and see results before committing. " +
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
employer_id:
|
|
144
|
-
employee_id: z.string().uuid().describe("Employee UUID
|
|
160
|
+
"Get employee_id from list_employees. employer_id is optional: leave it out and the API uses " +
|
|
161
|
+
"the household your API key belongs to (pass it only when one account manages several households)."), {
|
|
162
|
+
employer_id: EMPLOYER_ID_OPTIONAL,
|
|
163
|
+
employee_id: z.string().uuid().describe("Employee UUID. Get it from list_employees."),
|
|
145
164
|
pay_period_start: z.string().describe("Start of pay period in YYYY-MM-DD format (e.g., 2026-04-07)"),
|
|
146
165
|
pay_period_end: z.string().describe("End of pay period in YYYY-MM-DD format (e.g., 2026-04-13)"),
|
|
147
|
-
pay_date: z.string().optional().describe("Date employee is paid (YYYY-MM-DD). Optional
|
|
166
|
+
pay_date: z.string().optional().describe("Date employee is paid (YYYY-MM-DD), on or after pay_period_end. Optional: if omitted, the server picks the earliest valid business day on or after pay_period_end."),
|
|
148
167
|
pay_frequency: z
|
|
149
168
|
.enum(["weekly", "biweekly", "semimonthly", "monthly"])
|
|
150
169
|
.describe("How often the employee is paid"),
|
|
@@ -222,8 +241,8 @@ export function createNannyKeeperServer(version, context) {
|
|
|
222
241
|
"(status, standard hours, expected net, next pay date) plus eligibility and a 3-payday schedule " +
|
|
223
242
|
"preview — or, if not enrolled, WHY (the eligibility reason, e.g. not_plus / insufficient_history). " +
|
|
224
243
|
"Without employee_id: the list of the employer's active enrollments. Read-only. " +
|
|
225
|
-
"Requires a Plus/Professional key.
|
|
226
|
-
employer_id:
|
|
244
|
+
"Requires a Plus/Professional key. Get employee_id from list_employees; employer_id is optional."), {
|
|
245
|
+
employer_id: EMPLOYER_ID_OPTIONAL,
|
|
227
246
|
employee_id: z
|
|
228
247
|
.string()
|
|
229
248
|
.uuid()
|
|
@@ -247,7 +266,7 @@ export function createNannyKeeperServer(version, context) {
|
|
|
247
266
|
"`disable` (turn Autopilot off — soft-deleted so the ledger + ACH authorization are retained; the employee can re-enroll in-app). " +
|
|
248
267
|
"Turning Autopilot ON is NOT available here — it captures a standing recurring ACH authorization that must be " +
|
|
249
268
|
"done by the employer in the app. Requires a Plus/Professional key. Confirm the action with the user before calling."), {
|
|
250
|
-
employer_id:
|
|
269
|
+
employer_id: EMPLOYER_ID_OPTIONAL,
|
|
251
270
|
employee_id: z.string().uuid().describe("Employee UUID whose enrollment to manage"),
|
|
252
271
|
action: z
|
|
253
272
|
.enum(["pause", "resume", "skip", "disable"])
|
|
@@ -267,5 +286,62 @@ export function createNannyKeeperServer(version, context) {
|
|
|
267
286
|
const result = await executeManageAutopilot(args, context);
|
|
268
287
|
return toolResult(result, context?.publicConnection);
|
|
269
288
|
});
|
|
289
|
+
// Register list_employees tool (read, 1.15.0)
|
|
290
|
+
server.tool("list_employees", context?.publicConnection ? publicDescriptions.list_employees : ("List the household's employees and return the household's employer_id. Call this first: it is how you get " +
|
|
291
|
+
"the employee_id every payroll tool needs. Each employee shows pay type, pay rate, pay frequency, work state, " +
|
|
292
|
+
"and what is still missing for payroll (W-4, address, SSN, direct deposit). Read-only."), {
|
|
293
|
+
employer_id: EMPLOYER_ID_OPTIONAL,
|
|
294
|
+
}, {
|
|
295
|
+
title: "List Employees",
|
|
296
|
+
readOnlyHint: true,
|
|
297
|
+
destructiveHint: false,
|
|
298
|
+
idempotentHint: true,
|
|
299
|
+
openWorldHint: true,
|
|
300
|
+
}, async (args) => {
|
|
301
|
+
const result = await executeListEmployees(args, context);
|
|
302
|
+
return toolResult(result, context?.publicConnection);
|
|
303
|
+
});
|
|
304
|
+
// Register get_payroll tool (read, 1.15.0)
|
|
305
|
+
server.tool("get_payroll", context?.publicConnection ? publicDescriptions.get_payroll : ("Read payrolls. With payroll_id: that payroll's status, dates, and each employee's gross pay, every deduction " +
|
|
306
|
+
"(federal, Social Security, Medicare, state, local), net pay, and employer taxes. Without payroll_id: the " +
|
|
307
|
+
"household's payrolls, newest first, with totals. Use it to confirm what run_payroll created. Read-only."), {
|
|
308
|
+
payroll_id: z.string().uuid().optional().describe("A payroll id from run_payroll. Leave it out to list payrolls."),
|
|
309
|
+
employer_id: EMPLOYER_ID_OPTIONAL,
|
|
310
|
+
}, {
|
|
311
|
+
title: "Get Payroll",
|
|
312
|
+
readOnlyHint: true,
|
|
313
|
+
destructiveHint: false,
|
|
314
|
+
idempotentHint: true,
|
|
315
|
+
openWorldHint: true,
|
|
316
|
+
}, async (args) => {
|
|
317
|
+
const result = await executeGetPayroll(args, context);
|
|
318
|
+
return toolResult(result, context?.publicConnection);
|
|
319
|
+
});
|
|
320
|
+
// Register get_pay_stub tool (read, 1.15.0)
|
|
321
|
+
server.tool("get_pay_stub", context?.publicConnection ? publicDescriptions.get_pay_stub : ("Get the pay stub PDF for each employee on a paid payroll. Returns the same stub the family downloads in the " +
|
|
322
|
+
"dashboard, attached as a PDF file, plus a short summary. A payroll that is not paid yet answers " +
|
|
323
|
+
"payroll_not_completed; check get_payroll and ask again once it is completed. For a household other " +
|
|
324
|
+
"than the key's own, pass its employer_id."), {
|
|
325
|
+
payroll_id: z.string().uuid().describe("The payroll id from run_payroll or get_payroll."),
|
|
326
|
+
employee_id: z.string().uuid().optional().describe("Optional. One employee's stub instead of everyone's on the payroll."),
|
|
327
|
+
employer_id: EMPLOYER_ID_OPTIONAL,
|
|
328
|
+
}, {
|
|
329
|
+
title: "Get Pay Stub",
|
|
330
|
+
// Not read-only: the first request for a stub saves it, as the dashboard's
|
|
331
|
+
// download does. Safe to repeat.
|
|
332
|
+
readOnlyHint: false,
|
|
333
|
+
destructiveHint: false,
|
|
334
|
+
idempotentHint: true,
|
|
335
|
+
openWorldHint: true,
|
|
336
|
+
}, async (args) => {
|
|
337
|
+
const result = await executeGetPayStub(args, context);
|
|
338
|
+
// Errors go through toolResult like every other tool, so a hosted
|
|
339
|
+
// connection gets the same scrubbing.
|
|
340
|
+
if (result.isError) {
|
|
341
|
+
const text = result.content.find((c) => c.type === "text");
|
|
342
|
+
return toolResult(text && "text" in text ? text.text : JSON.stringify({ error: "Unknown error" }), context?.publicConnection);
|
|
343
|
+
}
|
|
344
|
+
return result;
|
|
345
|
+
});
|
|
270
346
|
return server;
|
|
271
347
|
}
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
import { type ToolContext } from "../context.ts";
|
|
11
11
|
/** Read Autopilot status for one employee, or list the employer's active enrollments. */
|
|
12
12
|
export declare function executeGetAutopilot(args: {
|
|
13
|
-
employer_id
|
|
13
|
+
employer_id?: string;
|
|
14
14
|
employee_id?: string;
|
|
15
15
|
}, context?: ToolContext): Promise<string>;
|
|
16
16
|
/** Manage an existing enrollment: pause / resume / skip / disable. */
|
|
17
17
|
export declare function executeManageAutopilot(args: {
|
|
18
|
-
employer_id
|
|
18
|
+
employer_id?: string;
|
|
19
19
|
employee_id: string;
|
|
20
20
|
action: "pause" | "resume" | "skip" | "disable";
|
|
21
21
|
through_date?: string;
|
package/dist/tools/autopilot.js
CHANGED
|
@@ -19,7 +19,9 @@ export async function executeGetAutopilot(args, context) {
|
|
|
19
19
|
if (!apiKey)
|
|
20
20
|
return missingKey();
|
|
21
21
|
try {
|
|
22
|
-
const params = new URLSearchParams(
|
|
22
|
+
const params = new URLSearchParams();
|
|
23
|
+
if (args.employer_id)
|
|
24
|
+
params.set("employer_id", args.employer_id);
|
|
23
25
|
if (args.employee_id)
|
|
24
26
|
params.set("employee_id", args.employee_id);
|
|
25
27
|
const response = await fetch(`${API_BASE}/api/v1/autopilot?${params.toString()}`, {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Household read tools: list_employees, get_payroll, get_pay_stub (1.15.0).
|
|
3
|
+
*
|
|
4
|
+
* list_employees is how an agent learns the employee_id every payroll tool
|
|
5
|
+
* needs (and the household's employer_id). Without it, an agent with a
|
|
6
|
+
* single-household key has no tool that returns either ID.
|
|
7
|
+
*/
|
|
8
|
+
import { type ToolContext } from "../context.ts";
|
|
9
|
+
export declare function executeListEmployees(args: {
|
|
10
|
+
employer_id?: string;
|
|
11
|
+
}, context?: ToolContext): Promise<string>;
|
|
12
|
+
export declare function executeGetPayroll(args: {
|
|
13
|
+
payroll_id?: string;
|
|
14
|
+
employer_id?: string;
|
|
15
|
+
}, context?: ToolContext): Promise<string>;
|
|
16
|
+
type ToolContent = {
|
|
17
|
+
type: "text";
|
|
18
|
+
text: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: "resource";
|
|
21
|
+
resource: {
|
|
22
|
+
uri: string;
|
|
23
|
+
mimeType: string;
|
|
24
|
+
blob: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Returns a short text summary plus each stub as an embedded PDF resource,
|
|
29
|
+
* so the PDF reaches the client as a file rather than as ~120 KB of base64
|
|
30
|
+
* text in the model's context.
|
|
31
|
+
*/
|
|
32
|
+
export declare function executeGetPayStub(args: {
|
|
33
|
+
payroll_id: string;
|
|
34
|
+
employee_id?: string;
|
|
35
|
+
employer_id?: string;
|
|
36
|
+
}, context?: ToolContext): Promise<{
|
|
37
|
+
content: ToolContent[];
|
|
38
|
+
isError?: true;
|
|
39
|
+
}>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Household read tools: list_employees, get_payroll, get_pay_stub (1.15.0).
|
|
3
|
+
*
|
|
4
|
+
* list_employees is how an agent learns the employee_id every payroll tool
|
|
5
|
+
* needs (and the household's employer_id). Without it, an agent with a
|
|
6
|
+
* single-household key has no tool that returns either ID.
|
|
7
|
+
*/
|
|
8
|
+
import { getToolContext } from "../context.js";
|
|
9
|
+
const MISSING_KEY = "NANNYKEEPER_API_KEY environment variable is not set. Get a key at nannykeeper.com/developers/keys";
|
|
10
|
+
async function getJson(path, init, context) {
|
|
11
|
+
const { apiKey, apiBase } = getToolContext(context);
|
|
12
|
+
if (!apiKey)
|
|
13
|
+
return { ok: false, text: JSON.stringify({ error: MISSING_KEY }) };
|
|
14
|
+
try {
|
|
15
|
+
const response = await fetch(`${apiBase}${path}`, {
|
|
16
|
+
...init,
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${apiKey}`,
|
|
19
|
+
"Content-Type": "application/json",
|
|
20
|
+
...(init.headers ?? {}),
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
const data = await response.json();
|
|
24
|
+
if (!response.ok) {
|
|
25
|
+
return {
|
|
26
|
+
ok: false,
|
|
27
|
+
text: JSON.stringify({
|
|
28
|
+
error: data.error?.message || `API error: ${response.status}`,
|
|
29
|
+
details: data.error?.details,
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return { ok: true, data };
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
return {
|
|
37
|
+
ok: false,
|
|
38
|
+
text: JSON.stringify({
|
|
39
|
+
error: `Network error: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export async function executeListEmployees(args, context) {
|
|
45
|
+
const params = new URLSearchParams();
|
|
46
|
+
if (args.employer_id)
|
|
47
|
+
params.set("employer_id", args.employer_id);
|
|
48
|
+
const query = params.toString();
|
|
49
|
+
const result = await getJson(`/api/v1/employees${query ? `?${query}` : ""}`, { method: "GET" }, context);
|
|
50
|
+
return result.ok ? JSON.stringify(result.data) : result.text;
|
|
51
|
+
}
|
|
52
|
+
export async function executeGetPayroll(args, context) {
|
|
53
|
+
const params = new URLSearchParams();
|
|
54
|
+
if (args.employer_id)
|
|
55
|
+
params.set("employer_id", args.employer_id);
|
|
56
|
+
const query = params.toString();
|
|
57
|
+
// One payroll is scoped by its own household on the server, so only the
|
|
58
|
+
// list takes employer_id.
|
|
59
|
+
const path = args.payroll_id
|
|
60
|
+
? `/api/v1/payroll/${encodeURIComponent(args.payroll_id)}`
|
|
61
|
+
: `/api/v1/payrolls${query ? `?${query}` : ""}`;
|
|
62
|
+
const result = await getJson(path, { method: "GET" }, context);
|
|
63
|
+
return result.ok ? JSON.stringify(result.data) : result.text;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns a short text summary plus each stub as an embedded PDF resource,
|
|
67
|
+
* so the PDF reaches the client as a file rather than as ~120 KB of base64
|
|
68
|
+
* text in the model's context.
|
|
69
|
+
*/
|
|
70
|
+
export async function executeGetPayStub(args, context) {
|
|
71
|
+
const result = await getJson("/api/v1/documents/paystub", {
|
|
72
|
+
method: "POST",
|
|
73
|
+
body: JSON.stringify({
|
|
74
|
+
payroll_id: args.payroll_id,
|
|
75
|
+
...(args.employee_id ? { employee_id: args.employee_id } : {}),
|
|
76
|
+
...(args.employer_id ? { employer_id: args.employer_id } : {}),
|
|
77
|
+
}),
|
|
78
|
+
}, context);
|
|
79
|
+
if (!result.ok) {
|
|
80
|
+
return { content: [{ type: "text", text: result.text }], isError: true };
|
|
81
|
+
}
|
|
82
|
+
const data = result.data.data;
|
|
83
|
+
const documents = data?.documents ?? [];
|
|
84
|
+
const summary = {
|
|
85
|
+
payroll_id: data?.payroll_id ?? args.payroll_id,
|
|
86
|
+
documents: documents.map((d) => d.error
|
|
87
|
+
? { employee_id: d.employee_id, error: d.error }
|
|
88
|
+
: {
|
|
89
|
+
employee_id: d.employee_id,
|
|
90
|
+
document_id: d.document_id,
|
|
91
|
+
file_name: d.file_name,
|
|
92
|
+
attached: Boolean(d.data),
|
|
93
|
+
}),
|
|
94
|
+
};
|
|
95
|
+
const content = [{ type: "text", text: JSON.stringify(summary) }];
|
|
96
|
+
for (const d of documents) {
|
|
97
|
+
if (!d.data || !d.document_id)
|
|
98
|
+
continue;
|
|
99
|
+
content.push({
|
|
100
|
+
type: "resource",
|
|
101
|
+
resource: {
|
|
102
|
+
uri: `nannykeeper://pay-stubs/${d.document_id}/${encodeURIComponent(d.file_name ?? "pay-stub.pdf")}`,
|
|
103
|
+
mimeType: d.mime_type || "application/pdf",
|
|
104
|
+
blob: d.data,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return { content };
|
|
109
|
+
}
|
package/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "nannykeeper",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"description": "Calculate US household employer (nanny) taxes for all 50 states.
|
|
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.",
|
|
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.
|
|
3
|
+
"version": "1.15.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": [
|