Skip to main content
Glama
Frontier-Compute

Frontier-Compute/zcash-mcp

zcash_crosschain_swap

Initiate cross-chain swaps between Zcash transparent, Bitcoin, and EVM assets. Choose custody via Ika, NEAR Chain Signatures, or direct wallet. Only transparent ZEC works with external MPC custody.

Instructions

Cross-chain swap intent for Zcash transparent, Bitcoin, or EVM assets. Custody via Ika (split-key on Sui), NEAR Chain Signatures, or direct wallet. Zcash shielded (Orchard) requires RedPallas - not available via Ika or NEAR. Only transparent ZEC works through external MPC custody.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_chainYesSource chain (transparent ZEC, BTC, or ETH)
dest_chainYesDestination chain or asset
amountYesAmount in source denomination
recipientYesRecipient address on destination chain
custodyNoCustody provider (default: direct)

Implementation Reference

  • Registration of the 'zcash_crosschain_swap' tool via McpServer.tool(), called from src/index.ts line 47.
    export function registerCrosschainTool(server: McpServer) {
      server.tool(
        "zcash_crosschain_swap",
        "Cross-chain swap intent for Zcash transparent, Bitcoin, or EVM assets. " +
          "Custody via Ika (split-key on Sui), NEAR Chain Signatures, or direct wallet. " +
          "Zcash shielded (Orchard) requires RedPallas - not available via Ika or NEAR. " +
          "Only transparent ZEC works through external MPC custody.",
        {
          source_chain: z
            .enum(["zcash-transparent", "bitcoin", "ethereum"])
            .describe("Source chain (transparent ZEC, BTC, or ETH)"),
          dest_chain: z
            .enum(["zcash-transparent", "bitcoin", "ethereum", "usdc", "usdt"])
            .describe("Destination chain or asset"),
          amount: z.string().describe("Amount in source denomination"),
          recipient: z.string().describe("Recipient address on destination chain"),
          custody: z
            .enum(["ika", "near", "direct"])
            .optional()
            .describe("Custody provider (default: direct)"),
        },
        async ({ source_chain, dest_chain, amount, recipient, custody }) => {
          const provider = custody ?? "direct";
    
          const signingParams: Record<string, { curve: string; algorithm: string; hash: string }> = {
            "zcash-transparent": { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" },
            bitcoin: { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" },
            ethereum: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" },
            usdc: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" },
            usdt: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" },
          };
    
          const custodyInfo: Record<string, { name: string; security: string; pkg: string | null }> = {
            ika: {
              name: "Ika 2PC-MPC on Sui",
              security: "Split-key: agent holds half, network holds half. Neither signs alone.",
              pkg: "@frontiercompute/zcash-ika",
            },
            near: {
              name: "NEAR Chain Signatures (v1.signer)",
              security: "Threshold Cait-Sith MPC across NEAR nodes. secp256k1 only.",
              pkg: "@frontiercompute/zap1-near",
            },
            direct: {
              name: "Local Zebra wallet",
              security: "Full key on machine. Use ika or near for split-key custody.",
              pkg: null,
            },
          };
    
          const result = {
            intent: { from: source_chain, to: dest_chain, amount, recipient },
            signing: {
              source: signingParams[source_chain],
              destination: signingParams[dest_chain],
            },
            custody: custodyInfo[provider],
            attestation: {
              protocol: "ZAP1",
              event_type: "AGENT_ACTION",
              api: "https://pay.frontiercompute.io/attest",
            },
            limitations: {
              shielded: "Zcash Orchard requires RedPallas on Pallas curve. Not available via Ika or NEAR MPC. Use direct wallet for shielded.",
            },
            status: "Intent recorded. Execution requires active custody + solver.",
          };
    
          return {
            content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
          };
        }
      );
    }
  • Handler function that processes the cross-chain swap intent by building signing parameters, custody info, and attestation metadata.
    async ({ source_chain, dest_chain, amount, recipient, custody }) => {
      const provider = custody ?? "direct";
    
      const signingParams: Record<string, { curve: string; algorithm: string; hash: string }> = {
        "zcash-transparent": { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" },
        bitcoin: { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" },
        ethereum: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" },
        usdc: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" },
        usdt: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" },
      };
    
      const custodyInfo: Record<string, { name: string; security: string; pkg: string | null }> = {
        ika: {
          name: "Ika 2PC-MPC on Sui",
          security: "Split-key: agent holds half, network holds half. Neither signs alone.",
          pkg: "@frontiercompute/zcash-ika",
        },
        near: {
          name: "NEAR Chain Signatures (v1.signer)",
          security: "Threshold Cait-Sith MPC across NEAR nodes. secp256k1 only.",
          pkg: "@frontiercompute/zap1-near",
        },
        direct: {
          name: "Local Zebra wallet",
          security: "Full key on machine. Use ika or near for split-key custody.",
          pkg: null,
        },
      };
    
      const result = {
        intent: { from: source_chain, to: dest_chain, amount, recipient },
        signing: {
          source: signingParams[source_chain],
          destination: signingParams[dest_chain],
        },
        custody: custodyInfo[provider],
        attestation: {
          protocol: "ZAP1",
          event_type: "AGENT_ACTION",
          api: "https://pay.frontiercompute.io/attest",
        },
        limitations: {
          shielded: "Zcash Orchard requires RedPallas on Pallas curve. Not available via Ika or NEAR MPC. Use direct wallet for shielded.",
        },
        status: "Intent recorded. Execution requires active custody + solver.",
      };
    
      return {
        content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
      };
    }
  • Zod schema defining input parameters: source_chain, dest_chain, amount, recipient, and optional custody provider.
    {
      source_chain: z
        .enum(["zcash-transparent", "bitcoin", "ethereum"])
        .describe("Source chain (transparent ZEC, BTC, or ETH)"),
      dest_chain: z
        .enum(["zcash-transparent", "bitcoin", "ethereum", "usdc", "usdt"])
        .describe("Destination chain or asset"),
      amount: z.string().describe("Amount in source denomination"),
      recipient: z.string().describe("Recipient address on destination chain"),
      custody: z
        .enum(["ika", "near", "direct"])
        .optional()
        .describe("Custody provider (default: direct)"),
  • Helper lookup table mapping each chain/asset to its cryptographic curve, signing algorithm, and hash function.
    const signingParams: Record<string, { curve: string; algorithm: string; hash: string }> = {
      "zcash-transparent": { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" },
      bitcoin: { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" },
      ethereum: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" },
      usdc: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" },
      usdt: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" },
    };
  • Helper lookup table mapping custody providers (ika, near, direct) to their name, security description, and optional package.
    const custodyInfo: Record<string, { name: string; security: string; pkg: string | null }> = {
      ika: {
        name: "Ika 2PC-MPC on Sui",
        security: "Split-key: agent holds half, network holds half. Neither signs alone.",
        pkg: "@frontiercompute/zcash-ika",
      },
      near: {
        name: "NEAR Chain Signatures (v1.signer)",
        security: "Threshold Cait-Sith MPC across NEAR nodes. secp256k1 only.",
        pkg: "@frontiercompute/zap1-near",
      },
      direct: {
        name: "Local Zebra wallet",
        security: "Full key on machine. Use ika or near for split-key custody.",
        pkg: null,
      },
    };
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It reveals custody constraints and incompatibility with shielded ZEC via Ika/NEAR, but omits important traits such as whether the operation is destructive, requires authentication, is asynchronous, or has rate limits. The description adds some value but is insufficient for full transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise at three sentences, with no redundant information. The first sentence states the core purpose, followed by custody details and a critical limitation. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite the tool's complexity (cross-chain swap) and lack of output schema, the description does not specify what the tool returns (e.g., an intent ID, status, or error). It also omits details about fees, transaction timing, and potential failure modes. The description covers some constraints but leaves significant gaps for a non-trivial operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents all parameters. The description adds meaning by clarifying custody options in relation to source chains (e.g., 'Only transparent ZEC works through external MPC custody'), which helps agents understand valid combinations beyond the enum lists.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as creating a cross-chain swap intent involving Zcash transparent, Bitcoin, or EVM assets. It specifies the resource (swap) and verb (intent) and distinguishes itself from sibling tools like zcash_shield and send_shielded by focusing strictly on cross-chain operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies that this tool is for initiating cross-chain swaps and indicates limitations (e.g., shielded ZEC not via Ika or NEAR). However, it does not explicitly state when to use this tool vs. alternatives like send_shielded or zcash_create_invoice, nor does it provide scenarios where it should not be used.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Frontier-Compute/zcash-mcp'

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