Sui NFT Minting Guide for MCP
Overview
This document describes the complete process of minting NFTs on the Sui blockchain using MCP (Model Context Protocol) tools. The process involves several steps that must be executed in a specific order to successfully create and mint NFTs.
📋 Prerequisites: Before using these tools, make sure you have set up MCP integration with your API key.
Process Flow
Detailed Process Steps
1. Publish Collection
Tool: publish-collection
Description: Publish a collection. As a result of executing this command, you will receive a transaction that needs to be signed and sent to the blockchain.
Input:
{
"walletAddress": "0x...",
"name": "Collection Name",
"symbol": "SYMBOL",
"description": "Collection Description",
"image_url": "https://...",
"feeNumerator": 2,
"mintPrice": 2,
"whitelistMintPrice": 1,
"transferable": true,
"maxTotalSupply": 9999,
"collectionExpire": 1785508320,
"isSui": false
}
Output:
{
"transactionBytes": "base64_encoded_transaction",
"name": "Collection Name",
"symbol": "SYMBOL",
"collectionCap": "0x..."
}
2. Create Collection
Tool: create-collection
Description: Creating a collection. As a result of executing this command, you will receive a transaction that needs to be signed and sent to the blockchain.
Input:
{
"signature": {
"signature": "0x...",
"bytes": "0x..."
},
"walletAddress": "0x...",
"name": "Collection Name",
"symbol": "SYMBOL",
"collectionCap": "0x..."
}
Output:
{
"transactionBytes": "base64_encoded_transaction"
}
3. Save Collection
Tool: save-collection
Description: Save a collection to the database after it has been created on the blockchain.
Input:
{
"signature": {
"signature": "0x...",
"bytes": "0x..."
},
"name": "Collection Name",
"symbol": "SYMBOL"
}
Output:
{
"collectionAddress": "0x...",
"produce_data": {
"name": "Collection Name",
"symbol": "SYMBOL",
"creator": "0x...",
"feeReceiver": "0x..."
}
}
4. Kiosk Management
4a. Get Existing Kiosk
Tool: get-kiosk
Description: Get an existing kiosk for a collection.
Input:
{
"collection": "0x...",
"owner": "0x..."
}
Output:
{
"kioskId": "0x...",
"kioskCap": "0x...",
"collection": "0x...",
"owner": "0x..."
}
4b. Create New Kiosk
Step 1: Sign KioskTool: sign-kiosk
Description: Receive data for the kiosk creation transaction. As a result of executing this command, you will receive a transaction that needs to be signed and sent to the blockchain.
Input:
{
"walletAddress": "0x..."
}
Output:
{
"transactionBytes": "base64_encoded_transaction"
}
Step 2: Create KioskTool: create-kiosk
Description: Create a kiosk for the collection. The kiosk data will be returned for further use in minting.
Input:
{
"signature": {
"signature": "0x...",
"bytes": "0x..."
},
"owner": "0x...",
"collection": "0x..."
}
Output:
{
"kioskId": "0x...",
"kioskCap": "0x...",
"collection": "0x...",
"owner": "0x..."
}
5. Sponsor Management (Optional)
5a. Skip Sponsor
If you don't want to sponsor gas payments, you can proceed directly to minting.
5b. Create Sponsor
Tool: create-sponsored-collection
Description: Create a gas payment sponsor for the collection. You will need to pass the collection address and your wallet address.
Input:
{
"collectionAddress": "0x...",
"walletAddress": "0x..."
}
Output:
{
"sponsorAddress": "0x...",
"ownerAddress": "0x...",
"collectionAddress": "0x..."
}
5c. Fund Sponsor Account
Important: After creating a sponsor, you must fund the sponsor account with SUI tokens to cover gas fees for minting operations.
6. Mint NFT
6a. Sign Mint Transaction
Tool: mint-sign
Description: Get the data to sign a mint transaction. To do this, you need to create a kiosk or use data from an existing kiosk. Also, if you want to sponsor gas payments, you should create a sponsor. As a result of executing this command, you will receive a transaction that needs to be signed and sent to the blockchain.
Input:
{
"collectionName": "Collection Name",
"collectionSymbol": "SYMBOL",
"mintCapProps": {
"name": "NFT Name",
"description": "NFT Description",
"metadataLink": "https://...",
"imageUrl": "https://...",
"whitelisted": true,
"uses": 1,
"capReceiver": "0x..."
},
"senderAddress": "0x...",
"kioskId": "0x...",
"kioskCap": "0x..."
}
Output:
{
"transactionBytes": "base64_encoded_transaction",
"sponsorSignature": {
"signature": "0x...",
"bytes": "0x..."
}
}
6b. Execute Mint
Tool: mint
Description: Mint a token using the provided signatures. If you want to sponsor gas payments, you should create a sponsor first. The minted token data will be returned.
Input:
{
"senderSignature": {
"signature": "0x...",
"bytes": "0x..."
},
"sponsorSignature": {
"signature": "0x...",
"bytes": "0x..."
}
}
Output:
{
"id": { "id": "0x..." },
"name": "NFT Name",
"description": "NFT Description",
"metadataLink": "https://...",
"image_url": "https://...",
"block_number": 12345,
"hash": "0x..."
}
Error Handling
Common Errors
- Invalid Address: Ensure all Sui addresses are valid and properly formatted
- Insufficient Balance: Make sure the wallet has enough SUI for gas fees
- Sponsor Not Funded: If using a sponsor, ensure the sponsor account is funded
- Collection Already Exists: Check if the collection name/symbol combination is unique
- Kiosk Not Found: Verify the kiosk exists for the collection/owner combination
Error Response Format
MCP tools return errors in the standard MCP error format when operations fail.
Best Practices
- Always verify addresses before submitting transactions
- Test on testnet before deploying to mainnet
- Keep track of transaction hashes for debugging
- Monitor gas fees and ensure sufficient balance
- Use sponsors for better UX when possible
- Validate metadata URLs before minting
Usage Examples
// 1. Publish collection using MCP tool
const publishResult = await mcp.callTool("publish-collection", {
data: {
walletAddress: "0x...",
name: "Collection Name",
symbol: "SYMBOL",
description: "Collection Description",
image_url: "https://...",
feeNumerator: 2,
mintPrice: 2,
whitelistMintPrice: 1,
transferable: true,
maxTotalSupply: 9999,
collectionExpire: 1785508320,
isSui: false,
},
});
const { transactionBytes, name, symbol, collectionCap } =
publishResult.content[0].text;
// Sign transaction with wallet
const signature = await walletInstance.signTransaction(transactionBytes);
// 2. Create collection
const createResult = await mcp.callTool("create-collection", {
data: {
signature,
walletAddress: "0x...",
name,
symbol,
collectionCap,
},
});
// 3. Save collection
const saveResult = await mcp.callTool("save-collection", {
data: {
signature: createSignature,
name,
symbol,
},
});
const { collectionAddress } = saveResult.content[0].text;
// 4. Get or create kiosk
let kioskData;
try {
const kioskResult = await mcp.callTool("get-kiosk", {
data: {
collection: collectionAddress,
owner: walletAddress,
},
});
kioskData = kioskResult.content[0].text;
} catch (error) {
// Create new kiosk
const signKioskResult = await mcp.callTool("sign-kiosk", {
data: { walletAddress },
});
const kioskSignature = await walletInstance.signTransaction(
signKioskResult.content[0].text.transactionBytes
);
const createKioskResult = await mcp.callTool("create-kiosk", {
data: {
signature: kioskSignature,
owner: walletAddress,
collection: collectionAddress,
},
});
kioskData = createKioskResult.content[0].text;
}
// 5. Optional: Create sponsor
const sponsorResult = await mcp.callTool("create-sponsored-collection", {
data: {
collectionAddress,
walletAddress,
},
});
// 6. Mint NFT
const mintSignResult = await mcp.callTool("mint-sign", {
data: {
collectionName: name,
collectionSymbol: symbol,
mintCapProps: {
name: "NFT Name",
description: "NFT Description",
metadataLink: "https://...",
imageUrl: "https://...",
whitelisted: true,
uses: 1,
capReceiver: walletAddress,
},
senderAddress: walletAddress,
kioskId: kioskData.kioskId,
kioskCap: kioskData.kioskCap,
},
});
const senderSignature = await walletInstance.signTransaction(
mintSignResult.content[0].text.transactionBytes
);
const mintResult = await mcp.callTool("mint", {
data: {
senderSignature,
sponsorSignature: mintSignResult.content[0].text.sponsorSignature,
},
});
console.log("NFT minted:", mintResult.content[0].text);