MCP Integration
Ashfields MCP Server
A Model Context Protocol↗ server that exposes Ashfields minting as tools for autonomous AI agents. Claude, GPT, and any MCP-compatible agent can mint Ashfields NFTs directly without any human UI.
The server handles the full approve → mint flow, waits for on-chain confirmations, and returns structured JSON with token IDs and transaction hashes.
Setup
bash
# 1 — clone & install git clone https://github.com/smoke711711/ashfields-mcp-server cd ashfields-mcp-server npm install # 2 — set env vars export WALLET_PRIVATE_KEY=0xYOUR_PRIVATE_KEY export ETH_RPC_URL=https://ethereum.publicnode.com # optional # 3 — run node index.js
Claude Desktop Config
Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/)
json
{
"mcpServers": {
"ashfields": {
"command": "node",
"args": ["/path/to/ashfields-mcp-server/index.js"],
"env": {
"WALLET_PRIVATE_KEY": "0x...",
"ETH_RPC_URL": "https://ethereum.publicnode.com"
}
}
}
}Available Tools
get_mint_infoargs: none
Returns current mint status: price, total minted, remaining supply, mintActive flag, and contract addresses.
returns: JSON with mintActive, totalMinted, remaining, pricePerToken, contracts
check_walletargs: none
Returns the configured wallet's $ASH balance, current allowance for Ashfields, ETH balance, and how many tokens it can mint.
returns: JSON with address, ashBalance, ashAllowance, ethBalance, canMintUpTo
approve_ashargs: quantity: number (1–5)
Approves quantity × 100,000 $ASH for the Ashfields contract. Waits for on-chain confirmation before returning.
returns: JSON with txHash, status, approved amount
mint_ashfieldargs: quantity: number (1–5)
Full mint flow: checks allowance, auto-approves if needed, then mints. Waits for confirmation. Returns token IDs and OpenSea links.
returns: JSON with tokenIds, ashBurned, mintTx, approvalTx, opensea links
trigger_distributeargs: none
Calls distribute() on RoyaltyDistributor. Permissionless — any wallet can call. Splits ETH: 1% creator · 1% $ASH team · 8% buyback+burn to 0xdead.
returns: JSON with txHash, status
Example Agent Prompt
“Check my wallet balance, verify I have enough $ASH to mint 2 Ashfields, then mint them and return the token IDs and OpenSea links.”
→ agent calls check_wallet → confirms balance → calls mint_ashfield(2) → returns token IDs
Security
—Private key is read from environment variable only — never passed as a tool argument
—Server runs locally via stdio — no network exposure
—Only the configured wallet can approve and mint — tools cannot target arbitrary wallets
—distribute() is permissionless by contract design — anyone can call it