tunnel_read
Retrieve a temporary tunneled secret by ID for secure access, with automatic deletion after reaching maximum read limits.
Instructions
Read an ephemeral tunneled secret by ID. May self-destruct if max-reads is reached.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Tunnel ID |
Implementation Reference
- src/core/tunnel.ts:76-94 (handler)The core implementation of the tunnelRead function which retrieves an ephemeral secret by its ID, handles expiration, increments access counters, and enforces auto-destruction logic.
export function tunnelRead(id: string): string | null { const entry = tunnelStore.get(id); if (!entry) return null; if (entry.expiresAt && Date.now() >= entry.expiresAt) { tunnelStore.delete(id); return null; } entry.accessCount++; if (entry.maxReads && entry.accessCount >= entry.maxReads) { const value = entry.value; tunnelStore.delete(id); return value; } return entry.value; } - src/mcp/server.ts:376-388 (registration)Registration of the "tunnel_read" tool in the MCP server, providing the schema and binding it to the tunnelRead handler.
"tunnel_read", "Read an ephemeral tunneled secret by ID. May self-destruct if max-reads is reached.", { id: z.string().describe("Tunnel ID"), }, async (params) => { const value = tunnelRead(params.id); if (value === null) { return text(`Tunnel "${params.id}" not found or expired`, true); } return text(value); }, );