localnest_update_self
Update the LocalNest MCP server globally via npm and synchronize bundled skills. Supports stable, beta, or specific version targets with explicit user approval.
Instructions
Update localnest-mcp globally via npm and sync bundled skill. Supports stable, beta, or explicit version targets. Requires explicit user approval.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| approved_by_user | No | ||
| dry_run | No | ||
| version | No | latest | |
| reinstall_skill | No | ||
| response_format | No | json |
Implementation Reference
- src/services/update/service.js:250-316 (handler)The selfUpdate method within UpdateService handles the actual npm update and skill synchronization logic, including a dry-run mode and an explicit user approval requirement.
async selfUpdate({ approvedByUser = false, dryRun = false, version = 'latest', reinstallSkill = true } = {}) { if (!approvedByUser) { return { ok: false, skipped: true, reason: 'approval_required', message: 'User approval is required. Ask: "LocalNest has a newer version. Update now?"' }; } const installStep = buildInstallCommand(this.packageName, version); const skillStep = buildSkillSyncCommand(); const planned = [ [installStep.command, ...installStep.args].join(' '), reinstallSkill ? [skillStep.command, ...skillStep.args].join(' ') : null ].filter(Boolean); if (dryRun) { const validation = this.buildDryRunValidation({ reinstallSkill, version }); return { ok: validation.ok, skipped: true, dry_run: true, validation, planned_commands: planned, restart_required: true }; } const installResult = this.runCommand(installStep.command, installStep.args); if (!installResult.ok) { return { ok: false, step: 'npm_install', restart_required: false, planned_commands: planned, install: installResult }; } let skillResult = null; if (reinstallSkill) { skillResult = this.runCommand(skillStep.command, skillStep.args); if (!skillResult.ok) { return { ok: false, step: 'skill_sync', restart_required: false, planned_commands: planned, install: installResult, skill_sync: skillResult }; } } const status = await this.getStatus({ force: true, channel: normalizeUpdateChannel(version) || 'stable' }); return { ok: true, step: 'completed', restart_required: true, planned_commands: planned, install: installResult, skill_sync: skillResult, update_status: status }; } } - src/mcp/tools/core.js:92-118 (registration)Registration of the 'localnest_update_self' tool in the core tools registry, which calls the updates.selfUpdate service method.
registerJsonTool( ['localnest_update_self'], { title: 'Update Self', description: 'Update localnest-mcp globally via npm and sync bundled skill. Supports stable, beta, or explicit version targets. Requires explicit user approval.', inputSchema: { approved_by_user: z.boolean().default(false), dry_run: z.boolean().default(false), version: z.string().default('latest'), reinstall_skill: z.boolean().default(true) }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true } }, async ({ approved_by_user, dry_run, version, reinstall_skill }) => normalizeUpdateSelfResult( await updates.selfUpdate({ approvedByUser: approved_by_user, dryRun: dry_run, version, reinstallSkill: reinstall_skill }) ) );