tunnel_create
Create ephemeral secrets stored only in memory with optional self-destruction via TTL or read limits, preventing disk persistence.
Instructions
Create an ephemeral secret that exists only in memory (quantum tunneling). Never persisted to disk. Optional TTL and max-reads for self-destruction.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | The secret value | |
| ttlSeconds | No | Auto-expire after N seconds | |
| maxReads | No | Self-destruct after N reads |
Implementation Reference
- src/mcp/server.ts:358-373 (handler)Registration and MCP tool handler for "tunnel_create" in src/mcp/server.ts. It calls the core logic from `src/core/tunnel.ts`.
server.tool( "tunnel_create", "Create an ephemeral secret that exists only in memory (quantum tunneling). Never persisted to disk. Optional TTL and max-reads for self-destruction.", { value: z.string().describe("The secret value"), ttlSeconds: z.number().optional().describe("Auto-expire after N seconds"), maxReads: z.number().optional().describe("Self-destruct after N reads"), }, async (params) => { const id = tunnelCreate(params.value, { ttlSeconds: params.ttlSeconds, maxReads: params.maxReads, }); return text(id); }, ); - src/core/tunnel.ts:53-70 (handler)The actual implementation logic for tunnel_create, which manages the ephemeral in-memory storage.
export function tunnelCreate( value: string, opts: TunnelOptions = {}, ): string { const id = `tun_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`; const now = Date.now(); tunnelStore.set(id, { value, createdAt: now, expiresAt: opts.ttlSeconds ? now + opts.ttlSeconds * 1000 : undefined, accessCount: 0, maxReads: opts.maxReads, }); ensureCleanup(); return id; }