Skip to main content
Glama
lordbasilaiassistant-sudo

base-gasless-deploy-mcp

deploy_gasless_token

Deploy ERC-20 tokens on Base network with zero gas fees for users via CDP Paymaster, requiring only token name, symbol, and owner address.

Instructions

Deploy an ERC-20 token on Base using CDP Paymaster (zero gas for user). Falls back to normal gas if no paymaster configured. Requires DEPLOYER_PRIVATE_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesToken name (e.g. 'My Token')
symbolYesToken symbol/ticker (e.g. 'MTK')
supplyNoTotal supply in human units (e.g. '1000000' for 1M tokens, 18 decimals)1000000
owner_addressYesAddress that receives all minted tokens and owns the token

Implementation Reference

  • The MCP tool 'deploy_gasless_token' is registered and implemented directly within src/index.ts. It uses a Zod schema for input validation, constructs a transaction using ethers.js, and delegates the final transmission to a helper 'sendTransaction' which handles the paymaster logic.
    server.tool(
      "deploy_gasless_token",
      "Deploy an ERC-20 token on Base using CDP Paymaster (zero gas for user). Falls back to normal gas if no paymaster configured. Requires DEPLOYER_PRIVATE_KEY.",
      {
        name: z.string().describe("Token name (e.g. 'My Token')"),
        symbol: z.string().describe("Token symbol/ticker (e.g. 'MTK')"),
        supply: z.string().default("1000000").describe("Total supply in human units (e.g. '1000000' for 1M tokens, 18 decimals)"),
        owner_address: z.string().describe("Address that receives all minted tokens and owns the token"),
      },
      async ({ name, symbol, supply, owner_address }) => {
        try {
          const signer = getSigner();
          const supplyWei = ethers.parseUnits(supply, 18);
    
          // Encode constructor args
          const factory = new ethers.ContractFactory(TOKEN_ABI, TOKEN_BYTECODE, signer);
          const deployTx = await factory.getDeployTransaction(name, symbol, supplyWei, owner_address);
    
          // Get gas estimate for savings calculation
          const provider = getProvider();
          const gasEstimate = await provider.estimateGas({
            ...deployTx,
            from: await signer.getAddress(),
          });
          const feeData = await provider.getFeeData();
          const gasPrice = feeData.gasPrice || 0n;
          const estimatedCostWei = gasEstimate * gasPrice;
    
          // Send through paymaster or normal
          const { receipt, usedPaymaster } = await sendTransaction(signer, deployTx);
    
          // Extract deployed contract address
          const tokenAddress = receipt.contractAddress;
          if (!tokenAddress) {
            return mcpError("Deploy succeeded but contract address not found in receipt");
          }
    
          const actualGasCostWei = receipt.gasUsed * receipt.gasPrice;
    
          // Track deployment
          const record: DeployRecord = {
            tokenAddress,
            deployer: await signer.getAddress(),
            owner: owner_address,
            name,
            symbol,
            totalSupply: supply,
            txHash: receipt.hash,
            blockNumber: receipt.blockNumber,
            gasUsed: receipt.gasUsed.toString(),
            gasPrice: receipt.gasPrice.toString(),
            gasCostWei: actualGasCostWei.toString(),
            usedPaymaster,
            timestamp: Math.floor(Date.now() / 1000),
          };
          deployments.push(record);
    
          return mcpResult({
            success: true,
            token_address: tokenAddress,
            name,
            symbol,
            total_supply: supply,
            decimals: 18,
            owner: owner_address,
            gasless: usedPaymaster,
            gas_used: receipt.gasUsed.toString(),
            gas_cost_eth: usedPaymaster ? "0 (sponsored)" : ethers.formatEther(actualGasCostWei),
            estimated_cost_eth: ethers.formatEther(estimatedCostWei),
            gas_saved_eth: usedPaymaster ? ethers.formatEther(estimatedCostWei) : "0",
            tx_hash: receipt.hash,
            block_number: receipt.blockNumber,
            explorer: `https://basescan.org/token/${tokenAddress}`,
            paymaster_status: usedPaymaster ? "sponsored" : (isPaymasterEnabled() ? "failed_fallback" : "not_configured"),
          });
        } catch (err: unknown) {
Behavior4/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 effectively describes key traits: the gasless mechanism with paymaster, fallback behavior, and a critical requirement ('Requires DEPLOYER_PRIVATE_KEY'). It lacks details on error handling, rate limits, or response format, but covers essential operational aspects.

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 front-loaded with the core purpose in the first phrase, followed by key behavioral details and requirements in just two sentences. Every sentence adds critical information without waste, making it highly efficient and easy to parse.

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

Completeness4/5

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

Given the complexity of a deployment tool with no annotations or output schema, the description provides good coverage of purpose, behavior, and requirements. It could improve by detailing the return value or error cases, but it adequately informs the agent for basic usage in context with the schema.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all parameters. The description does not add specific meaning beyond the schema, such as explaining interactions between parameters or usage nuances. The baseline score of 3 reflects adequate but no extra value from the description.

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 states the specific action ('Deploy an ERC-20 token'), target platform ('on Base'), and mechanism ('using CDP Paymaster (zero gas for user)'). It distinguishes from sibling tools like 'list_deployed_tokens' or 'get_token_info' by focusing on deployment rather than querying or transferring.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool ('Deploy an ERC-20 token on Base using CDP Paymaster') and mentions a fallback scenario ('Falls back to normal gas if no paymaster configured'). However, it does not explicitly contrast with alternatives or specify when not to use it, such as compared to other deployment methods or sibling tools.

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/lordbasilaiassistant-sudo/base-gasless-deploy-mcp'

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