manage_network_lock
Control Tailscale network lock operations to manage key authority, enabling or disabling security features, and adding or removing authorized keys via the MCP server.
Instructions
Manage Tailscale network lock (key authority) for enhanced security
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keyId | No | Key ID for remove operations | |
| operation | Yes | Network lock operation to perform | |
| publicKey | No | Public key for add/remove operations |
Implementation Reference
- src/tools/acl-tools.ts:403-457 (handler)The handler function that implements the logic for the manage_network_lock tool. It handles network lock operations (status, enable, disable) by calling Tailscale API methods and returns success or error responses.async function manageNetworkLock( args: z.infer<typeof NetworkLockSchema>, context: ToolContext, ): Promise<CallToolResult> { try { logger.debug("Managing network lock:", args); switch (args.operation) { case "status": { const result = await context.api.getNetworkLockStatus(); if (!result.success) { return returnToolError(result.error); } const status = result.data; return returnToolSuccess( `Network Lock Status: - Enabled: ${status?.enabled ? "Yes" : "No"} - Node Key: ${status?.nodeKey || "Not available"} - Trusted Keys: ${status?.trustedKeys?.length || 0}`, ); } case "enable": { const result = await context.api.enableNetworkLock(); if (!result.success) { return returnToolError(result.error); } return returnToolSuccess( `Network lock enabled successfully. Key: ${ result.data?.key || "Generated" }`, ); } case "disable": { const result = await context.api.disableNetworkLock(); if (!result.success) { return returnToolError(result.error); } return returnToolSuccess("Network lock disabled successfully"); } default: return returnToolError( "Invalid network lock operation. Use: status, enable, disable, add_key, remove_key, or list_keys", ); } } catch (error) { logger.error("Error managing network lock:", error); return returnToolError(error); } }
- src/tools/acl-tools.ts:95-104 (schema)Zod input schema defining the parameters for the manage_network_lock tool, including operation type and optional keys.const NetworkLockSchema = z.object({ operation: z .enum(["status", "enable", "disable", "add_key", "remove_key", "list_keys"]) .describe("Network lock operation to perform"), publicKey: z .string() .optional() .describe("Public key for add/remove operations"), keyId: z.string().optional().describe("Key ID for remove operations"), });
- src/tools/acl-tools.ts:536-542 (registration)Registration of the manage_network_lock tool within the aclTools ToolModule, specifying name, description, inputSchema, and handler.{ name: "manage_network_lock", description: "Manage Tailscale network lock (key authority) for enhanced security", inputSchema: NetworkLockSchema, handler: manageNetworkLock, },