Skip to main content
Glama

MCPilot

by Xiawpohr
deploy.ts1.22 kB
import { FastMCP } from "fastmcp"; import { encodeAbiParameters } from "viem"; import { z } from "zod"; import erc20Abi from "../erc20-abi.js"; export function registerDeployTools(server: FastMCP): void { server.addTool({ name: "prepare-deploy-erc20-contract", description: "Prepare for deploy a new ERC20 token", parameters: z.object({ bytecode: z.string().startsWith("0x"), name: z.string(), symbol: z.string(), decimal: z.coerce.number(), }), execute: async (args) => { const bytecode = args.bytecode; const name = args.name; const symbol = args.symbol; const decimal = args.decimal; const description = erc20Abi.find((x) => 'type' in x && x.type === 'constructor') const constructorArguments = description ? encodeAbiParameters(description.inputs, [name, symbol, decimal]) : "" return { content: [ { type: "text", text: JSON.stringify({ prepareForAction: "deploy-contract", abi: erc20Abi, args: [name, symbol, decimal], bytecode, constructorArguments, }) } ] } }, }); };

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/Xiawpohr/mcpilot'

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