Skip to main content
Glama

teleport_pack

Pack secrets into AES-256-GCM encrypted bundles for secure sharing between machines using quantum teleportation mechanics.

Instructions

Pack secrets into an AES-256-GCM encrypted bundle for sharing between machines (quantum teleportation).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keysNoSpecific keys to pack (all if omitted)
passphraseYesEncryption passphrase
scopeNoScope: global or project
projectPathNoProject root path for project-scoped secrets

Implementation Reference

  • Core implementation of the teleportPack function which encrypts secret payloads.
    export function teleportPack(
      secrets: { key: string; value: string; scope?: string }[],
      passphrase: string,
    ): string {
      const payload: TeleportPayload = {
        secrets,
        exportedAt: new Date().toISOString(),
      };
    
      const plaintext = JSON.stringify(payload);
      const salt = randomBytes(SALT_LENGTH);
      const iv = randomBytes(IV_LENGTH);
      const key = deriveKey(passphrase, salt);
    
      const cipher = createCipheriv(ALGORITHM, key, iv);
      const encrypted = Buffer.concat([
        cipher.update(plaintext, "utf8"),
        cipher.final(),
      ]);
      const tag = cipher.getAuthTag();
    
      const bundle: TeleportBundle = {
        v: 1,
        data: encrypted.toString("base64"),
        salt: salt.toString("base64"),
        iv: iv.toString("base64"),
        tag: tag.toString("base64"),
        createdAt: new Date().toISOString(),
        count: secrets.length,
      };
    
      return Buffer.from(JSON.stringify(bundle)).toString("base64");
    }
  • MCP tool registration for "teleport_pack".
    server.tool(
      "teleport_pack",
      "Pack secrets into an AES-256-GCM encrypted bundle for sharing between machines (quantum teleportation).",
      {
        keys: z
          .array(z.string())
          .optional()
          .describe("Specific keys to pack (all if omitted)"),
        passphrase: z.string().describe("Encryption passphrase"),
        scope: scopeSchema,
        projectPath: projectPathSchema,
      },
      async (params) => {
        const o = opts(params);
        const entries = listSecrets(o);
    
        const secrets: { key: string; value: string; scope?: string }[] = [];
        for (const entry of entries) {
          if (params.keys && !params.keys.includes(entry.key)) continue;
          const value = getSecret(entry.key, { ...o, scope: entry.scope });
          if (value !== null) {
            secrets.push({ key: entry.key, value, scope: entry.scope });
          }
        }
    
        if (secrets.length === 0) return text("No secrets to pack", true);
    
        const bundle = teleportPack(secrets, params.passphrase);
        return text(bundle);
      },
    );
  • Schema definitions for the Teleport bundle and payload structures.
    export interface TeleportBundle {
      /** Format version */
      v: 1;
      /** Base64-encoded encrypted payload */
      data: string;
      /** Base64-encoded salt for key derivation */
      salt: string;
      /** Base64-encoded initialization vector */
      iv: string;
      /** Base64-encoded auth tag */
      tag: string;
      /** ISO timestamp of creation */
      createdAt: string;
      /** Number of secrets in the bundle */
      count: number;
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/I4cTime/quantum_ring'

If you have feedback or need assistance with the MCP directory API, please join our Discord server