@markcolabs/mcp 0.2.0 → 0.3.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.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE-API.md +111 -0
  3. package/README.md +128 -205
  4. package/dist/engines/data/irs2026.d.ts +110 -3
  5. package/dist/engines/data/irs2026.d.ts.map +1 -1
  6. package/dist/engines/data/irs2026.js +86 -3
  7. package/dist/engines/data/irs2026.js.map +1 -1
  8. package/dist/engines/data/rmd2026.d.ts +59 -0
  9. package/dist/engines/data/rmd2026.d.ts.map +1 -0
  10. package/dist/engines/data/rmd2026.js +75 -0
  11. package/dist/engines/data/rmd2026.js.map +1 -0
  12. package/dist/engines/data/stateTax2026.d.ts +114 -0
  13. package/dist/engines/data/stateTax2026.d.ts.map +1 -0
  14. package/dist/engines/data/stateTax2026.js +348 -0
  15. package/dist/engines/data/stateTax2026.js.map +1 -0
  16. package/dist/engines/hsa.d.ts +110 -0
  17. package/dist/engines/hsa.d.ts.map +1 -0
  18. package/dist/engines/hsa.js +83 -0
  19. package/dist/engines/hsa.js.map +1 -0
  20. package/dist/engines/ira.d.ts +115 -0
  21. package/dist/engines/ira.d.ts.map +1 -0
  22. package/dist/engines/ira.js +127 -0
  23. package/dist/engines/ira.js.map +1 -0
  24. package/dist/engines/paycheck.d.ts +51 -16
  25. package/dist/engines/paycheck.d.ts.map +1 -1
  26. package/dist/engines/paycheck.js +53 -24
  27. package/dist/engines/paycheck.js.map +1 -1
  28. package/dist/engines/rmd.d.ts +107 -0
  29. package/dist/engines/rmd.d.ts.map +1 -0
  30. package/dist/engines/rmd.js +109 -0
  31. package/dist/engines/rmd.js.map +1 -0
  32. package/dist/engines/rothConversion.d.ts +124 -0
  33. package/dist/engines/rothConversion.d.ts.map +1 -0
  34. package/dist/engines/rothConversion.js +145 -0
  35. package/dist/engines/rothConversion.js.map +1 -0
  36. package/dist/index.d.ts +16 -4
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +104 -6
  39. package/dist/index.js.map +1 -1
  40. package/dist/shared/bounds.d.ts +50 -0
  41. package/dist/shared/bounds.d.ts.map +1 -1
  42. package/dist/shared/bounds.js +85 -0
  43. package/dist/shared/bounds.js.map +1 -1
  44. package/dist/tools/hsa.d.ts +58 -0
  45. package/dist/tools/hsa.d.ts.map +1 -0
  46. package/dist/tools/hsa.js +129 -0
  47. package/dist/tools/hsa.js.map +1 -0
  48. package/dist/tools/ira.d.ts +55 -0
  49. package/dist/tools/ira.d.ts.map +1 -0
  50. package/dist/tools/ira.js +117 -0
  51. package/dist/tools/ira.js.map +1 -0
  52. package/dist/tools/paycheck.d.ts +14 -7
  53. package/dist/tools/paycheck.d.ts.map +1 -1
  54. package/dist/tools/paycheck.js +24 -11
  55. package/dist/tools/paycheck.js.map +1 -1
  56. package/dist/tools/rmd.d.ts +60 -0
  57. package/dist/tools/rmd.d.ts.map +1 -0
  58. package/dist/tools/rmd.js +130 -0
  59. package/dist/tools/rmd.js.map +1 -0
  60. package/dist/tools/rothConversion.d.ts +66 -0
  61. package/dist/tools/rothConversion.d.ts.map +1 -0
  62. package/dist/tools/rothConversion.js +141 -0
  63. package/dist/tools/rothConversion.js.map +1 -0
  64. package/package.json +18 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Markco Labs LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/LICENSE-API.md ADDED
@@ -0,0 +1,111 @@
1
+ # Hosted API Terms — `mcp.digitalcalculator.info/mcp`
2
+
3
+ **Document**: LICENSE-API.md
4
+ **Applies to**: Use of the **hosted** MCP API at `https://mcp.digitalcalculator.info/mcp` operated by Markco Labs LLC.
5
+ **Does NOT apply to**: Self-hosted use of the `@markcolabs/mcp` source code, which is governed by the [MIT LICENSE](./LICENSE) that ships in this package.
6
+
7
+ These terms are distinct from, and complementary to, the MIT license that
8
+ governs the package source. The MIT license lets you copy, modify, and
9
+ redistribute the source — including running your own copy of the server on
10
+ your own infrastructure. These hosted-API terms govern how you may interact
11
+ with the Markco Labs–operated HTTP endpoint at the URL above.
12
+
13
+ ---
14
+
15
+ ## 1. Scope
16
+
17
+ These terms apply **only** to HTTP requests made to
18
+ `https://mcp.digitalcalculator.info/mcp` (and any future host-name variants
19
+ operated by Markco Labs LLC for the same service).
20
+
21
+ If you `npm install @markcolabs/mcp` and run it locally over MCP stdio, or
22
+ deploy it to your own infrastructure, the MIT [LICENSE](./LICENSE) is the only
23
+ license that applies — these hosted-API terms do not bind you in that mode.
24
+
25
+ ## 2. Acceptable Use
26
+
27
+ The hosted endpoint is free to use, without signup or API key, subject to the
28
+ following acceptable-use constraints:
29
+
30
+ - **No scraping at scale.** The endpoint is for interactive AI agent calls and
31
+ developer integrations. Bulk crawling of every input combination to build
32
+ derivative datasets is not permitted.
33
+ - **No resale of raw API output as a standalone product.** Embedding tool
34
+ responses inside a larger product (AI agent answers, calculators, dashboards)
35
+ is fine and encouraged. Selling the raw JSON responses as a paid feed is not.
36
+ - **No sole-authority financial decisions.** The tools return YMYL (Your Money
37
+ or Your Life) estimates with a canonical disclaimer (see
38
+ `packages/mcp/src/disclaimers/ymyl.ts`). Downstream products must surface
39
+ the disclaimer alongside the numbers and must not present the results as
40
+ professional financial, tax, legal, or investment advice. Verify all
41
+ outputs against the canonical methodology pages on
42
+ [www.digitalcalculator.info](https://www.digitalcalculator.info) before
43
+ acting on them.
44
+ - **No reverse-engineering of throttle behavior** to evade rate limits, and
45
+ no use of multiple IPs / clients to multiply effective throughput beyond
46
+ the published thresholds.
47
+
48
+ ## 3. Rate Limits
49
+
50
+ The hosted endpoint enforces a per-IP rate limit:
51
+
52
+ - **100 requests per 5 minutes per source IP** (WAFv2-enforced floor).
53
+ - Bursts above this threshold receive HTTP 429 with the
54
+ `{"error":{"code":"RATE_LIMIT","retriable":true}}` envelope.
55
+ - Markco Labs reserves the right to tighten, loosen, or replace this throttle
56
+ at any time. Significant changes will be announced in the package CHANGELOG
57
+ and on the [/mcp/](https://www.digitalcalculator.info/mcp/) landing page.
58
+
59
+ Markco Labs reserves the right to suspend or block clients (by IP, ASN, or
60
+ other identifier) that materially exceed fair-share usage, generate abuse
61
+ patterns, or violate the acceptable-use terms above. Suspension decisions
62
+ are at Markco Labs' sole discretion.
63
+
64
+ ## 4. No Warranty / Liability Limitation
65
+
66
+ THE HOSTED API IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
67
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
68
+ FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR ACCURACY OF THE
69
+ CALCULATIONS RETURNED.
70
+
71
+ Specifically:
72
+
73
+ - **No accuracy warranty for hosted output.** Although the engines that power
74
+ the hosted endpoint are parity-tested against the canonical calculators at
75
+ www.digitalcalculator.info on every release, the hosted endpoint is a
76
+ convenience surface. Authoritative results for any consequential financial
77
+ decision must be verified against the corresponding methodology page on the
78
+ main site (linked via the `methodology.url` field of every response
79
+ envelope).
80
+ - **No uptime SLA.** The hosted endpoint is offered free of charge and runs
81
+ on best-effort infrastructure. No service-level agreement is provided.
82
+ - **No liability for downstream use.** Markco Labs is not liable for any
83
+ damages — direct, indirect, incidental, special, consequential, or punitive
84
+ — arising from your use of the hosted endpoint, including but not limited
85
+ to losses caused by acting on inaccurate or out-of-date calculations.
86
+
87
+ Self-hosters running the MIT-licensed source independently are governed only
88
+ by the warranty disclaimer in the [LICENSE](./LICENSE) file — not by this
89
+ section.
90
+
91
+ ## 5. Contact
92
+
93
+ - **Technical issues** (bugs, broken responses, integration questions): open
94
+ an issue at
95
+ [github.com/mark57-ux/digitalcalculator/issues](https://github.com/mark57-ux/digitalcalculator/issues).
96
+ Best-effort triage, no SLA.
97
+ - **Acceptable-use questions or abuse reports**: open a GitHub issue with the
98
+ `mcp-abuse` label, or use the contact path on
99
+ [www.digitalcalculator.info](https://www.digitalcalculator.info).
100
+ - **Content / accuracy concerns**: the canonical YMYL disclaimer policy
101
+ (see `packages/mcp/src/disclaimers/ymyl.ts` and the response envelope)
102
+ applies. Direct content/accuracy disputes to the corresponding calculator's
103
+ methodology page on www.digitalcalculator.info.
104
+
105
+ ---
106
+
107
+ These terms may be updated from time to time. The version that applies to a
108
+ given request is the version that was current at the time the request was
109
+ served. Material changes are noted in `packages/mcp/CHANGELOG.md`.
110
+
111
+ Last updated: 2026-05-27 (v0.2.1 patch release).
package/README.md CHANGED
@@ -1,263 +1,186 @@
1
1
  # @markcolabs/mcp
2
2
 
3
- Model Context Protocol (MCP) server for **digitalcalculator.info** financial calculators.
4
-
5
- **Status:** v0.2.0 contract reconciliation release. Renames 2 tools to match ADR-0039 § 1 canon (`retirement401k.projection`, `socialSecurity.estimatedBenefit`), resets `ENGINE_VERSION` per ADR-0039 § 5 semantics, fixes Lambda handler error-envelope bug, removes dead config and CORS code. v0.1.0 is deprecated on npm.
6
-
7
- Locks in the contract from **ADR-0039** (MCP Tool Contract & Calc-Engine Lift), reconciled per **ADR-0041** (post-deploy audit decisions).
3
+ > A free, MIT-licensed Model Context Protocol (MCP) server exposing 9
4
+ > deterministic financial calculator tools for AI agents — mortgage payment,
5
+ > compound interest, 401(k) projection, Social Security benefit, paycheck
6
+ > net pay, IRA contribution limit, Roth conversion tax impact, RMD
7
+ > distribution amount, and HSA contribution limit. Powered by the same
8
+ > engines that run the calculators at
9
+ > [www.digitalcalculator.info](https://www.digitalcalculator.info), parity-tested
10
+ > on every release. Hosted REST companion at
11
+ > [mcp.digitalcalculator.info/mcp](https://mcp.digitalcalculator.info/mcp);
12
+ > self-hostable over MCP stdio with `npx`.
13
+
14
+ **Status**: v0.3.0 (Sprint 141 Wave 1A + 1B). Adds 4 new retirement-cluster
15
+ tools (`dc.calculator.ira.contributionLimit`,
16
+ `dc.calculator.rothConversion.taxImpact`, `dc.calculator.rmd.distributionAmount`,
17
+ `dc.calculator.hsa.contributionLimit`), taking tool coverage 5 → 9.
18
+ See [CHANGELOG.md](./CHANGELOG.md).
19
+
20
+ Contract: **ADR-0039** (Tool Contract), reconciled per **ADR-0041**
21
+ (post-deploy audit decisions).
8
22
 
9
23
  ---
10
24
 
11
- ## What ships in v0.2.0
12
-
13
- | Tool | Purpose |
14
- |---|---|
15
- | `dc.calculator.mortgage.monthlyPayment` | Monthly principal & interest, total interest, total paid for a fixed-rate mortgage. |
16
- | `dc.calculator.compoundInterest.futureValue` | Future value of a principal with optional monthly contributions, at a chosen compounding frequency. |
17
- | `dc.calculator.retirement401k.projection` | Year-by-year 401(k) projection through retirement, honoring IRS 2026 contribution limits (incl. SECURE 2.0 super catch-up for ages 60-63). |
18
- | `dc.calculator.socialSecurity.estimatedBenefit` | SSA bend-point PIA estimate with early-claim reduction, delayed-credit math, and lifetime projection. |
19
- | `dc.calculator.paycheck.netPay` | IRS 2026 federal Percentage Method + FICA + simplified state-tax estimate (no state-specific tables, SDI, or local taxes — see methodology link). |
20
-
21
- | Resource | Purpose |
22
- |---|---|
23
- | `dc://disclaimers/ymyl` | Canonical YMYL disclaimer string returned in every tool response. |
24
-
25
- Every tool response carries the `ToolResult<T>` envelope:
26
-
27
- ```jsonc
28
- {
29
- "result": { /* tool-specific structured payload */ },
30
- "disclaimer": "Estimates only — for educational purposes...",
31
- "methodology": {
32
- "url": "https://www.digitalcalculator.info/mortgage-calculator/",
33
- "version": "2026-05-09"
34
- },
35
- "calculatedAt": "2026-05-09T18:32:11.123Z",
36
- "engineVersion": "0.1.0"
37
- }
38
- ```
39
-
40
- Failures funnel through the `ToolError` shape (never thrown to the transport):
25
+ ## Install
41
26
 
42
- ```jsonc
43
- {
44
- "error": {
45
- "code": "INPUT_VALIDATION",
46
- "message": "Number must be greater than or equal to 0",
47
- "field": "principal",
48
- "retriable": false
49
- }
50
- }
27
+ ```bash
28
+ npm install -g @markcolabs/mcp
51
29
  ```
52
30
 
53
- Code namespaces: `INPUT_VALIDATION`, `BUSINESS_RULE`, `INTERNAL`, `RATE_LIMIT` (only `RATE_LIMIT` is retriable).
54
-
55
- ---
56
-
57
- ## Local install + test
31
+ Or run without installing:
58
32
 
59
33
  ```bash
60
- cd packages/mcp
61
- npm install
62
- npm test # run parity + envelope tests
63
- npm run build # compile TypeScript to dist/
64
- npm start # boot MCP server over stdio
34
+ npx @markcolabs/mcp
65
35
  ```
66
36
 
67
- Vitest runs `test/parity/*.test.ts` (per-tool parity vs site source) and `test/envelope.test.ts` (envelope contract). Parity tests must pass before any engine change is shipped.
68
-
69
- ---
37
+ The package ships a `digitalcalculator-mcp` binary that speaks MCP over stdio.
70
38
 
71
- ## Connecting from a local MCP client
39
+ ## Quickstart Claude Desktop
72
40
 
73
- After `npm run build`, point your MCP-compatible client at `node /path/to/packages/mcp/dist/index.js` over stdio. Example Claude Desktop config snippet:
41
+ Add to `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/`,
42
+ Windows: `%APPDATA%\Claude\`):
74
43
 
75
- ```jsonc
44
+ ```json
76
45
  {
77
46
  "mcpServers": {
78
47
  "digitalcalculator": {
79
48
  "command": "node",
80
- "args": ["/absolute/path/to/packages/mcp/dist/index.js"]
49
+ "args": ["/absolute/path/to/global/node_modules/@markcolabs/mcp/dist/index.js"]
81
50
  }
82
51
  }
83
52
  }
84
53
  ```
85
54
 
86
- The server emits a single startup line on stderr and then speaks JSON-RPC over stdio per the MCP spec.
55
+ Restart Claude Desktop. In a new conversation, ask "what MCP tools do you
56
+ have access to?" — Claude should list the 9 `dc.calculator.*` tools.
87
57
 
88
- ---
58
+ Full setup instructions (incl. MCP Inspector, agentic CLIs, HTTP REST):
59
+ [www.digitalcalculator.info/mcp/quickstart/](https://www.digitalcalculator.info/mcp/quickstart/).
89
60
 
90
- ## Tool input/output sketches
61
+ ## Tools (v0.3.0)
91
62
 
92
- ### `dc.calculator.retirement401k.projection`
63
+ | Tool | Input (summary) | Returns (summary) |
64
+ |---|---|---|
65
+ | `dc.calculator.mortgage.monthlyPayment` | `principal`, `annualRatePercent`, `termYears` | Monthly P&I payment, total interest, total paid |
66
+ | `dc.calculator.compoundInterest.futureValue` | `principal`, `annualRatePercent`, `years`, `compoundingFrequency`, optional `monthlyContribution` | Future value, total contributions, interest earned |
67
+ | `dc.calculator.retirement401k.projection` | current balance, salary, contribution %, employer match, growth %, return %, current/retirement age | Year-by-year balance, employer match total, growth earned, IRS 2026 limits applied |
68
+ | `dc.calculator.socialSecurity.estimatedBenefit` | `birthYear`, `currentEarnings`, `claimAge`, optional `yearsWorked`, `lifeExpectancy` | Monthly benefit at FRA, adjusted for claim age, lifetime projection, FRA age |
69
+ | `dc.calculator.paycheck.netPay` | `grossAnnualSalary`, `payFrequency`, `federalFilingStatus`, `state`, pre-/post-tax deductions, optional `dependents` (default 0) | Per-paycheck gross/federal/FICA/state/net, annualized totals, no-state-income-tax flag |
70
+ | `dc.calculator.ira.contributionLimit` | `age`, `filingStatus`, `magi`, `type` ('traditional' or 'roth') | Eligible contribution (with Roth MAGI phase-out + catch-up), `traditionalDeductionStatus` signal, 2026 IRS limits |
71
+ | `dc.calculator.rothConversion.taxImpact` | `conversionAmount`, `age`, `filingStatus`, `currentTaxableIncome`, optional `retirementMarginalRatePercent` + `expectedReturnPercent` | Federal tax owed on conversion, marginal/effective rate, 5-year-rule flag, optional break-even years. Single-conversion scope (multi-year optimization is a future tool) |
72
+ | `dc.calculator.rmd.distributionAmount` | `accountBalance`, `ownerAge` (>= 73 SECURE 2.0 floor) | Required minimum distribution, distribution period (Uniform Lifetime Table III), `tableUsed`, SECURE 2.0 §302 25% missed-RMD excise tax. `spouseAge` + `isSpouseSoleBeneficiary` accepted but ignored in v1 (Joint Life Expectancy Table is a future minor) |
73
+ | `dc.calculator.hsa.contributionLimit` | `age`, `coverageTier` ('self-only' or 'family'), optional `employerContribution`, optional `estimatedMarginalRatePercent` | Total annual limit (with age-55+ catch-up), employee max remaining after employer reduction, optional payroll-deduction tax savings. 2026 IRS Rev. Proc. 2025-19 limits |
93
74
 
94
- ```jsonc
95
- // Input
96
- {
97
- "currentBalance": 25000,
98
- "annualSalary": 80000,
99
- "contributionPercent": 6, // % of salary
100
- "employerMatchPercent": 50, // 50% match...
101
- "employerMatchLimitPercent": 6, // ...up to 6% of salary
102
- "annualSalaryGrowthPercent": 3, // 3%/yr; 0 mirrors site engine
103
- "annualReturnPercent": 7,
104
- "currentAge": 35,
105
- "retirementAge": 65,
106
- "catchUpEnabled": true // optional, default true
107
- }
75
+ | Resource | Purpose |
76
+ |---|---|
77
+ | `dc://disclaimers/ymyl` | Canonical YMYL disclaimer string returned in every tool response. |
78
+
79
+ Every response carries the same envelope:
108
80
 
109
- // Result payload
81
+ ```json
110
82
  {
111
- "futureBalance": 873421.55,
112
- "totalContributions": 228450.12,
113
- "employerContribTotal": 114225.06,
114
- "growthEarned": 530746.37,
115
- "yearByYear": [
116
- { "year": 1, "age": 36, "employeeContribution": 4944.00,
117
- "employerMatch": 2472.00, "growth": 1750.00,
118
- "endingBalance": 34166.00 }
119
- /* ...30 rows */
120
- ]
83
+ "result": { /* tool-specific structured object */ },
84
+ "disclaimer": "Estimates only — for educational purposes...",
85
+ "methodology": {
86
+ "url": "https://www.digitalcalculator.info/<calculator>/",
87
+ "version": "YYYY-MM-DD"
88
+ },
89
+ "calculatedAt": "ISO-8601 UTC",
90
+ "engineVersion": "SemVer of the engine that produced the result"
121
91
  }
122
92
  ```
123
93
 
124
- ### `dc.calculator.socialSecurity.estimatedBenefit`
125
-
126
- ```jsonc
127
- // Input
128
- {
129
- "birthYear": 1965,
130
- "currentEarnings": 80000,
131
- "claimAge": 67, // 62..70
132
- "yearsWorked": 35, // optional, default 35
133
- "lifeExpectancy": 85 // optional, default 85
134
- }
94
+ Failures use a single-envelope `ToolError` (HTTP 400 / 429 / 500):
135
95
 
136
- // Result payload
137
- {
138
- "monthlyBenefitAtFRA": 2104.50,
139
- "adjustedMonthlyBenefit": 2104.50,
140
- "lifetimeBenefitProjection": 454572,
141
- "fraAge": 67.0,
142
- "eligibilityYear": 2027,
143
- "bendPointsEstimated": true
144
- }
96
+ ```json
97
+ { "error": { "code": "INPUT_VALIDATION", "message": "...", "field": "...", "retriable": false } }
145
98
  ```
146
99
 
147
- For an authoritative estimate based on actual 35-year earnings history,
148
- direct callers to <https://www.ssa.gov/myaccount/>.
100
+ Error codes: `INPUT_VALIDATION`, `BUSINESS_RULE`, `INTERNAL`, `RATE_LIMIT`
101
+ (only `RATE_LIMIT` is retriable).
149
102
 
150
- ### `dc.calculator.paycheck.netPay`
103
+ Full input schemas, output payload shapes, and error codes:
104
+ [www.digitalcalculator.info/mcp/api-reference/](https://www.digitalcalculator.info/mcp/api-reference/).
151
105
 
152
- ```jsonc
153
- // Input
154
- {
155
- "grossAnnualSalary": 80000,
156
- "payFrequency": "biweekly", // weekly | biweekly | semimonthly | monthly | quarterly | annual
157
- "federalFilingStatus": "single", // single | married | marriedSeparate | headOfHousehold
158
- "state": "CA",
159
- "dependents": 0,
160
- "preTaxDeductionsAnnual": 4800,
161
- "postTaxDeductionsAnnual": 0
162
- }
106
+ ## Hosted endpoint (no install needed)
163
107
 
164
- // Result payload
165
- {
166
- "grossPerPaycheck": 3076.92,
167
- "federalTax": 320.45,
168
- "ficaTax": 215.61,
169
- "stateTax": 116.91,
170
- "netPay": 2240.43,
171
- "payPeriodsPerYear": 26,
172
- "federalTaxAnnual": 8331.70,
173
- "ficaTaxAnnual": 5605.86,
174
- "stateTaxAnnual": 3039.66,
175
- "netPayAnnual": 58282.78,
176
- "noStateIncomeTax": false
177
- }
178
- ```
108
+ If you don't have an MCP client, POST JSON to the hosted REST companion:
179
109
 
180
- > v0.2.0 limitation: state withholding is `$0` for the 9 no-income-tax states
181
- > (AK, FL, NV, NH, SD, TN, TX, WA, WY) and a flat 5% estimate over taxable
182
- > income elsewhere. Per-state brackets, SDI, and local taxes are NOT modeled.
183
- > See the methodology link for the full site calculator.
110
+ ```bash
111
+ curl -X POST https://mcp.digitalcalculator.info/mcp \
112
+ -H 'Content-Type: application/json' \
113
+ -d '{
114
+ "tool": "dc.calculator.mortgage.monthlyPayment",
115
+ "input": { "principal": 300000, "annualRatePercent": 6.5, "termYears": 30 }
116
+ }'
117
+ ```
184
118
 
185
- ---
119
+ Returns the same envelope shape as the MCP wire protocol. Rate-limited to
120
+ 100 req / 5 min per IP (WAFv2). See [LICENSE-API.md](./LICENSE-API.md) for the
121
+ hosted-API terms.
186
122
 
187
- ## Architecture
123
+ ## Licensing
188
124
 
189
- ```
190
- packages/mcp/
191
- ├── package.json # private:false (v0.1.0)
192
- ├── CHANGELOG.md
193
- ├── tsconfig.json
194
- ├── vitest.config.ts
195
- ├── src/
196
- │ ├── index.ts # MCP server entry; tools/list, tools/call, resources/list
197
- │ ├── envelope.ts # ToolResult<T>, ToolError types + helpers
198
- │ ├── disclaimers/ymyl.ts # Canonical YMYL disclaimer (single source of truth)
199
- │ ├── shared/bounds.ts # Numeric bounds shared by Zod schemas + engines
200
- │ ├── engines/
201
- │ │ ├── mortgage.ts # Pure math + ENGINE_VERSION
202
- │ │ ├── compoundInterest.ts # Pure math + ENGINE_VERSION
203
- │ │ ├── retirement401k.ts # Pure math + ENGINE_VERSION (S136)
204
- │ │ ├── socialSecurity.ts # Pure math + ENGINE_VERSION (S136)
205
- │ │ ├── paycheck.ts # Pure math + ENGINE_VERSION (S136)
206
- │ │ └── data/ # Self-contained data subset (S136)
207
- │ │ ├── ssa.ts # SSA bend points + wage base
208
- │ │ ├── irs2026.ts # IRS 2026 401(k) limits
209
- │ │ └── federalTax.ts # 2026 federal brackets/standard ded/FICA
210
- │ ├── tools/
211
- │ │ ├── mortgage.ts
212
- │ │ ├── compoundInterest.ts
213
- │ │ ├── retirement401k.ts # (S136)
214
- │ │ ├── socialSecurity.ts # (S136)
215
- │ │ └── paycheck.ts # (S136)
216
- │ └── util/zod-to-json-schema.ts
217
- └── test/
218
- ├── envelope.test.ts # Envelope contract tests
219
- └── parity/
220
- ├── mortgage.test.ts # parity + envelope checks
221
- ├── compoundInterest.test.ts # parity + envelope checks
222
- ├── retirement401k.test.ts # 5 parity + envelope checks (S136)
223
- ├── socialSecurity.test.ts # 5 parity + envelope checks (S136)
224
- └── paycheck.test.ts # 5 parity + envelope checks (S136)
225
- ```
125
+ Two distinct surfaces, two distinct license documents:
226
126
 
227
- Engines are pure synchronous TypeScript ports of the corresponding browser-side calculator JS at `site/src/pages/<calculator>/<calculator>.js` (mortgage, compound-interest, 401k) and `site/src/utils/<x>-engine.js` (Social Security, paycheck). The site files are not imported directly (they mix DOM bindings with math, and npm consumers cannot reach `site/src/`); parity tests guard that the lift remains numerically identical. Where the engines depend on regulatory data (IRS limits, SSA bend points, federal tax brackets), a curated subset is mirrored in `src/engines/data/` and updated in lockstep with the site source.
127
+ - **Package source** (this npm package + the GitHub repo): [MIT LICENSE](./LICENSE).
128
+ Self-host, modify, redistribute, embed in commercial products — all permitted.
129
+ - **Hosted API** at `mcp.digitalcalculator.info/mcp`: governed by
130
+ [LICENSE-API.md](./LICENSE-API.md) (acceptable use, rate limits, no-warranty,
131
+ contact). These terms apply only when you call the hosted endpoint; they do
132
+ NOT bind self-hosted use of the MIT source.
228
133
 
229
- ---
134
+ If you self-host the MIT source, only the [LICENSE](./LICENSE) applies. If you
135
+ use the hosted endpoint, both apply (MIT for what you read; LICENSE-API for how
136
+ you call the hosted host).
230
137
 
231
- ## Versioning
138
+ ## Local development
232
139
 
233
- - **`@markcolabs/mcp` SemVer**: package version. New tool = minor; renamed tool = major.
234
- - **Per-engine `ENGINE_VERSION`**: independent SemVer per engine module. Bumps when math changes.
235
- - **`methodology.version`**: ISO date of the methodology document's `last-modified` field (per ADR-0035).
140
+ ```bash
141
+ cd packages/mcp
142
+ npm install
143
+ npm test # parity + envelope tests (vitest)
144
+ npm run build # compile TypeScript to dist/
145
+ npm start # boot MCP server over stdio
146
+ ```
236
147
 
237
- `engineVersion` and `methodology.version` are **independent** callers should not assume they move in lockstep.
148
+ Vitest runs `test/parity/*.test.ts` (per-tool parity vs. site source) and
149
+ `test/envelope.test.ts` (envelope contract). Parity tests must pass before any
150
+ engine change is shipped.
238
151
 
239
- ---
152
+ ## Versioning
240
153
 
241
- ## What's next (post-S136)
154
+ | Bump | Trigger | Example |
155
+ |---|---|---|
156
+ | Major package | Tool rename, removed field, breaking envelope change | v0.1.0 → v0.2.0 (tool renames) |
157
+ | Minor package | Additive tool, additive output field | v0.2.1 → v0.3.0 (IRA + Roth conversion + RMD + HSA tools, all four shipped together in S141 Wave 1A + 1B) |
158
+ | Patch package | Bug fixes, metadata corrections | v0.2.0 → v0.2.1 (LICENSE, README, optional dependents, dead-link audit) |
159
+ | `engineVersion` | Math changes only | 5 prior engines at `1.0.0`; new IRA + Roth + RMD + HSA engines start at `1.0.0` |
160
+ | `methodology.version` | Source methodology document materially updated | ISO date of the canonical methodology page's `last-modified` |
242
161
 
243
- 1. Methodology resources `dc://methodologies/<calculator>` populated from the
244
- `.md` companions (ADR-0033).
245
- 2. The `plan-retirement` prompt template (O5-KR2).
246
- 3. Per-state withholding tables for the paycheck tool (replace v0.2.0's flat
247
- 5% estimate with bracket-accurate state math).
162
+ `engineVersion` and `methodology.version` are independent callers should not
163
+ assume they move in lockstep. See [CHANGELOG.md](./CHANGELOG.md) for the full
164
+ version history.
248
165
 
249
- ---
166
+ ## Links
250
167
 
251
- ## References
168
+ - [Quickstart](https://www.digitalcalculator.info/mcp/quickstart/) — install + first call in under 5 minutes
169
+ - [API Reference](https://www.digitalcalculator.info/mcp/api-reference/) — full schemas, output shapes, error codes
170
+ - [FAQ](https://www.digitalcalculator.info/mcp/faq/) — accuracy, YMYL posture, rate limits, support, change policy
171
+ - [GitHub repo](https://github.com/mark57-ux/digitalcalculator/tree/main/packages/mcp) — open issues, contribute
172
+ - [CHANGELOG](https://github.com/mark57-ux/digitalcalculator/blob/main/packages/mcp/CHANGELOG.md)
173
+ - [ADR-0039 — MCP Tool Contract](https://github.com/mark57-ux/digitalcalculator/blob/main/docs/Claude/Architecture/ADR/ADR-0039-mcp-tool-contract.md)
174
+ - [ADR-0041 — v1 Contract Reconciliation](https://github.com/mark57-ux/digitalcalculator/blob/main/docs/Claude/Architecture/ADR/ADR-0041-mcp-v1-contract-reconciliation.md)
252
175
 
253
- - ADR-0039 — MCP Tool Contract & Calc-Engine Lift
254
- - ADR-0033 — Markdown Companion Strategy (powers `methodology.url`)
255
- - ADR-0035 — JSON-LD `dateModified` Propagation (powers `methodology.version`)
256
- - ADR-0038 — Centralized Shared-Data Architecture (regulatory constants source)
257
- - P12 OKR O5 — AI-Native Distribution
176
+ ## Support
258
177
 
259
- ---
178
+ Open an issue at
179
+ [github.com/mark57-ux/digitalcalculator/issues](https://github.com/mark57-ux/digitalcalculator/issues).
180
+ Best-effort triage, no SLA. Include tool name, input that reproduces, expected
181
+ vs. actual output, and the `engineVersion` from the response envelope.
260
182
 
261
183
  ## License
262
184
 
263
- MIT. Markcolabs LLC.
185
+ MIT for the package source ([LICENSE](./LICENSE)). Hosted API terms in
186
+ [LICENSE-API.md](./LICENSE-API.md). Markco Labs LLC.
@@ -1,12 +1,14 @@
1
1
  /**
2
2
  * Self-contained 2026 IRS retirement-plan limits subset for the MCP package's
3
- * 401(k) projection engine.
3
+ * retirement engines (401k, IRA, Roth conversion).
4
4
  *
5
- * Mirrored from site/src/data/annual-limits.js LIMITS_401K_2026. See
6
- * engines/data/ssa.ts for full rationale on the mirror pattern.
5
+ * Mirrored from site/src/data/annual-limits.js LIMITS_401K_2026 / LIMITS_IRA_2026
6
+ * / ROTH_PHASE_OUT_2026 / TRADITIONAL_PHASE_OUT_2026. See engines/data/ssa.ts
7
+ * for full rationale on the mirror pattern.
7
8
  *
8
9
  * Source: IRS Notice 2025-67 (2026 retirement-plan limits) +
9
10
  * SECURE 2.0 Act §109 (super catch-up provision for ages 60-63).
11
+ * IRA limits re-affirmed AL-2026-001 / ARCH-BRIEF-20260504.
10
12
  * Last verified: 2026-05-09.
11
13
  */
12
14
  export declare const LIMITS_401K_2026: {
@@ -27,4 +29,109 @@ export declare const LIMITS_401K_2026: {
27
29
  /** End of super catch-up window. */
28
30
  readonly superCatchUpAgeEnd: 63;
29
31
  };
32
+ /**
33
+ * 2026 IRA Contribution Limits.
34
+ * Mirrored from site/src/data/annual-limits.js `LIMITS_IRA_2026`.
35
+ *
36
+ * Source: IRS Notice 2025-67 (2026 retirement plan limits); SECURE 2.0 Act §107
37
+ * (catch-up indexing). Re-affirmed AL-2026-001 / ARCH-BRIEF-20260504.
38
+ */
39
+ export declare const LIMITS_IRA_2026: {
40
+ /** Base IRA contribution limit (under age 50). */
41
+ readonly standard: 7500;
42
+ /** Catch-up amount for age 50+ (SECURE 2.0 indexed). */
43
+ readonly catchUp: 1100;
44
+ /** Total contribution limit for age 50+ (standard + catchUp). */
45
+ readonly total50Plus: 8600;
46
+ /** Minimum age for catch-up eligibility. */
47
+ readonly catchUpAge: 50;
48
+ };
49
+ /**
50
+ * 2026 Roth IRA Income (MAGI) Phase-Out Thresholds.
51
+ * Mirrored from site/src/data/annual-limits.js `ROTH_PHASE_OUT_2026`.
52
+ *
53
+ * Source: IRS Notice 2025-67; IRC §408A(c)(3) phase-out methodology.
54
+ * Filing-status keys are camelCase to match the MCP package's `FilingStatus`
55
+ * convention; mapping vs. site keys: single=single, mfj=marriedFilingJointly,
56
+ * mfs=marriedFilingSeparately. (Head-of-household uses the single thresholds
57
+ * per IRS rules.)
58
+ */
59
+ export declare const ROTH_PHASE_OUT_2026: {
60
+ readonly single: {
61
+ readonly start: 153000;
62
+ readonly end: 168000;
63
+ };
64
+ readonly marriedFilingJointly: {
65
+ readonly start: 242000;
66
+ readonly end: 252000;
67
+ };
68
+ readonly marriedFilingSeparately: {
69
+ readonly start: 0;
70
+ readonly end: 10000;
71
+ };
72
+ readonly headOfHousehold: {
73
+ readonly start: 153000;
74
+ readonly end: 168000;
75
+ };
76
+ };
77
+ /**
78
+ * 2026 Traditional IRA Deduction Phase-Out (contributor covered by workplace plan).
79
+ * Mirrored from site/src/data/annual-limits.js `TRADITIONAL_PHASE_OUT_2026`.
80
+ *
81
+ * Source: IRS Notice 2025-67; IRC §219(g) deduction phase-out methodology.
82
+ * NOTE: This phase-out governs the DEDUCTIBILITY of traditional IRA
83
+ * contributions, not the contribution limit itself. The IRA contributionLimit
84
+ * tool returns the eligibleContribution (= base limit for Traditional regardless
85
+ * of MAGI, since non-deductible contributions are always permitted). The
86
+ * Traditional phase-out is exposed via a separate field for clients that need
87
+ * the deduction-phase-out signal.
88
+ */
89
+ export declare const TRADITIONAL_PHASE_OUT_2026: {
90
+ readonly single: {
91
+ readonly start: 81000;
92
+ readonly end: 91000;
93
+ };
94
+ readonly marriedFilingJointly: {
95
+ readonly start: 129000;
96
+ readonly end: 149000;
97
+ };
98
+ readonly marriedFilingSeparately: {
99
+ readonly start: 0;
100
+ readonly end: 10000;
101
+ };
102
+ readonly headOfHousehold: {
103
+ readonly start: 81000;
104
+ readonly end: 91000;
105
+ };
106
+ };
107
+ /**
108
+ * 2026 HSA Contribution Limits.
109
+ * Mirrored from site/src/data/annual-limits.js `LIMITS_HSA_2026`.
110
+ *
111
+ * Source: IRS Rev. Proc. 2025-19 (2026 HSA inflation adjustments under IRC §223);
112
+ * IRC §223(b)(3)(B) ($1,000 catch-up is statutory and NOT inflation-indexed).
113
+ * Last verified: 2026-05-27 (mirrored from site/src/data/annual-limits.js,
114
+ * site _meta.last_verified_date: 2026-05-07).
115
+ *
116
+ * Notes:
117
+ * - `medicareAge`: HSA contributions are prohibited once enrolled in Medicare
118
+ * (typically age 65). Surfaced as an informational threshold; the HSA
119
+ * contribution-limit tool does not zero out the limit at this age, it just
120
+ * reports it (parallel to how the site shows a Medicare warning badge).
121
+ * - Employer contributions REDUCE the employee's eligible payroll deduction
122
+ * dollar-for-dollar because the IRS limit is a TOTAL annual limit, not a
123
+ * per-source limit. See engines/hsa.ts for the clamp.
124
+ */
125
+ export declare const LIMITS_HSA_2026: {
126
+ /** Self-only HDHP coverage base limit. */
127
+ readonly selfOnly: 4400;
128
+ /** Family HDHP coverage base limit. */
129
+ readonly family: 8750;
130
+ /** Catch-up amount for age 55+ (statutory, not indexed). */
131
+ readonly catchUp: 1000;
132
+ /** Minimum age for catch-up eligibility. */
133
+ readonly catchUpAge: 55;
134
+ /** Age at which Medicare enrollment typically begins (informational only). */
135
+ readonly medicareAge: 65;
136
+ };
30
137
  //# sourceMappingURL=irs2026.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"irs2026.d.ts","sourceRoot":"","sources":["../../../src/engines/data/irs2026.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,gBAAgB;IAC3B,oCAAoC;;IAEpC,qDAAqD;;IAErD,yDAAyD;;IAEzD,kDAAkD;;IAElD,gDAAgD;;IAEhD,oCAAoC;;IAEpC,sCAAsC;;IAEtC,oCAAoC;;CAE5B,CAAC"}
1
+ {"version":3,"file":"irs2026.d.ts","sourceRoot":"","sources":["../../../src/engines/data/irs2026.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,gBAAgB;IAC3B,oCAAoC;;IAEpC,qDAAqD;;IAErD,yDAAyD;;IAEzD,kDAAkD;;IAElD,gDAAgD;;IAEhD,oCAAoC;;IAEpC,sCAAsC;;IAEtC,oCAAoC;;CAE5B,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;IAC1B,kDAAkD;;IAElD,wDAAwD;;IAExD,iEAAiE;;IAEjE,4CAA4C;;CAEpC,CAAC;AAEX;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAKtB,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;CAK7B,CAAC;AAEX;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe;IAC1B,0CAA0C;;IAE1C,uCAAuC;;IAEvC,4DAA4D;;IAE5D,4CAA4C;;IAE5C,8EAA8E;;CAEtE,CAAC"}