Skip to main content
Glama

teleport_pack

Pack secrets into an AES-256-GCM encrypted bundle 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

  • MCP tool registration and request handler 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);
      },
    );
  • Core implementation of the teleportPack function.
    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");
    }
  • Input schema definition for the 'teleport_pack' tool.
    {
      keys: z
        .array(z.string())
        .optional()
        .describe("Specific keys to pack (all if omitted)"),
      passphrase: z.string().describe("Encryption passphrase"),
      scope: scopeSchema,
      projectPath: projectPathSchema,
    },

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