@nestpilot/mcp-app 1.0.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/README.md +350 -0
- package/dist/cli/doctor.d.ts +1 -0
- package/dist/cli/doctor.js +214 -0
- package/dist/cli/export-import.d.ts +6 -0
- package/dist/cli/export-import.js +132 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +168 -0
- package/dist/cli/init.d.ts +1 -0
- package/dist/cli/init.js +171 -0
- package/dist/host-configs/cowork.json +11 -0
- package/dist/host-configs/goose.yaml +22 -0
- package/dist/host-configs/openclaw-manifest.json +16 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +128 -0
- package/dist/mcp-app.html +155 -0
- package/dist/nestpilot-client.d.ts +44 -0
- package/dist/nestpilot-client.js +160 -0
- package/dist/planner.html +222 -0
- package/dist/server.d.ts +19 -0
- package/dist/server.js +245 -0
- package/dist/skills/SKILL.md +162 -0
- package/dist/skills/manifest.json +51 -0
- package/dist/skills/tools/activate_plan.md +36 -0
- package/dist/skills/tools/coach.md +59 -0
- package/dist/skills/tools/comprehensive_plan.md +65 -0
- package/dist/skills/tools/create_plan.md +59 -0
- package/dist/skills/tools/create_saved_plan.md +49 -0
- package/dist/skills/tools/delete_plan.md +42 -0
- package/dist/skills/tools/delete_scenario.md +38 -0
- package/dist/skills/tools/generate_proposal.md +63 -0
- package/dist/skills/tools/generate_retirement_report.md +50 -0
- package/dist/skills/tools/get_active_plan.md +44 -0
- package/dist/skills/tools/get_baseline_forecast.md +47 -0
- package/dist/skills/tools/get_plan.md +44 -0
- package/dist/skills/tools/get_plan_components.md +50 -0
- package/dist/skills/tools/get_scenario.md +46 -0
- package/dist/skills/tools/list_plans.md +44 -0
- package/dist/skills/tools/list_scenarios.md +42 -0
- package/dist/skills/tools/medicare-guardian.md +59 -0
- package/dist/skills/tools/nestpilot_run_plan.md +61 -0
- package/dist/skills/tools/optimize_roth_conversion.md +107 -0
- package/dist/skills/tools/optimize_ss_claiming.md +30 -0
- package/dist/skills/tools/rename_plan.md +34 -0
- package/dist/skills/tools/retirement-planner.md +55 -0
- package/dist/skills/tools/run_forecast.md +65 -0
- package/dist/skills/tools/run_saved_forecast.md +52 -0
- package/dist/skills/tools/run_scenario.md +66 -0
- package/dist/skills/tools/save_plan.md +48 -0
- package/dist/skills/tools/save_scenario.md +50 -0
- package/dist/skills/tools/verify_forecast.md +43 -0
- package/dist/src/config.d.ts +20 -0
- package/dist/src/config.js +44 -0
- package/dist/src/contracts/provenance.d.ts +37 -0
- package/dist/src/contracts/provenance.js +71 -0
- package/dist/src/contracts/tool-contract-registry.d.ts +43 -0
- package/dist/src/contracts/tool-contract-registry.js +282 -0
- package/dist/src/local/cloud-compute-client.d.ts +55 -0
- package/dist/src/local/cloud-compute-client.js +135 -0
- package/dist/src/local/encryption.d.ts +24 -0
- package/dist/src/local/encryption.js +105 -0
- package/dist/src/local/keychain.d.ts +41 -0
- package/dist/src/local/keychain.js +236 -0
- package/dist/src/local/local-config.d.ts +34 -0
- package/dist/src/local/local-config.js +61 -0
- package/dist/src/local/local-data-layer.d.ts +20 -0
- package/dist/src/local/local-data-layer.js +15 -0
- package/dist/src/local/local-plan-store.d.ts +66 -0
- package/dist/src/local/local-plan-store.js +195 -0
- package/dist/src/local/pii-scrubber.d.ts +26 -0
- package/dist/src/local/pii-scrubber.js +219 -0
- package/dist/src/policy/policy-engine.d.ts +44 -0
- package/dist/src/policy/policy-engine.js +119 -0
- package/dist/src/rate-limit.d.ts +17 -0
- package/dist/src/rate-limit.js +41 -0
- package/dist/src/security.d.ts +19 -0
- package/dist/src/security.js +118 -0
- package/dist/src/skills/index.d.ts +12 -0
- package/dist/src/skills/index.js +16 -0
- package/dist/src/skills/retirement-pack-v1.d.ts +28 -0
- package/dist/src/skills/retirement-pack-v1.js +295 -0
- package/dist/src/skills/skill-executor.d.ts +65 -0
- package/dist/src/skills/skill-executor.js +174 -0
- package/dist/src/skills/skill-manifest-schema.d.ts +337 -0
- package/dist/src/skills/skill-manifest-schema.js +94 -0
- package/dist/src/skills/skill-registry.d.ts +71 -0
- package/dist/src/skills/skill-registry.js +116 -0
- package/dist/src/telemetry.d.ts +12 -0
- package/dist/src/telemetry.js +59 -0
- package/dist/src/types.d.ts +46 -0
- package/dist/src/types.js +4 -0
- package/dist/tools/agent-tools.d.ts +12 -0
- package/dist/tools/agent-tools.js +141 -0
- package/dist/tools/forecast-management-tools.d.ts +9 -0
- package/dist/tools/forecast-management-tools.js +133 -0
- package/dist/tools/local-plan-tools.d.ts +8 -0
- package/dist/tools/local-plan-tools.js +357 -0
- package/dist/tools/mcp-helpers.d.ts +52 -0
- package/dist/tools/mcp-helpers.js +177 -0
- package/dist/tools/medicare-tools.d.ts +3 -0
- package/dist/tools/medicare-tools.js +162 -0
- package/dist/tools/optimize-roth-tools-test.d.ts +2 -0
- package/dist/tools/optimize-roth-tools-test.js +36 -0
- package/dist/tools/optimize-roth-tools.d.ts +3 -0
- package/dist/tools/optimize-roth-tools.js +818 -0
- package/dist/tools/plan-management-tools.d.ts +3 -0
- package/dist/tools/plan-management-tools.js +196 -0
- package/dist/tools/planning-tools.d.ts +3 -0
- package/dist/tools/planning-tools.js +290 -0
- package/dist/tools/proposal-tools.d.ts +3 -0
- package/dist/tools/proposal-tools.js +428 -0
- package/dist/tools/report-tools.d.ts +3 -0
- package/dist/tools/report-tools.js +245 -0
- package/dist/tools/scenario-management-tools.d.ts +3 -0
- package/dist/tools/scenario-management-tools.js +136 -0
- package/dist/views/verification-packet.html +211 -0
- package/host-configs/cowork.json +11 -0
- package/host-configs/goose.yaml +22 -0
- package/host-configs/openclaw-manifest.json +16 -0
- package/package.json +66 -0
- package/skills/SKILL.md +162 -0
- package/skills/manifest.json +51 -0
- package/skills/tools/activate_plan.md +36 -0
- package/skills/tools/coach.md +59 -0
- package/skills/tools/comprehensive_plan.md +65 -0
- package/skills/tools/create_plan.md +59 -0
- package/skills/tools/create_saved_plan.md +49 -0
- package/skills/tools/delete_plan.md +42 -0
- package/skills/tools/delete_scenario.md +38 -0
- package/skills/tools/generate_proposal.md +63 -0
- package/skills/tools/generate_retirement_report.md +50 -0
- package/skills/tools/get_active_plan.md +44 -0
- package/skills/tools/get_baseline_forecast.md +47 -0
- package/skills/tools/get_plan.md +44 -0
- package/skills/tools/get_plan_components.md +50 -0
- package/skills/tools/get_scenario.md +46 -0
- package/skills/tools/list_plans.md +44 -0
- package/skills/tools/list_scenarios.md +42 -0
- package/skills/tools/medicare-guardian.md +59 -0
- package/skills/tools/nestpilot_run_plan.md +61 -0
- package/skills/tools/optimize_roth_conversion.md +107 -0
- package/skills/tools/optimize_ss_claiming.md +30 -0
- package/skills/tools/rename_plan.md +34 -0
- package/skills/tools/retirement-planner.md +55 -0
- package/skills/tools/run_forecast.md +65 -0
- package/skills/tools/run_saved_forecast.md +52 -0
- package/skills/tools/run_scenario.md +66 -0
- package/skills/tools/save_plan.md +48 -0
- package/skills/tools/save_scenario.md +50 -0
- package/skills/tools/verify_forecast.md +43 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NestPilot Medicare Guardian — MCP tool registrations.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from server.ts for domain separation.
|
|
5
|
+
* Registers three tools and one UI resource:
|
|
6
|
+
* 1. medicare-guardian (public, has UI) — launches the interactive view
|
|
7
|
+
* 2. medicare-analyze (backend proxy) — proxies analysis to Spring Boot API
|
|
8
|
+
* 3. email-subscribe (backend proxy) — proxies email subscription to API
|
|
9
|
+
*
|
|
10
|
+
* @feature FEAT-0052
|
|
11
|
+
*/
|
|
12
|
+
import { registerAppResource, registerAppTool, RESOURCE_MIME_TYPE, } from "@modelcontextprotocol/ext-apps/server";
|
|
13
|
+
import fs from "node:fs/promises";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
import { toCallToolResult, proxyPostTool, } from "./mcp-helpers.js";
|
|
17
|
+
// Works both from source (tools/*.ts) and compiled (dist/)
|
|
18
|
+
const DIST_DIR = import.meta.filename.endsWith(".ts")
|
|
19
|
+
? path.join(import.meta.dirname, "..", "dist")
|
|
20
|
+
: path.join(import.meta.dirname);
|
|
21
|
+
export function registerMedicareTools(server, authCtx) {
|
|
22
|
+
const resourceUri = "ui://medicare-guardian/mcp-app.html";
|
|
23
|
+
// ── 1. medicare-guardian ─────────────────────────────────────────────
|
|
24
|
+
// Public tool with linked UI. The host renders the view when invoked.
|
|
25
|
+
registerAppTool(server, "medicare-guardian", {
|
|
26
|
+
title: "Medicare Deadline Guardian",
|
|
27
|
+
description: `Open the Medicare Guardian to help users understand their Medicare enrollment deadlines and avoid lifetime penalties.
|
|
28
|
+
|
|
29
|
+
USE THIS TOOL WHEN THE USER:
|
|
30
|
+
- Asks about Medicare enrollment, Part A, Part B, or Part D
|
|
31
|
+
- Is turning 65 or already past 65 and has Medicare questions
|
|
32
|
+
- Wants to know when to sign up for Medicare
|
|
33
|
+
- Asks about Medicare late enrollment penalties or premium surcharges
|
|
34
|
+
- Mentions retiring and needs to switch from employer coverage to Medicare
|
|
35
|
+
- Asks about Special Enrollment Periods (SEP) or Initial Enrollment Period (IEP)
|
|
36
|
+
- Wonders if they can delay Medicare while still working
|
|
37
|
+
- Asks about COBRA and Medicare coordination or timing
|
|
38
|
+
- Wants deadline reminders for Medicare enrollment
|
|
39
|
+
- Asks about Medicare IRMAA (Income-Related Monthly Adjustment Amount)
|
|
40
|
+
- Needs to understand creditable vs non-creditable drug coverage
|
|
41
|
+
- Has questions about employer coverage and Medicare coordination
|
|
42
|
+
|
|
43
|
+
DO NOT USE FOR:
|
|
44
|
+
- Comparing specific Medicare Advantage or Medigap plan prices/benefits
|
|
45
|
+
- Medical diagnosis, treatment, or prescription questions
|
|
46
|
+
- Retirement investment strategy (401k, IRA, stocks, pensions)
|
|
47
|
+
- Social Security benefit calculations or claiming strategies
|
|
48
|
+
- General health insurance brokerage or plan shopping`,
|
|
49
|
+
inputSchema: {
|
|
50
|
+
mode: z
|
|
51
|
+
.enum(["timeline", "sep_check", "penalty_estimate"])
|
|
52
|
+
.default("timeline")
|
|
53
|
+
.describe("Widget mode: 'timeline', 'sep_check', or 'penalty_estimate'"),
|
|
54
|
+
},
|
|
55
|
+
_meta: {
|
|
56
|
+
ui: {
|
|
57
|
+
resourceUri,
|
|
58
|
+
visibility: ["model", "app"],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
}, async (args) => {
|
|
62
|
+
const { mode = "timeline" } = args;
|
|
63
|
+
return {
|
|
64
|
+
content: [
|
|
65
|
+
{
|
|
66
|
+
type: "text",
|
|
67
|
+
text: JSON.stringify({
|
|
68
|
+
mode,
|
|
69
|
+
message: `Initialized in ${mode} mode`,
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
// ── 2. medicare-analyze ──────────────────────────────────────────────
|
|
76
|
+
// Backend proxy — called by the view via app.callServerTool().
|
|
77
|
+
server.tool("medicare-analyze", "Analyzes a user's Medicare situation. Called by the Medicare Guardian view to compute enrollment deadlines, penalty estimates, and a readiness score. Do not call this tool directly — it is used internally by the Medicare Guardian UI.", {
|
|
78
|
+
dateOfBirth: z.string().describe("Date of birth in YYYY-MM-DD format"),
|
|
79
|
+
employmentStatus: z
|
|
80
|
+
.enum(["WORKING", "RETIRED", "NOT_WORKING"])
|
|
81
|
+
.describe("Current employment status"),
|
|
82
|
+
coverageType: z
|
|
83
|
+
.enum([
|
|
84
|
+
"NONE",
|
|
85
|
+
"EMPLOYER_CURRENT",
|
|
86
|
+
"RETIREE",
|
|
87
|
+
"COBRA",
|
|
88
|
+
"MARKETPLACE",
|
|
89
|
+
"TRICARE",
|
|
90
|
+
"VA",
|
|
91
|
+
])
|
|
92
|
+
.describe("Current health coverage type"),
|
|
93
|
+
employerSize: z
|
|
94
|
+
.enum(["LESS_THAN_20", "BETWEEN_20_AND_99", "100_PLUS"])
|
|
95
|
+
.optional()
|
|
96
|
+
.describe("Employer size (required when coverageType is EMPLOYER_CURRENT)"),
|
|
97
|
+
hsaContributor: z
|
|
98
|
+
.boolean()
|
|
99
|
+
.default(false)
|
|
100
|
+
.describe("Contributing to an HSA"),
|
|
101
|
+
hasCreditableDrugCoverage: z
|
|
102
|
+
.boolean()
|
|
103
|
+
.default(false)
|
|
104
|
+
.describe("Has creditable (Part D equivalent) drug coverage"),
|
|
105
|
+
}, async (args) => {
|
|
106
|
+
const result = await proxyPostTool("/api/medicare/guardian/analyze", args, { toolName: "medicare-analyze", authCtx });
|
|
107
|
+
// If proxyPostTool returned an error, pass it through
|
|
108
|
+
if (result.isError) {
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
// Normalise the backend response into a flat structure for the view.
|
|
112
|
+
// Unwrap provenance envelope if present (FEAT-0056 pipeline).
|
|
113
|
+
const textContent = result.content[0];
|
|
114
|
+
const parsed = JSON.parse(textContent.text);
|
|
115
|
+
const data = (parsed.data ?? parsed);
|
|
116
|
+
const summary = data.summary ?? {};
|
|
117
|
+
const responseData = {
|
|
118
|
+
status: summary.status,
|
|
119
|
+
healthScore: summary.healthScore,
|
|
120
|
+
deadlines: data.deadlines ?? [],
|
|
121
|
+
penalties: data.penalties ?? {},
|
|
122
|
+
checklist: data.checklist ?? [],
|
|
123
|
+
explanations: data.explanations ?? [],
|
|
124
|
+
};
|
|
125
|
+
return toCallToolResult(responseData);
|
|
126
|
+
});
|
|
127
|
+
// ── 3. email-subscribe ───────────────────────────────────────────────
|
|
128
|
+
// Backend proxy — subscribes a user to Medicare deadline reminders.
|
|
129
|
+
server.tool("email-subscribe", "Subscribes a user to Medicare deadline reminder emails. Called by the Medicare Guardian view after analysis. Do not call this tool directly — it is used internally by the Medicare Guardian UI.", {
|
|
130
|
+
email: z.string().describe("User's email address"),
|
|
131
|
+
score: z.number().describe("Medicare readiness score from analysis"),
|
|
132
|
+
iepEndDate: z
|
|
133
|
+
.string()
|
|
134
|
+
.optional()
|
|
135
|
+
.describe("IEP end date in YYYY-MM-DD if known"),
|
|
136
|
+
source: z
|
|
137
|
+
.string()
|
|
138
|
+
.default("mcp_medicare_guardian")
|
|
139
|
+
.describe("Sign-up source identifier"),
|
|
140
|
+
}, async (args) => {
|
|
141
|
+
const result = await proxyPostTool("/api/medicare/subscribe", args, { authCtx });
|
|
142
|
+
if (result.isError) {
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
const textContent = result.content[0];
|
|
146
|
+
const data = JSON.parse(textContent.text);
|
|
147
|
+
return toCallToolResult({
|
|
148
|
+
success: true,
|
|
149
|
+
message: data.message ?? "Subscribed!",
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
// ── UI Resource ──────────────────────────────────────────────────────
|
|
153
|
+
// Serves the bundled single-file HTML for the Medicare Guardian view.
|
|
154
|
+
registerAppResource(server, resourceUri, resourceUri, { mimeType: RESOURCE_MIME_TYPE }, async () => {
|
|
155
|
+
const html = await fs.readFile(path.join(DIST_DIR, "mcp-app.html"), "utf-8");
|
|
156
|
+
return {
|
|
157
|
+
contents: [
|
|
158
|
+
{ uri: resourceUri, mimeType: RESOURCE_MIME_TYPE, text: html },
|
|
159
|
+
],
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simplified Roth conversion optimization MCP tool for testing — FEAT-0066
|
|
3
|
+
*/
|
|
4
|
+
import { registerAppTool } from "@modelcontextprotocol/ext-apps/server";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { toCallToolResult } from "./mcp-helpers.js";
|
|
7
|
+
export function registerRothTools(server) {
|
|
8
|
+
console.log("registerRothTools: Starting registration...");
|
|
9
|
+
registerAppTool(server, "optimize_roth_conversion", {
|
|
10
|
+
title: "Optimize Roth Conversion",
|
|
11
|
+
description: `Test Roth conversion optimization tool.`,
|
|
12
|
+
inputSchema: {
|
|
13
|
+
filingStatus: z
|
|
14
|
+
.enum(["SINGLE", "MFJ", "MFS", "HOH"])
|
|
15
|
+
.describe("Tax filing status"),
|
|
16
|
+
currentAge: z
|
|
17
|
+
.number()
|
|
18
|
+
.int()
|
|
19
|
+
.min(18)
|
|
20
|
+
.max(100)
|
|
21
|
+
.describe("Current age"),
|
|
22
|
+
},
|
|
23
|
+
_meta: {
|
|
24
|
+
ui: {
|
|
25
|
+
visibility: ["model", "app"],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}, async (args) => {
|
|
29
|
+
console.log("optimize_roth_conversion tool called with args:", args);
|
|
30
|
+
return toCallToolResult({
|
|
31
|
+
message: "Test tool executed successfully",
|
|
32
|
+
args,
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
console.log("registerRothTools: Registration complete");
|
|
36
|
+
}
|