Skip to main content
Glama
OpenZeppelin

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

solidity-erc721

Generate ERC-721 NFT contract source code with customizable features like minting, burning, pausing, and access control. Returns formatted Solidity code without writing to disk.

Instructions

Make a non-fungible token per the ERC-721 standard.

Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe name of the contract
symbolYesThe short symbol for the token
baseUriNoA base uri for the token
enumerableNoWhether to allow on-chain enumeration of all tokens or those owned by an account. Increases gas cost of transfers.
uriStorageNoAllows updating token URIs for individual token IDs
burnableNoWhether token holders will be able to destroy their tokens
pausableNoWhether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.
mintableNoWhether privileged accounts will be able to create more supply or emit more tokens
incrementalNoWhether new tokens will be automatically assigned an incremental id
votesNoWhether to keep track of individual units for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps (defaulting to block number if not specified).
accessNoThe type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts. Managed enables a central contract to define a policy that allows certain callers to access certain functions.
upgradeableNoWhether the smart contract is upgradeable. Transparent uses more complex proxy with higher overhead, requires less changes in your contract. Can also be used with beacons. UUPS uses simpler proxy with less overhead, requires including extra code in your contract. Allows flexibility for authorizing upgrades.
infoNoMetadata about the contract and author
namespacePrefixNoThe prefix for ERC-7201 namespace identifiers. It should be derived from the project name or a unique naming convention specific to the project. Used only if the contract includes storage variables and upgradeability is enabled. Default is "myProject".

Implementation Reference

  • Registration of the solidity-erc721 tool, including the name, prompt, schema reference, and inline handler function that generates the ERC721 contract code.
    export function registerSolidityERC721(server: McpServer): RegisteredTool { return server.tool( 'solidity-erc721', makeDetailedPrompt(solidityPrompts.ERC721), erc721Schema, async ({ name, symbol, baseUri, enumerable, uriStorage, burnable, pausable, mintable, incremental, votes, access, upgradeable, namespacePrefix, info, }) => { const opts: ERC721Options = { name, symbol, baseUri, enumerable, uriStorage, burnable, pausable, mintable, incremental, votes, access, upgradeable, namespacePrefix, info, }; return { content: [ { type: 'text', text: safePrintSolidityCodeBlock(() => erc721.print(opts)), }, ], }; }, ); }
  • The handler function that constructs ERC721Options from input parameters and uses OpenZeppelin Wizard's erc721.print(opts) to generate the Solidity contract source code, wrapped safely and returned as text content.
    async ({ name, symbol, baseUri, enumerable, uriStorage, burnable, pausable, mintable, incremental, votes, access, upgradeable, namespacePrefix, info, }) => { const opts: ERC721Options = { name, symbol, baseUri, enumerable, uriStorage, burnable, pausable, mintable, incremental, votes, access, upgradeable, namespacePrefix, info, }; return { content: [ { type: 'text', text: safePrintSolidityCodeBlock(() => erc721.print(opts)), }, ], }; },
  • Zod schema defining the input parameters for the solidity-erc721 tool, including name, symbol, various ERC721-specific options, common options, and namespacePrefix.
    export const erc721Schema = { name: z.string().describe(commonDescriptions.name), symbol: z.string().describe(commonDescriptions.symbol), baseUri: z.string().optional().describe(solidityERC721Descriptions.baseUri), enumerable: z.boolean().optional().describe(solidityERC721Descriptions.enumerable), uriStorage: z.boolean().optional().describe(solidityERC721Descriptions.uriStorage), burnable: z.boolean().optional().describe(commonDescriptions.burnable), pausable: z.boolean().optional().describe(commonDescriptions.pausable), mintable: z.boolean().optional().describe(commonDescriptions.mintable), incremental: z.boolean().optional().describe(solidityERC721Descriptions.incremental), votes: z.literal('blocknumber').or(z.literal('timestamp')).optional().describe(solidityERC721Descriptions.votes), ...commonSchema, namespacePrefix: z.string().optional().describe(solidityCommonDescriptions.namespacePrefix), } as const satisfies z.ZodRawShape;
  • Intermediate registration mapping where registerSolidityERC721 is included in the list of Solidity tools to be registered.
    function getRegisterFunctions(server: McpServer): SolidityToolRegisterFunctions { return { ERC20: () => registerSolidityERC20(server), ERC721: () => registerSolidityERC721(server), ERC1155: () => registerSolidityERC1155(server), Stablecoin: () => registerSolidityStablecoin(server), RealWorldAsset: () => registerSolidityRWA(server), Account: () => registerSolidityAccount(server), Governor: () => registerSolidityGovernor(server), Custom: () => registerSolidityCustom(server), }; }
  • Top-level call to register all Solidity tools, including solidity-erc721 via the chain.
    registerSolidityTools(server);

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/OpenZeppelin/contracts-wizard'

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