stellar-non-fungible
Generate custom non-fungible token contracts compliant with SEP-50 standards using OpenZeppelin libraries. Configure features like burnability, enumerability, minting, and access control. Returns source code in Markdown format without writing to disk.
Instructions
Make a non-fungible token per the Non-Fungible Token Standard, compatible with SEP-50, similar to ERC-721.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| access | No | The 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. | |
| burnable | No | Whether token holders will be able to destroy their tokens | |
| consecutive | No | To batch mint NFTs instead of minting them individually (sequential minting is mandatory). | |
| enumerable | No | Whether the NFTs are enumerable (can be iterated over). | |
| info | No | Metadata about the contract and author | |
| mintable | No | Whether privileged accounts will be able to create more supply or emit more tokens | |
| name | Yes | The name of the contract | |
| pausable | No | Whether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response. | |
| sequential | No | Whether the IDs of the minted NFTs will be sequential. | |
| symbol | Yes | The short symbol for the token | |
| upgradeable | No | Whether the contract can be upgraded. |
Implementation Reference
- The async handler function that implements the core logic of the 'stellar-non-fungible' tool: it destructures input parameters, constructs NonFungibleOptions, generates Rust code using nonFungible.print(opts) wrapped in safePrintRustCodeBlock, and returns it as text content.async ({ name, symbol, tokenUri, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info, }) => { const opts: NonFungibleOptions = { name, symbol, tokenUri, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => nonFungible.print(opts)), }, ], }; },
- Zod schema defining the input shape for the 'stellar-non-fungible' tool, including required name/symbol and optional flags like burnable, mintable, etc.export const nonFungibleSchema = { name: z.string().describe(commonDescriptions.name), symbol: z.string().describe(commonDescriptions.symbol), tokenUri: z.string().optional().describe(stellarNonFungibleDescriptions.tokenUri), burnable: z.boolean().optional().describe(commonDescriptions.burnable), enumerable: z.boolean().optional().describe(stellarNonFungibleDescriptions.enumerable), consecutive: z.boolean().optional().describe(stellarNonFungibleDescriptions.consecutive), pausable: z.boolean().optional().describe(commonDescriptions.pausable), mintable: z.boolean().optional().describe(commonDescriptions.mintable), sequential: z.boolean().optional().describe(stellarNonFungibleDescriptions.sequential), ...commonSchema, } as const satisfies z.ZodRawShape;
- packages/mcp/src/stellar/tools/non-fungible.ts:8-49 (registration)Direct registration of the 'stellar-non-fungible' tool using server.tool(), including name, detailed prompt, schema reference, and inline handler. This function is called from higher-level aggregators.export function registerStellarNonFungible(server: McpServer): RegisteredTool { return server.tool( 'stellar-non-fungible', makeDetailedPrompt(stellarPrompts.NonFungible), nonFungibleSchema, async ({ name, symbol, tokenUri, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info, }) => { const opts: NonFungibleOptions = { name, symbol, tokenUri, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => nonFungible.print(opts)), }, ], }; }, ); }
- packages/mcp/src/stellar/tools.ts:20-24 (registration)Aggregator function that registers all Stellar tools (including non-fungible via registerStellarNonFungible) by dynamically calling their register functions.export function registerStellarTools(server: McpServer) { Object.values(getRegisterFunctions(server)).forEach(registerTool => { registerTool(server); }); }
- packages/mcp/src/server.ts:9-32 (registration)Top-level server creation where registerStellarTools(server) is called at line 27, indirectly registering the 'stellar-non-fungible' tool among others.export function createServer() { const server = new McpServer( { name: 'OpenZeppelin Contracts Wizard', version, }, { instructions: `\ Tools are provided for different smart contract languages and frameworks: Solidity, Starknet's Cairo, Stellar Soroban, Arbitrum Stylus, and Uniswap v4 Hooks. Each tool generates a smart contract using recommended best practices with OpenZeppelin Contracts libraries, and returns the source code. The tools do not write to disk. If the user requests to create a new smart contract, use the appropriate tool to generate the contract. If the user asks to modify an existing smart contract, use these tools to determine the recommended patterns. Toggle the options in a tool to determine how different features affect the code, then apply the same types of changes to the user's contract. `, }, ); registerSolidityTools(server); registerCairoTools(server); registerStellarTools(server); registerStylusTools(server); registerUniswapHooksTools(server); return server; }