# Agent Tools — MCP & llms.txt — Brain On BNB AI # What an AI agent sees when it asks this project a question. # # This is the complete agent-tools bundle as a single file, so it can be read in # one fetch. 4 files, 1269 lines. # Download as a zip: https://brainonbnb.com/code/agent-tools.zip # Everything else: https://brainonbnb.com/code/index.txt # # No secrets are present: they are supplied at runtime through the environment. # MIT licensed. ============================================================================== === FILE: dashboard/_worker.js ============================================================================== const TOKEN = '0x245c386dcfed896f5c346107596141e5edcbffff'; const DEAD = '0x000000000000000000000000000000000000dEaD'; const ZERO = '0x0000000000000000000000000000000000000000'; const RPC = 'https://bsc-dataseed.binance.org'; const NFT_CONTRACT = '0xd56226b3b8297a57f4361fca28aa43babdc9789d'; const NFT_GET_TIERS = '0xde170570'; const NFT_DEPLOY_BLOCK = 105703880; const NFT_BUYDROP_TOPIC = '0x799b2cd04630260020ee5b9f8e761cdf644383855739696bf8f1aadbc73dfd2a'; const LOGS_RPC = 'https://bsc-rpc.publicnode.com'; const LOGS_UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'; async function ethCall(data) { const res = await fetch(RPC, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'eth_call', params: [{ to: TOKEN, data }, 'latest'] }), }); const json = await res.json(); return BigInt(json.result); } async function getCirculating() { const totalSupply = await ethCall('0x18160ddd'); const deadBal = await ethCall('0x70a08231000000000000000000000000' + DEAD.slice(2)); const zeroBal = await ethCall('0x70a08231000000000000000000000000' + ZERO.slice(2)); return (totalSupply - deadBal - zeroBal) / BigInt(1e18); } async function rpcJson(url, body, headers = {}) { const r = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', ...headers }, body: JSON.stringify(body), }); return r.json(); } async function getNftState() { // 1) Tier counts/caps via on-chain eth_call (cheap, no archive issue) const [tiersResp, blockResp, dropsResp, holdersResp, cellsResp] = await Promise.all([ rpcJson(RPC, { jsonrpc: '2.0', id: 1, method: 'eth_call', params: [{ to: NFT_CONTRACT, data: NFT_GET_TIERS }, 'latest'], }), rpcJson(RPC, { jsonrpc: '2.0', id: 2, method: 'eth_blockNumber', params: [] }), // 2) Drop ledger from mint-worker's KV (avoids publicnode archive limits + saves keyed-RPC quota) fetch('https://bobai-nft-mint.bobbuildonbnb.workers.dev/drops').then(r => r.ok ? r.json() : { drops: [] }).catch(() => ({ drops: [] })), // 3) Live holder count from mint-worker (scans Transfer events, picks up secondary transfers like donations) fetch('https://bobai-nft-mint.bobbuildonbnb.workers.dev/holders').then(r => r.ok ? r.json() : null).catch(() => null), // 4) Per-cell (tier × rarity) minted counts — chain-truth, for the drop matrix fetch('https://bobai-nft-mint.bobbuildonbnb.workers.dev/cells').then(r => r.ok ? r.json() : null).catch(() => null), ]); const minted = [0, 0, 0, 0, 0, 0]; const cap = [0, 0, 0, 0, 0, 0]; const r = tiersResp?.result; if (r && r.length >= 2 + 12 * 64) { const hex = r.slice(2); for (let i = 0; i < 6; i++) minted[i] = parseInt(hex.slice(i*64, (i+1)*64), 16); for (let i = 0; i < 6; i++) cap[i] = parseInt(hex.slice((6+i)*64, (7+i)*64), 16); } const latest = parseInt(blockResp?.result || '0x0', 16); const rawDrops = Array.isArray(dropsResp?.drops) ? dropsResp.drops : []; // Normalize for the dashboard UI (which expects tokenId + tx fields). // usd + mintTx kept verbatim so the TG bot can render dollar amounts. const drops = rawDrops.map((d, i) => ({ to: d.to, // Prefer an explicit tokenId stored on the drop; fall back to positional // (newest = highest id = total minted - i) for legacy entries without one. // The explicit id makes the ledger robust to out-of-band mints (e.g. a // manual gift mint) that would otherwise shift every positional number. tokenId: Number.isInteger(d.tokenId) ? d.tokenId : (minted.reduce((a, b) => a + b, 0) - i), tier: d.tier, rarity: d.rarity, block: d.block, ts: d.ts || 0, // unix seconds at mint time tx: d.mintTx || d.buyTx, mintTx: d.mintTx, buyTx: d.buyTx, usd: d.usd, note: d.note, // optional provenance badge (e.g. gift/re-roll), rendered in the ledger })); const buyers = new Set(drops.map(d => d.to)); // `holders` = live on-chain owner count (reflects transfers like the BscScan donation). // `buyers` kept for backwards-compat = unique original mint recipients. const holders = (holdersResp && typeof holdersResp.holders === 'number') ? holdersResp.holders : buyers.size; const cells = (cellsResp && Array.isArray(cellsResp.cells)) ? cellsResp.cells : null; return { minted, cap, drops, holders, buyers: buyers.size, latestBlock: latest, cells }; } // ─── BOBAI agent surface (MCP + A2A) — additive, read-only on-chain ─── const OFFICIAL_LINKS = { website: 'https://brainonbnb.com/', token_address: TOKEN, contract: 'https://bscscan.com/token/' + TOKEN, chain: 'BNB Smart Chain (BSC)', twitter: 'https://x.com/BrainOnBNB', telegram: 'https://t.me/bobai_official', dexscreener: 'https://dexscreener.com/bsc/' + TOKEN, geckoterminal: 'https://www.geckoterminal.com/bsc/pools/0x6eadd4cb786898b34929444988380ed0cc6fd9a6', coingecko: 'https://www.coingecko.com/en/coins/brain-on-bnb-ai', source: 'https://bscscan.com/address/' + TOKEN + '#code', audit_log: 'https://logs.brainonbnb.com/logs/burns.json', llms_txt: 'https://brainonbnb.com/llms.txt', skill_md: 'https://brainonbnb.com/skill.md', }; // DEX execution facts for agents that want to actually swap $BOBAI. // $BOBAI is a fee-on-transfer token (3% tax) — a naive swap with default // slippage/router method WILL revert. These fields spell out what's needed. const PAIR = '0x6eadd4cb786898b34929444988380ed0cc6fd9a6'; // PancakeSwap V2 BOBAI/WBNB const ROUTER_V2 = '0x10ED43C718714eb63d5aA57B78B54704E256024E'; // PancakeSwap V2 router const WBNB = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'; const TRADE_INFO = { token_address: TOKEN, chain: 'BNB Smart Chain (BSC)', chain_id: 56, dex: 'PancakeSwap V2', router: ROUTER_V2, pair: PAIR, quote_token: 'WBNB', quote_token_address: WBNB, swap_path_buy: [WBNB, TOKEN], swap_path_sell: [TOKEN, WBNB], fee_on_transfer: true, tax_percent: 3, min_slippage_bps: 1500, buy_method: 'swapExactETHForTokensSupportingFeeOnTransferTokens', sell_method: 'swapExactTokensForETHSupportingFeeOnTransferTokens', note: '$BOBAI charges a 3% transfer tax. You MUST use the *SupportingFeeOnTransferTokens router methods and set slippage tolerance >= 15% (1500 bps), otherwise the swap reverts. Live reserves: call getReserves() on the pair. Not financial advice.', }; // Live price + liquidity — computed fully on-chain (pair reserves × Chainlink // BNB/USD), same math as the dashboard workers. No off-chain price API. const CHAINLINK_BNB_USD = '0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE'; // BSC mainnet feed, 8 decimals async function getReservesAndBnbUsd() { const [rHex, aHex] = await Promise.all([ ethCallRaw(PAIR, '0x0902f1ac'), // getReserves() → (r0, r1, ts) ethCallRaw(CHAINLINK_BNB_USD, '0x50d25bcd'), // latestAnswer() → int256, 8 decimals ]); const rBOBAI = BigInt('0x' + rHex.slice(2, 66)); // token0 = BOBAI (verified on-chain) const rWBNB = BigInt('0x' + rHex.slice(66, 130)); // token1 = WBNB const bnbUsd = Number(BigInt(aHex)) / 1e8; if (rBOBAI === 0n || rWBNB === 0n) throw new Error('zero reserves'); if (!(bnbUsd > 0)) throw new Error('bad BNB/USD from Chainlink'); return { rBOBAI, rWBNB, bnbUsd }; } async function getPrice() { const { rBOBAI, rWBNB, bnbUsd } = await getReservesAndBnbUsd(); const priceBnb = Number(rWBNB) / Number(rBOBAI); // both 18 decimals → ratio cancels const priceUsd = priceBnb * bnbUsd; if (!isFinite(priceUsd) || priceUsd < 1e-7 || priceUsd > 1e-2) throw new Error('price failed sanity bounds'); const circulating = await getCirculating(); return { symbol: 'BOBAI', price_usd: Number(priceUsd.toPrecision(6)), price_bnb: Number(priceBnb.toPrecision(6)), bnb_usd: Number(bnbUsd.toFixed(2)), market_cap_usd: Math.round(Number(circulating) * priceUsd), circulating_supply: circulating.toString(), source: 'on-chain: PancakeSwap V2 pair reserves × Chainlink BNB/USD feed — no off-chain price API', pair: PAIR, chainlink_feed: CHAINLINK_BNB_USD, note: 'Spot price from live reserves. Your execution price differs: 3% transfer tax + price impact (see bobai_liquidity). Not financial advice.', }; } async function getLiquidity() { const [{ rBOBAI, rWBNB, bnbUsd }, lpTotalHex, lpDeadHex, lpZeroHex] = await Promise.all([ getReservesAndBnbUsd(), ethCallRaw(PAIR, '0x18160ddd'), ethCallRaw(PAIR, '0x70a08231000000000000000000000000' + DEAD.slice(2)), ethCallRaw(PAIR, '0x70a08231000000000000000000000000' + ZERO.slice(2)), ]); const lpTotal = BigInt(lpTotalHex); const lpBurned = BigInt(lpDeadHex) + BigInt(lpZeroHex); const lpBurnedPct = lpTotal > 0n ? Number(lpBurned * 10000n / lpTotal) / 100 : 0; const wbnb = Number(rWBNB) / 1e18; const liqUsd = 2 * wbnb * bnbUsd; // constant-product impact of a BNB-side buy: in / (reserve + in) const impact = (bnb) => (bnb / (wbnb + bnb) * 100).toFixed(2) + '%'; return { pair: PAIR, dex: 'PancakeSwap V2', reserves: { bobai: (rBOBAI / BigInt(1e18)).toString(), wbnb: Number(wbnb.toFixed(4)) }, liquidity_usd: Math.round(liqUsd), lp_burned_percent: Number(lpBurnedPct.toFixed(2)), lp_note: 'LP tokens sit at the dead address — permanently locked, nobody can pull this liquidity. Verify: balanceOf(0x…dEaD) on the pair.', price_impact_estimate: { '0.1 BNB buy': impact(0.1), '0.5 BNB buy': impact(0.5), '1 BNB buy': impact(1), '5 BNB buy': impact(5) }, impact_note: 'Constant-product estimate before the 3% transfer tax and LP fee. Verify live via getReserves() on the pair. Not financial advice.', }; } // Live proof the buyback-and-burn flywheel runs — from the bot's public audit // log (burns.json, written to KV by the CF-Worker bot). let ACTIVITY_ENV = null; // set per-request in fetch(); needed for the ASSETS fallback below async function getActivity() { // Primary: live log served by the bot worker (custom domain — worker-to-worker fetchable) let r = await fetch('https://logs.brainonbnb.com/logs/burns.json', { cf: { cacheTtl: 60 } }).catch(() => null); // Fallback: same-origin static copy bundled with the deploy. (The old // raw.githubusercontent copy was dropped — the repo has been unreachable // since the account flag, so it only cost a round trip on every miss.) if ((!r || !r.ok) && ACTIVITY_ENV) r = await ACTIVITY_ENV.ASSETS.fetch('https://brainonbnb.com/burns.json').catch(() => null); if (!r || !r.ok) throw new Error('burn log unavailable (HTTP ' + (r ? r.status : 'fetch failed') + ')'); const runs = await r.json(); const now = Date.now(); const within = (days) => runs.filter(e => now - Date.parse(e.time) < days * 86400e3); const sum = (arr, f) => arr.reduce((a, e) => a + (parseFloat(e[f]) || 0), 0); const period = (arr) => ({ burn_runs: arr.length, bobai_burned: Math.round(sum(arr, 'bobaiBurned')), bob_burned: Math.round(sum(arr, 'bobBurned')) }); const last = runs[runs.length - 1]; return { buyback_bot: 'autonomous, checks every 10 minutes 24/7 — executes a buyback+burn whenever the collected 3% tax reaches the swap threshold', buyback_wallet: '0xdeFC0e900Dfc83e207902cF22265Ae63f94c01ce', buyback_wallet_note: 'The 3% trade tax accumulates in this public wallet between burn runs — check its live balance (bobai_wallet_balance / BscScan) to watch the next buyback charging up.', last_burn: last ? { time: last.time, bobai_burned: Math.round(parseFloat(last.bobaiBurned) || 0), burn_tx: 'https://bscscan.com/tx/' + last.bobaiBurnTx, bnb_spent: last.totalBnb } : null, last_7_days: period(within(7)), last_30_days: period(within(30)), bot_burn_runs_total: runs.length, audit_log: 'https://logs.brainonbnb.com/logs/burns.json', note: 'Burn cadence follows trading volume — the 3% tax funds the buybacks, so more volume means more frequent burns. $BOB is the sister token (1% of the tax burns $BOB). Every burn_tx is verifiable on BscScan. Not financial advice.', }; } // BOBAI Buy NFT drop — the on-chain reward mechanic, exposed as verifiable // facts. Any wallet (including an agent's) that buys >= $100 in one swap gets // an auto-minted collectible. Live counts come from the same chain + mint-worker // sources the dashboard uses. const NFT_TIERS = [ { label: 'NICE BUY', min_buy_usd: 100 }, { label: 'BIG BUY', min_buy_usd: 150 }, { label: 'HUGE BUY', min_buy_usd: 250 }, { label: 'WHALE BUY', min_buy_usd: 500 }, { label: 'THUNDER BUY', min_buy_usd: 1000 }, { label: 'KRAKEN BUY', min_buy_usd: 2500 }, ]; const NFT_RARITIES = ['Common', 'Uncommon', 'Rare', 'Mythical', 'Legendary', 'Ancient', 'Immortal']; const NFT_RARITY_CAPS = [799, 496, 297, 162, 90, 56, 25]; async function getNftDrop() { const s = await getNftState(); const tiers = NFT_TIERS.map((t, i) => ({ tier: t.label, min_buy_usd: t.min_buy_usd, minted: s.minted[i], cap: s.cap[i], remaining: Math.max(0, s.cap[i] - s.minted[i]), })); const totalMinted = s.minted.reduce((a, b) => a + b, 0); const totalCap = s.cap.reduce((a, b) => a + b, 0); // Remaining per rarity (rarity is drawn from a weighted, hard-capped matrix) let rarities = null; if (Array.isArray(s.cells)) { rarities = NFT_RARITIES.map((name, r) => { const minted = s.cells.reduce((a, row) => a + (row?.[r] || 0), 0); return { rarity: name, minted, cap: NFT_RARITY_CAPS[r], remaining: Math.max(0, NFT_RARITY_CAPS[r] - minted) }; }); } const last = s.drops && s.drops[0]; return { what_it_is: 'On-chain reward mechanic: every $BOBAI buy of >= $100 (single swap, USD value at swap time) auto-mints a collectible NFT to the buyer wallet. No claim step, no extra cost, no signup — works for ANY wallet, including an agent-controlled one.', nft_contract: NFT_CONTRACT, standard: 'ERC-721 (BEP-721) on BNB Smart Chain', contract_renounced: true, total: { minted: totalMinted, cap: totalCap, remaining: Math.max(0, totalCap - totalMinted) }, tiers, tier_note: 'The buy size fixes the tier motif; higher tiers have far smaller caps. Rarity (7 levels, Common -> Immortal) is drawn from a weighted matrix with hard per-cell caps — once a cell is minted out, that combination can never exist again.', ...(rarities ? { rarities } : {}), holders: s.holders, last_mint: last ? { time_utc: last.ts ? new Date(last.ts * 1000).toISOString() : null, tier: NFT_TIERS[last.tier]?.label ?? last.tier, tx: last.tx ? 'https://bscscan.com/tx/' + last.tx : null } : null, how_an_agent_earns_one: [ '1. Call bobai_price to convert the tier threshold to BNB (e.g. $100 / bnb_usd, add ~5% headroom for tax + impact).', '2. Execute ONE swap of that size via bobai_how_to_buy (fee-on-transfer safe — see bobai_trade_info).', '3. The NFT is auto-minted to the buying wallet within ~1 minute. Verify: token transfers of ' + NFT_CONTRACT + ' on BscScan, or the live ledger on the collection page.', ], collection_page: 'https://brainonbnb.com/nft', verify_contract: 'https://bscscan.com/token/' + NFT_CONTRACT, note: 'Facts about a live, renounced contract — supply is hard-capped and shrinking as cells mint out. The NFT is a collectible with no promised value or utility. Not financial advice.', }; } // Machine-readable smart-money signals — the trader-agent view of $BOBAI. // Aggregates verifiable on-chain flows nobody has to trust: the tax reserve // charging the next buyback, the NFT-mint ledger (= immutable log of every // $100+ buy with wallet + tx), and burn momentum. Descriptive, not a rec. const BUYBACK_WALLET = '0xdeFC0e900Dfc83e207902cF22265Ae63f94c01ce'; async function getSmartMoney() { const [price, nft, activity, reserve, taxQueuedRaw, whales] = await Promise.all([ getPrice().catch(() => null), getNftState().catch(() => null), getActivity().catch(() => null), getWalletBalance(BUYBACK_WALLET).catch(() => null), // Tax collected by the token contract itself, waiting to be swept to the // buyback wallet — same source as the dashboard's "tax queued" sub-line. ethCall('0x70a08231000000000000000000000000' + TOKEN.slice(2)).catch(() => null), // Whale-flow aggregates from the whale watcher (worker-tg-bot): on-chain // Transfer logs scanned every minute, wallets >= 10M BOBAI auto-tracked. fetch('https://bobai-tg-bot.bobbuildonbnb.workers.dev/whale-summary').then(r => r.ok ? r.json() : null).catch(() => null), ]); const now = Date.now() / 1000; const drops = (nft?.drops || []).filter(d => d.ts && d.usd); const inWindow = (days) => drops.filter(d => now - d.ts < days * 86400); const agg = (arr) => ({ count: arr.length, usd_total: Math.round(arr.reduce((a, d) => a + (parseFloat(d.usd) || 0), 0)) }); const fmt = (d) => ({ time_utc: new Date(d.ts * 1000).toISOString(), usd: Math.round(parseFloat(d.usd) || 0), tier: NFT_TIERS[d.tier]?.label ?? d.tier, buyer: d.to, tx: d.tx ? 'https://bscscan.com/tx/' + d.tx : null, }); const reserveBnb = reserve ? parseFloat(reserve.bnb) : null; const reserveBobai = reserve ? parseInt(reserve.bobai, 10) : null; const taxQueuedBobai = taxQueuedRaw !== null ? Number(taxQueuedRaw / BigInt(1e18)) : null; const reserveUsd = (reserve && price) ? Math.round((reserveBnb * price.bnb_usd + (reserveBobai + (taxQueuedBobai || 0)) * price.price_usd) * 100) / 100 : null; return { what_this_is: 'Live smart-money signals for $BOBAI — every number below is on-chain-verifiable (contract, tx or public audit log). Descriptive market data for agents, not a recommendation.', next_buyback_charging: reserve ? { buyback_wallet: BUYBACK_WALLET, wallet_bnb: reserveBnb, wallet_bobai: reserveBobai, tax_queued_bobai_in_contract: taxQueuedBobai, reserve_usd_estimate: reserveUsd, how_it_works: 'Two stages, both public: the 3% trade tax first collects inside the token contract itself (tax_queued_bobai_in_contract = balanceOf(the token contract)), then gets swept to the buyback wallet where an autonomous bot checks every 10 minutes and converts it into buyback+burn once the swap threshold is met. Contract queue + wallet balance together = pending, predictable buy pressure.', verify: { wallet: 'https://bscscan.com/address/' + BUYBACK_WALLET, tax_queued: 'balanceOf(' + TOKEN + ') on the token contract itself — https://bscscan.com/token/' + TOKEN + '?a=' + TOKEN, }, } : null, large_buys: { source: 'Every $BOBAI buy >= $100 (single swap, USD at swap time) auto-mints an NFT — an immutable on-chain ledger of large buys. Tier = buy size (see bobai_nft_drop).', last_24h: agg(inWindow(1)), last_7d: agg(inWindow(7)), latest: drops.slice(0, 5).map(fmt), all_time_by_tier: nft ? NFT_TIERS.map((t, i) => ({ tier: t.label, min_buy_usd: t.min_buy_usd, count: nft.minted[i] })) : null, }, whale_flows: whales ? { methodology: 'A watcher scans every BOBAI Transfer log on-chain once per minute. Wallets holding >= 10,000,000 BOBAI (1% of supply) enter the watchlist automatically when they cross the threshold. Numbers below aggregate only those tracked wallets — every underlying event is a real on-chain tx.', as_of: whales.as_of, tracked_wallets: whales.tracked_wallets, holdings: whales.holdings || null, last_24h: whales.last_24h, last_7d: whales.last_7d, top_movers_24h: whales.top_movers_24h, last_event: whales.last_event, limitation: 'Holders can split into fresh wallets below the threshold; cluster analysis catches more than a threshold watcher. Cross-check independently:', independent_cross_checks: { holders_onchain: 'https://bscscan.com/token/' + TOKEN + '#balances', insightx: 'https://app.insightx.network/atlas/bsc/' + TOKEN, bubblemaps: 'https://v2.bubblemaps.io/map?address=' + TOKEN + '&chain=bsc', }, } : null, burn_momentum: activity ? { last_burn: activity.last_burn, last_7_days: activity.last_7_days, last_30_days: activity.last_30_days, audit_log: activity.audit_log, } : null, structural: { lp_permanently_locked: 'LP tokens are burned to the dead address — pool depth only grows, nobody can pull it. Live LP-burned % via bobai_liquidity.', supply_only_shrinks: 'Renounced contract, no mint function; buybacks burn supply continuously. Live totals via bobai_burned.', }, how_agents_use_this: [ 'reserve rising + steady burn cadence = the flywheel is being fed by real volume, not claims.', 'large_buys.latest gives size, buyer wallet and tx of every recent $100+ buy — follow those wallets on-chain if you track smart money.', 'Cross-check any number: every field carries a contract address, tx link or audit-log source.', ], not_financial_advice: true, }; } // Interactive entry point for any agent that discovers $BOBAI. // Answers "what can I ask? / what can I do?" and routes to the exact tool. const AGENT_GUIDE = { agent: 'Brain On BNB AI ($BOBAI)', what_this_is: 'A read-only, verifiable on-chain data surface for the $BOBAI token on BNB Chain (BSC). Not a trading bot — a source of truth other agents can call before they act.', what_you_can_know: [ { ask: 'Live price in USD/BNB + market cap, computed fully on-chain', call: 'bobai_price' }, { ask: 'Liquidity depth: reserves, USD liquidity, LP-burned %, price impact per buy size', call: 'bobai_liquidity' }, { ask: 'Is the buyback-and-burn flywheel actually running? Last burn (tx), burns last 7/30 days', call: 'bobai_activity' }, { ask: 'Smart-money signals: pending buyback reserve (buy pressure), live whale flows + holdings trends (24h/7d flows, 1d/7d/30d holdings), recent $100+ buys with wallet + tx, burn momentum', call: 'bobai_smart_money' }, { ask: 'Token basics: contract, name, symbol, decimals, supply, amount burned', call: 'bobai_token_info' }, { ask: 'How much $BOBAI has been permanently burned', call: 'bobai_burned' }, { ask: 'Current circulating supply (total minus burned)', call: 'bobai_circulating_supply' }, { ask: "Any BSC wallet's BNB and $BOBAI balance", call: 'bobai_wallet_balance', args: { address: '0x…' } }, { ask: 'Official verified links: site, contract, socials, DEX, source', call: 'bobai_links' }, { ask: 'How the token accrues value: deflationary tax->buyback->burn design + trust properties', call: 'bobai_tokenomics' }, ], what_you_can_do: [ { action: 'Get the raw DEX execution parameters (router, pair, paths, slippage, methods)', call: 'bobai_trade_info' }, { action: 'Get ready-to-run code to BUY $BOBAI with BNB', call: 'bobai_how_to_buy' }, { action: 'EARN an on-chain collectible: any buy >= $100 auto-mints a capped-supply NFT to the buying wallet — live remaining supply + steps', call: 'bobai_nft_drop' }, ], guided_prompts: [ { prompt: 'evaluate_bobai', does: 'full neutral due-diligence walkthrough (prompts/get)' }, { prompt: 'prepare_bobai_swap', does: 'fee-on-transfer-safe swap preparation, optional wallet arg (prompts/get)' }, ], must_know: '$BOBAI is a fee-on-transfer token (3% tax). Any swap MUST use the *SupportingFeeOnTransferTokens router methods with slippage >= 15% (1500 bps) or it reverts. Everything here is verifiable on-chain. Not financial advice.', }; // Neutral, verifiable value-accrual mechanics — the "how it works" thesis // an agent needs to evaluate the token. NOT a buy recommendation. const TOKENOMICS = { model: 'deflationary — circulating supply shrinks as trading volume grows', mechanism: [ '3% tax on every $BOBAI trade (rate hardcoded, distribution transparent & published)', 'the tax accumulates in the public buyback wallet 0xdeFC0e900Dfc83e207902cF22265Ae63f94c01ce', 'an autonomous bot runs every 10 minutes and splits it — base split ~1% creator / 1% $BOB burn / 1% $BOBAI burn; campaign phases may re-route slices (e.g. liquidity adds + LP burn, WC26 prize pool) — live schedule on the dashboard', 'bought-back $BOBAI is sent to the dead address = permanent, irreversible burn', 'more volume -> more buybacks -> more burned -> lower circulating supply', ], trust_properties: [ 'ownership renounced — no mint, no pause, no proxy/upgrade path', 'LP tokens burned (perma-locked at the dead address), not a timelock', 'fair launch on Four.Meme — no presale, no private sale, no team allocation', 'contract source verified and published on BscScan — readable line by line', ], verify_yourself: { burned: 'call bobai_burned', circulating_supply: 'call bobai_circulating_supply', contract: 'https://bscscan.com/token/' + TOKEN, contract_source: 'https://bscscan.com/address/' + TOKEN + '#code', burn_audit_log: 'https://logs.brainonbnb.com/logs/burns.json', }, disclaimer: "Describes the token's design, not a recommendation to buy. Meme tokens are high-risk. Not financial advice — verify everything on-chain.", }; function howToBuy() { const code = [ "// Buy $BOBAI with BNB on PancakeSwap V2 (BNB Chain).", "// $BOBAI is fee-on-transfer (3% tax): use the *SupportingFeeOnTransferTokens", "// method and >=15% slippage, or the swap reverts.", "import { createWalletClient, createPublicClient, http, parseEther } from 'viem';", "import { privateKeyToAccount } from 'viem/accounts';", "import { bsc } from 'viem/chains';", "", "const ROUTER = '" + ROUTER_V2 + "';", "const WBNB = '" + WBNB + "';", "const BOBAI = '" + TOKEN + "';", "const RPC = 'https://bsc-dataseed.binance.org'; // pass an explicit URL", "", "const routerAbi = [", " { name: 'getAmountsOut', type: 'function', stateMutability: 'view',", " inputs: [{ name: 'amountIn', type: 'uint256' }, { name: 'path', type: 'address[]' }],", " outputs: [{ name: 'amounts', type: 'uint256[]' }] },", " { name: 'swapExactETHForTokensSupportingFeeOnTransferTokens', type: 'function', stateMutability: 'payable',", " inputs: [{ name: 'amountOutMin', type: 'uint256' }, { name: 'path', type: 'address[]' },", " { name: 'to', type: 'address' }, { name: 'deadline', type: 'uint256' }], outputs: [] },", "];", "", "const account = privateKeyToAccount(process.env.PRIVATE_KEY);", "const pub = createPublicClient({ chain: bsc, transport: http(RPC) });", "const wallet = createWalletClient({ account, chain: bsc, transport: http(RPC) });", "", "const path = [WBNB, BOBAI];", "const amountIn = parseEther('0.05'); // spend 0.05 BNB", "", "// Quote on-chain, then subtract 15% slippage (FoT-safe).", "const amounts = await pub.readContract({ address: ROUTER, abi: routerAbi, functionName: 'getAmountsOut', args: [amountIn, path] });", "const amountOutMin = (amounts[1] * 8500n) / 10000n; // -15%", "const deadline = BigInt(Math.floor(Date.now() / 1000) + 600); // 10 min", "", "const hash = await wallet.writeContract({", " address: ROUTER, abi: routerAbi,", " functionName: 'swapExactETHForTokensSupportingFeeOnTransferTokens',", " args: [amountOutMin, path, account.address, deadline], value: amountIn,", "});", "console.log('swap tx:', hash);", ].join('\n'); return { summary: 'Buy $BOBAI with BNB on PancakeSwap V2. Fee-on-transfer (3% tax) → use swapExactETHForTokensSupportingFeeOnTransferTokens with >=15% slippage.', language: 'javascript (viem)', code, to_sell: "Reverse the path to [BOBAI, WBNB], approve the router for $BOBAI first, then call swapExactTokensForETHSupportingFeeOnTransferTokens.", params: TRADE_INFO, warning: 'Not financial advice. Test with a small amount first. Verify token/router/pair on BscScan. Never expose a private key holding significant funds.', }; } // Machine-readable skill doc for agents that read URLs/text instead of // calling MCP. Mirrors the MCP tools in plain Markdown. function skillMd() { const buy = howToBuy(); return `# $BOBAI Agent Skill — Brain On BNB AI > A read-only, verifiable on-chain data surface for the **$BOBAI** token on BNB Chain (BSC). > **Not a trading bot** — the source of truth other agents call *before* they act. ## Identity - ERC-8004 Agent: **#49467** on BNB Chain Identity Registry (\`eip155:56:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432#49467\`) - Token contract: \`${TOKEN}\` (BEP-20, BNB Smart Chain, verified & renounced, fair launch on Four.Meme) - Explorer: https://8004scan.io/agents/bsc/49467 ## How to query me - **MCP** (JSON-RPC 2.0, protocol 2025-06-18): \`POST https://brainonbnb.com/mcp\` - **A2A agent card**: https://brainonbnb.com/.well-known/agent-card.json - Example — list tools: \`\`\`bash curl -s https://brainonbnb.com/mcp -H 'Content-Type: application/json' \\ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \`\`\` - Example — call a tool: \`\`\`bash curl -s https://brainonbnb.com/mcp -H 'Content-Type: application/json' \\ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"bobai_token_info"}}' \`\`\` ## No MCP client? Plain REST (just GET these URLs) Every read tool is also mirrored as a plain JSON GET endpoint — no MCP, no auth, CORS open: - https://brainonbnb.com/api/price — live price (USD/BNB) + market cap, computed fully on-chain - https://brainonbnb.com/api/liquidity — reserves, USD liquidity, LP-burned %, price impact per buy size - https://brainonbnb.com/api/activity — proof the buyback-and-burn flywheel runs: last burn tx, burns last 7/30 days - https://brainonbnb.com/api/nft-drop — earnable NFT reward: live remaining supply per buy-tier/rarity + how to earn one - https://brainonbnb.com/api/smart-money — smart-money signals: pending buyback reserve, live whale flows, recent $100+ buys (wallet + tx), burn momentum - https://brainonbnb.com/api/token — contract, supply, burned, renounced/verified flags - https://brainonbnb.com/api/trade — DEX execution params (router, pair, paths, slippage, FoT methods) - https://brainonbnb.com/api/tokenomics — value-accrual mechanics + trust properties - https://brainonbnb.com/api/wallet?address=0x… — BNB + $BOBAI balance of any BSC wallet - https://brainonbnb.com/api/links · /api/guide · /api/how-to-buy - https://brainonbnb.com/api/circulating-supply · /api/total-supply — bare numbers as text/plain (aggregator-style supply endpoints) ## What you can ASK (read-only, all on-chain) - \`bobai_price\` — live price in USD/BNB + market cap (pair reserves × Chainlink BNB/USD — no off-chain price API) - \`bobai_liquidity\` — pool reserves, liquidity in USD, LP-burned % (perma-locked), price impact per buy size - \`bobai_activity\` — is the flywheel running? Last burn (BscScan tx), burns last 7/30 days, full audit log - \`bobai_smart_money\` — smart-money signals: the tax reserve charging the next buyback (wallet + contract queue = pending buy pressure), live whale flows & holdings (auto-tracked 1%-of-supply wallets, 24h/7d in/outflows, top movers with tx, daily balance snapshots with 1d/7d/30d holdings trends), an immutable ledger of recent $100+ buys with buyer wallet + tx, burn momentum - \`bobai_token_info\` — contract, name, symbol, decimals, total & circulating supply, amount burned - \`bobai_burned\` — total $BOBAI permanently burned by the autonomous 24/7 buyback bot - \`bobai_circulating_supply\` — total minus burned - \`bobai_wallet_balance\` — BNB and $BOBAI balance of any BSC wallet (arg: \`address\`) - \`bobai_links\` — official verified links (site, contract, socials, DEX, source) - \`bobai_tokenomics\` — how the token accrues value (deflationary mechanics + trust properties), verifiable, not a recommendation ## What you can DO - \`bobai_trade_info\` — raw DEX execution params (below) - \`bobai_how_to_buy\` — ready-to-run buy code (below) - \`bobai_nft_drop\` — EARN an on-chain collectible (below) - \`bobai_guide\` — interactive menu that routes each intent to a tool ## Earnable on-chain reward: the NFT buy drop This is not a promo claim — it's a live, renounced ERC-721 contract you can verify: - **Every $BOBAI buy of >= $100 in a single swap auto-mints a collectible NFT to the buying wallet.** No claim step, no signup, no extra cost — an agent-controlled wallet earns one exactly like a human's. - 1,925 max supply · 6 buy-tier motifs ($100 / $150 / $250 / $500 / $1000 / $2500+) · 7 rarities (Common → Immortal) from a weighted matrix with **hard per-cell caps** — minted-out combinations can never exist again, so supply only shrinks. - To earn one: \`bobai_price\` (convert the tier threshold to BNB, add ~5% headroom) → one swap via \`bobai_how_to_buy\` → the NFT lands in the wallet within ~1 minute. - Live remaining supply per tier and rarity: \`bobai_nft_drop\` / https://brainonbnb.com/api/nft-drop · collection: https://brainonbnb.com/nft - The NFT is a collectible with no promised value or utility. Not financial advice. ## FoT-safe swapping on BSC (general reference — works for any tax token) Agents routinely lose gas to reverted swaps on BSC because **fee-on-transfer (FoT) tax tokens break the standard swap flow**. The rules below apply to *every* FoT token on a UniswapV2-style DEX; $BOBAI (3% tax) is the worked example throughout this doc. 1. **Why naive swaps revert:** the token contract skims its tax during \`transfer\`, so the router receives fewer tokens than the constant-product math predicted. The standard \`swapExactETHForTokens\` enforces the predicted output → the K-check/\`amountOutMin\` fails → revert. 2. **Use the FoT router methods:** \`swapExactETHForTokensSupportingFeeOnTransferTokens\` (buy) / \`swapExactTokensForETHSupportingFeeOnTransferTokens\` (sell). These validate balances instead of predicted amounts. 3. **Slippage must cover tax + impact + buffer:** \`min_slippage_bps ≈ tax_bps + price_impact_bps + ~200 buffer\`. Quote via \`getAmountsOut\` on-chain, then \`amountOutMin = quote × (10000 − slippage_bps) / 10000\`. (For $BOBAI: 300 tax + impact → we publish 1500 bps as the safe floor.) 4. **Selling needs an ERC-20 \`approve\` on the router first** — buys don't. 5. **Detect the tax before trading an unknown token:** compare a static-call quote against a tiny real transfer, or read the verified contract on BscScan. Never assume 0% on a meme token. ## Prompts & resources (MCP) - Prompt \`evaluate_bobai\` — guided neutral due-diligence walkthrough through all read tools - Prompt \`prepare_bobai_swap\` — fee-on-transfer-safe swap preparation (optional \`wallet\` argument) - Resources: this skill doc (\`text/markdown\`) and the A2A agent card (\`application/json\`) are readable via \`resources/read\` ## ⚠️ Must know before swapping $BOBAI is a **fee-on-transfer** token (3% tax). A naive swap **reverts**. You MUST: - use \`swapExactETHForTokensSupportingFeeOnTransferTokens\` (buy) / \`swapExactTokensForETHSupportingFeeOnTransferTokens\` (sell) - set slippage tolerance **>= 15% (1500 bps)** ## Trade parameters - DEX: **PancakeSwap V2** - Router: \`${TRADE_INFO.router}\` - Pair: \`${TRADE_INFO.pair}\` (token0 = $BOBAI, token1 = WBNB) - Buy path: \`[${TRADE_INFO.quote_token_address}, ${TOKEN}]\` - Sell path: \`[${TOKEN}, ${TRADE_INFO.quote_token_address}]\` ## How to buy (viem) \`\`\`javascript ${buy.code} \`\`\` To sell: reverse the path, approve the router for $BOBAI first, then call \`swapExactTokensForETHSupportingFeeOnTransferTokens\`. ## Tokenomics (how it works — verify, don't trust) - **Model:** deflationary — circulating supply shrinks as trading volume grows. - **Mechanism:** 3% trade tax → autonomous 24/7 buyback → bought $BOBAI sent to the dead address (permanent burn). More volume → more burned → lower supply. - **Trust:** ownership renounced (no mint/pause/proxy) · LP burned (perma-locked) · fair launch on Four.Meme (no presale, no team allocation) · contract source verified and published on BscScan. - Verify: \`bobai_burned\`, \`bobai_circulating_supply\`, and BscScan. Describes the design, not a recommendation — meme tokens are high-risk, not financial advice. ## Verify everything yourself - Contract: https://bscscan.com/token/${TOKEN} - DexScreener: https://dexscreener.com/bsc/${TOKEN} - Contract source (verified): https://bscscan.com/address/${TOKEN}#code - Burn audit log (live): https://logs.brainonbnb.com/logs/burns.json _Not financial advice. Everything here is verifiable on-chain — don't trust, verify._ `; } function decodeAbiString(hex) { if (!hex || hex === '0x') return ''; const h = hex.slice(2); if (h.length < 128) return ''; const len = parseInt(h.slice(64, 128), 16); const data = h.slice(128, 128 + len * 2); const bytes = new Uint8Array(len); for (let i = 0; i < len; i++) bytes[i] = parseInt(data.slice(i * 2, i * 2 + 2), 16); return new TextDecoder().decode(bytes); } async function ethCallRaw(to, data) { const res = await fetch(RPC, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'eth_call', params: [{ to, data }, 'latest'] }), }); return (await res.json()).result; } async function getTokenInfo() { const [nameHex, symbolHex, decRaw, totalRaw, deadRaw, zeroRaw] = await Promise.all([ ethCallRaw(TOKEN, '0x06fdde03'), ethCallRaw(TOKEN, '0x95d89b41'), ethCall('0x313ce567'), ethCall('0x18160ddd'), ethCall('0x70a08231000000000000000000000000' + DEAD.slice(2)), ethCall('0x70a08231000000000000000000000000' + ZERO.slice(2)), ]); const div = BigInt(1e18); const total = totalRaw / div; const burned = (deadRaw + zeroRaw) / div; return { name: 'Brain On BNB AI', symbol: decodeAbiString(symbolHex), onchain_name: decodeAbiString(nameHex), contract: TOKEN, chain: 'BNB Smart Chain (BSC)', decimals: Number(decRaw), totalSupply: total.toString(), circulatingSupply: (total - burned).toString(), burned: burned.toString(), renounced: true, verified: true, }; } async function getWalletBalance(address) { if (!/^0x[0-9a-fA-F]{40}$/.test(address)) throw new Error('Invalid BSC address (expected 0x + 40 hex chars)'); const [bnbRes, bobaiRaw] = await Promise.all([ rpcJson(RPC, { jsonrpc: '2.0', id: 1, method: 'eth_getBalance', params: [address, 'latest'] }), ethCall('0x70a08231000000000000000000000000' + address.slice(2)), ]); return { address, bnb: (Number(BigInt(bnbRes.result)) / 1e18).toFixed(6), bobai: (bobaiRaw / BigInt(1e18)).toString(), }; } const MCP_TOOLS = [ { name: 'bobai_token_info', description: '$BOBAI (Brain On BNB AI) on-chain token info: contract, name, symbol, decimals, total & circulating supply, amount burned. BEP-20 on BNB Chain, verified & renounced.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_burned', description: 'Total $BOBAI permanently burned (sent to the dead/zero address by the autonomous 24/7 buyback-and-burn bot).', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_circulating_supply', description: 'Current circulating $BOBAI supply (total supply minus burned tokens).', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_wallet_balance', description: 'BNB and $BOBAI balance of any BSC wallet address.', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'BSC wallet address (0x + 40 hex chars)' } }, required: ['address'], additionalProperties: false } }, { name: 'bobai_links', description: 'Official $BOBAI links: website, BscScan contract + verified source, X, Telegram, DexScreener, GeckoTerminal, CoinGecko, live burn audit log, llms.txt.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_trade_info', description: 'How to swap $BOBAI on-chain: PancakeSwap V2 router, pair, swap paths, and the critical fee-on-transfer parameters (3% tax, min 15% slippage, SupportingFeeOnTransferTokens methods). $BOBAI reverts on a naive swap — use these.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_guide', description: 'START HERE. Interactive guide for an agent that just discovered $BOBAI: what you can ask, what you can do, and which tool to call for each — plus the must-know fee-on-transfer rule.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_how_to_buy', description: 'Ready-to-run viem code to BUY $BOBAI with BNB on PancakeSwap V2 (on-chain quote + 15% slippage + fee-on-transfer method), so an agent can execute a swap 0-shot.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_tokenomics', description: 'Neutral, verifiable value-accrual mechanics of $BOBAI: the deflationary tax->buyback->burn design + trust properties (renounced, LP burned, fair launch). Describes how the token works, NOT a buy recommendation.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_price', description: 'Live $BOBAI price in USD and BNB + market cap, computed fully on-chain (PancakeSwap V2 pair reserves × Chainlink BNB/USD feed) — no off-chain price API to trust.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_liquidity', description: 'Live $BOBAI liquidity depth: pool reserves, liquidity in USD, LP-burned percentage (perma-locked), and price-impact estimates for common buy sizes (0.1–5 BNB).', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_activity', description: 'Proof the buyback-and-burn flywheel is actually running: last burn (with BscScan tx), burns over the last 7/30 days, total bot runs — from the public audit log, every entry verifiable on-chain.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_nft_drop', description: 'On-chain reward an agent can EARN: every $BOBAI buy >= $100 (single swap) auto-mints a capped-supply collectible NFT to the buyer wallet — no claim, no signup. Live remaining supply per buy-tier and rarity, plus the exact steps to earn one.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, { name: 'bobai_smart_money', description: 'Live smart-money signals for $BOBAI: the tax reserve charging the next buyback (wallet + contract queue = pending buy pressure), whale flows & holdings (auto-tracked 1%-of-supply wallets: 24h/7d in/outflows, top movers with tx, daily balance snapshots with 1d/7d/30d holdings trends), an immutable on-chain ledger of recent $100+ buys (size, buyer wallet, tx), and burn momentum. All verifiable, no API key.', inputSchema: { type: 'object', properties: {}, additionalProperties: false } }, ]; async function runTool(name, args) { switch (name) { case 'bobai_token_info': return await getTokenInfo(); case 'bobai_burned': { const t = await getTokenInfo(); return { symbol: t.symbol, burned: t.burned, note: 'Permanently sent to dead/zero address — irreversible' }; } case 'bobai_circulating_supply': return { symbol: 'BOBAI', circulatingSupply: (await getCirculating()).toString() }; case 'bobai_wallet_balance': return await getWalletBalance(String(args?.address || '')); case 'bobai_links': return OFFICIAL_LINKS; case 'bobai_trade_info': return TRADE_INFO; case 'bobai_guide': return AGENT_GUIDE; case 'bobai_how_to_buy': return howToBuy(); case 'bobai_tokenomics': return TOKENOMICS; case 'bobai_price': return await getPrice(); case 'bobai_liquidity': return await getLiquidity(); case 'bobai_activity': return await getActivity(); case 'bobai_nft_drop': return await getNftDrop(); case 'bobai_smart_money': return await getSmartMoney(); default: throw new Error('Unknown tool: ' + name); } } // MCP resources — documents an MCP client can read/subscribe to directly. const MCP_RESOURCES = [ { uri: 'https://brainonbnb.com/skill.md', name: 'bobai_skill_doc', description: 'Machine-readable skill doc: identity, all tools, trade params, ready-to-run buy code, tokenomics', mimeType: 'text/markdown' }, { uri: 'https://brainonbnb.com/.well-known/agent-card.json', name: 'bobai_a2a_card', description: 'A2A agent card: skills and capabilities of the $BOBAI agent surface', mimeType: 'application/json' }, ]; function readResource(uri) { if (uri === 'https://brainonbnb.com/skill.md') return { uri, mimeType: 'text/markdown', text: skillMd() }; if (uri === 'https://brainonbnb.com/.well-known/agent-card.json') return { uri, mimeType: 'application/json', text: JSON.stringify(A2A_CARD, null, 2) }; throw new Error('Unknown resource: ' + uri); } // MCP prompts — guided walkthroughs that route an agent through the tools. const MCP_PROMPTS = [ { name: 'evaluate_bobai', description: 'Neutral due-diligence walkthrough of the $BOBAI token: routes through every read tool and ends with a balanced, on-chain-verified assessment (strengths AND risks).', arguments: [] }, { name: 'prepare_bobai_swap', description: 'Step-by-step preparation of a $BOBAI swap on PancakeSwap V2 (fee-on-transfer safe): trade params, price impact for your size, wallet check, executable code.', arguments: [{ name: 'wallet', description: 'BSC wallet address to check balances for (optional)', required: false }] }, ]; function getPrompt(name, args) { if (name === 'evaluate_bobai') { return { description: MCP_PROMPTS[0].description, messages: [{ role: 'user', content: { type: 'text', text: [ 'You are evaluating the $BOBAI token (Brain On BNB AI) on BNB Chain. Use this server\'s tools and stay neutral — verify, don\'t trust.', '1. Call bobai_token_info — confirm contract, supply, amount burned, renounced/verified flags.', '2. Call bobai_price and bobai_liquidity — note liquidity depth, LP-burned %, and the price impact for your intended size.', '3. Call bobai_activity — open the last burn tx on BscScan to confirm the buyback flywheel actually runs.', '4. Call bobai_tokenomics — understand the value-accrual design and its trust properties.', '5. Cross-check at least one claim independently on-chain (e.g. balanceOf(0x…dEaD) on the token contract, or getReserves() on the pair).', 'Then give a balanced assessment: strengths, risks (meme token, small liquidity means high price impact, burn cadence depends on volume), and anything you could not verify. This is research, not financial advice.', ].join('\n') } }], }; } if (name === 'prepare_bobai_swap') { const wallet = args?.wallet && /^0x[0-9a-fA-F]{40}$/.test(args.wallet) ? args.wallet : null; return { description: MCP_PROMPTS[1].description, messages: [{ role: 'user', content: { type: 'text', text: [ 'You are preparing (not necessarily executing) a $BOBAI swap on PancakeSwap V2. $BOBAI is fee-on-transfer (3% tax) — a naive swap reverts.', '1. Call bobai_trade_info — router, pair, swap paths, the *SupportingFeeOnTransferTokens methods and slippage >= 15% (1500 bps).', '2. Call bobai_price and bobai_liquidity — check the price-impact estimate for your size; the 3% transfer tax comes on top.', wallet ? '3. Call bobai_wallet_balance with address ' + wallet + ' — confirm it holds the BNB for the swap plus gas.' : '3. Optionally call bobai_wallet_balance — confirm the wallet holds the BNB for the swap plus gas.', '4. Call bobai_how_to_buy — ready-to-run viem code (on-chain quote minus 15% slippage, explicit RPC).', 'Sanity rules: test with a small amount first, verify token/router/pair on BscScan yourself, never expose a private key holding significant funds. Not financial advice.', ].join('\n') } }], }; } throw new Error('Unknown prompt: ' + name); } const rpcOk = (id, result) => ({ jsonrpc: '2.0', id, result }); const rpcErr = (id, code, message) => ({ jsonrpc: '2.0', id, error: { code, message } }); async function handleMcp(request) { const cors = { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS', 'Access-Control-Allow-Headers': 'Content-Type', 'Content-Type': 'application/json', }; if (request.method === 'OPTIONS') return new Response(null, { headers: cors }); if (request.method === 'GET') { return new Response(JSON.stringify({ name: 'Brain On BNB AI ($BOBAI)', protocol: '2025-06-18', tools: MCP_TOOLS.map(t => t.name), prompts: MCP_PROMPTS.map(p => p.name), resources: MCP_RESOURCES.map(r => r.uri) }), { headers: cors }); } let body; try { body = await request.json(); } catch { return new Response(JSON.stringify(rpcErr(null, -32700, 'Parse error')), { headers: cors }); } const { id, method, params } = body || {}; if (method && method.startsWith('notifications/')) return new Response(null, { status: 202, headers: cors }); try { if (method === 'initialize') { console.log('[mcp] initialize', body?.params?.clientInfo?.name || 'unknown-client'); return new Response(JSON.stringify(rpcOk(id, { protocolVersion: '2025-06-18', capabilities: { tools: {}, resources: {}, prompts: {} }, serverInfo: { name: 'Brain On BNB AI ($BOBAI)', version: '1.3.0' }, })), { headers: cors }); } if (method === 'tools/list') return new Response(JSON.stringify(rpcOk(id, { tools: MCP_TOOLS })), { headers: cors }); if (method === 'tools/call') { console.log('[mcp] tools/call', params?.name); const out = await runTool(params?.name, params?.arguments || {}); return new Response(JSON.stringify(rpcOk(id, { content: [{ type: 'text', text: JSON.stringify(out, null, 2) }] })), { headers: cors }); } if (method === 'resources/list') return new Response(JSON.stringify(rpcOk(id, { resources: MCP_RESOURCES })), { headers: cors }); if (method === 'resources/templates/list') return new Response(JSON.stringify(rpcOk(id, { resourceTemplates: [] })), { headers: cors }); if (method === 'resources/read') { console.log('[mcp] resources/read', params?.uri); return new Response(JSON.stringify(rpcOk(id, { contents: [readResource(params?.uri)] })), { headers: cors }); } if (method === 'prompts/list') return new Response(JSON.stringify(rpcOk(id, { prompts: MCP_PROMPTS })), { headers: cors }); if (method === 'prompts/get') { console.log('[mcp] prompts/get', params?.name); return new Response(JSON.stringify(rpcOk(id, getPrompt(params?.name, params?.arguments || {}))), { headers: cors }); } if (method === 'ping') return new Response(JSON.stringify(rpcOk(id, {})), { headers: cors }); return new Response(JSON.stringify(rpcErr(id ?? null, -32601, 'Method not found: ' + method)), { headers: cors }); } catch (e) { return new Response(JSON.stringify(rpcErr(id ?? null, -32000, e.message || String(e))), { headers: cors }); } } const A2A_CARD = { name: 'Brain On BNB AI ($BOBAI)', description: 'Read-only agent surface for $BOBAI — on-chain token info, burns, circulating supply, wallet balances, and official links.', url: 'https://brainonbnb.com/', version: '1.0.0', protocolVersion: '0.3.0', documentationUrl: 'https://brainonbnb.com/skill.md', provider: { organization: 'Brain On BNB AI', url: 'https://brainonbnb.com/' }, capabilities: { streaming: false }, defaultInputModes: ['text'], defaultOutputModes: ['text'], skills: [ { id: 'token_info', name: 'Token info', description: '$BOBAI contract, supply, decimals, amount burned', tags: ['crypto', 'bsc', 'token'] }, { id: 'burns', name: 'Burn stats', description: 'Total $BOBAI permanently burned', tags: ['crypto', 'deflationary'] }, { id: 'wallet_balance', name: 'Wallet balance', description: 'BNB + $BOBAI balance of any BSC wallet', tags: ['crypto', 'bsc'] }, { id: 'links', name: 'Official links', description: 'Verified $BOBAI site, socials, DEX, source', tags: ['links'] }, { id: 'trade_info', name: 'Trade info', description: 'PancakeSwap V2 router, pair & fee-on-transfer params (3% tax, min 15% slippage) to swap $BOBAI without reverting', tags: ['crypto', 'bsc', 'dex', 'trade'] }, { id: 'guide', name: 'Agent guide', description: 'Start here — interactive map of what you can ask/do about $BOBAI and which tool to call', tags: ['guide', 'onboarding'] }, { id: 'how_to_buy', name: 'How to buy', description: 'Ready-to-run viem code to buy $BOBAI with BNB (fee-on-transfer safe)', tags: ['crypto', 'bsc', 'dex', 'trade', 'code'] }, { id: 'tokenomics', name: 'Tokenomics', description: 'Neutral value-accrual mechanics: deflationary tax->buyback->burn design + trust properties (renounced, LP burned, fair launch)', tags: ['crypto', 'tokenomics', 'deflationary'] }, { id: 'price', name: 'Live price', description: 'Live $BOBAI price in USD/BNB + market cap, computed fully on-chain (pair reserves × Chainlink BNB/USD)', tags: ['crypto', 'bsc', 'price', 'market-data'] }, { id: 'liquidity', name: 'Liquidity depth', description: 'Pool reserves, USD liquidity, LP-burned % (perma-locked) and price-impact estimates per buy size', tags: ['crypto', 'bsc', 'liquidity', 'market-data'] }, { id: 'activity', name: 'Burn activity', description: 'Proof the buyback-and-burn flywheel runs: last burn tx, burns last 7/30 days, public audit log', tags: ['crypto', 'bsc', 'burns', 'audit'] }, { id: 'nft_drop', name: 'NFT buy drop', description: 'Earnable on-chain reward: every $BOBAI buy >= $100 auto-mints a capped-supply collectible NFT to the buyer wallet — live remaining supply per tier/rarity + how to earn one', tags: ['crypto', 'bsc', 'nft', 'reward'] }, { id: 'smart_money', name: 'Smart-money signals', description: 'Pending buyback reserve (= predictable buy pressure), live whale flows & holdings (24h/7d in/outflows, top movers with tx, 1d/7d/30d holdings trends from daily balance snapshots), immutable on-chain ledger of recent $100+ buys (size, buyer wallet, tx), and burn momentum — all verifiable', tags: ['crypto', 'bsc', 'smart-money', 'whales', 'signals', 'market-data'] }, ], }; // ERC-8004 domain proof. The spec lets an agent prove control of an endpoint // domain by serving /.well-known/agent-registration.json with a registrations // list that points back at the on-chain agentId + registry. Without it every // brainonbnb.com service (MCP, A2A) stays domain_verified:false on indexers // like 8004scan, because the Pages SPA answers unknown paths with 200 + HTML. const AGENT_REGISTRATION = { type: 'https://eips.ethereum.org/EIPS/eip-8004#registration-v1', name: 'Brain On BNB AI ($BOBAI)', description: 'AI-built deflationary meme token on BNB Chain. A 3% trade tax funds an autonomous 24/7 buyback-and-burn cycle. Contract source verified on BscScan and ownership renounced, LP perma-locked, fair launch on Four.Meme with no presale or team allocation. Every burn run is written to a public audit log.', image: 'https://brainonbnb.com/logo-200x200.png', active: true, registrations: [ { agentId: 49467, agentRegistry: 'eip155:56:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432' }, ], supportedTrust: ['reputation'], }; // Plain REST mirror of the MCP tools — the lowest common denominator for // agents that can GET a URL but don't speak MCP yet (documented in skill.md). const REST_TOOLS = { '/api/price': 'bobai_price', '/api/liquidity': 'bobai_liquidity', '/api/activity': 'bobai_activity', '/api/nft-drop': 'bobai_nft_drop', '/api/smart-money': 'bobai_smart_money', '/api/token': 'bobai_token_info', '/api/trade': 'bobai_trade_info', '/api/tokenomics': 'bobai_tokenomics', '/api/links': 'bobai_links', '/api/guide': 'bobai_guide', '/api/how-to-buy': 'bobai_how_to_buy', }; // An ETag is a fingerprint of a response. The browser sends it back next time // ("If-None-Match"), and if nothing changed we answer 304 with no body — a few // hundred bytes instead of the whole file. The log proxy below rebuilds its // responses from scratch, so it has to supply its own; without one, every poll // pays for the full payload and the page can only stay fresh by not caching at // all. That is the difference between "refresh re-downloads everything" and // "refresh just asks and is done". async function etagOf(buf) { const d = await crypto.subtle.digest('SHA-1', buf); const hex = [...new Uint8Array(d)].map((b) => b.toString(16).padStart(2, '0')).join(''); return '"' + hex.slice(0, 20) + '"'; } // If-None-Match may carry several values and a W/ prefix. Tolerate both, or the // revalidation never matches and we ship the full body every single time. function etagMatches(header, tag) { if (!header) return false; if (header.trim() === '*') return true; return header.split(',').some((v) => v.trim().replace(/^W\//, '') === tag); } export default { async fetch(request, env) { ACTIVITY_ENV = env; const url = new URL(request.url); if (url.pathname === '/mcp') return handleMcp(request); // Same-origin proxy for the bot-worker log store (KV via logs.brainonbnb.com). // Keeps the page independent of the visitor's DNS/CORS for the logs subdomain. const logMatch = url.pathname.match(/^\/logs\/([a-z0-9-]+\.json)$/); if (logMatch) { // These files ARE the page's live numbers: burns and liquidity adds. // They used to be served as "fresh for two minutes", plus ten more via // stale-while-revalidate — so after a burn the page could sit on the old // figures for a quarter of an hour and only a manual reload helped. // Now the browser revalidates every time: unchanged means an empty 304 // (as cheap as the old caching), changed means it shows up at once. // cacheTtl keeps the log worker out of it no matter how many visitors // are asking at the same moment. const LOG_CACHE = 'public, max-age=0, must-revalidate'; const inm = request.headers.get('If-None-Match'); const deliver = async (buf) => { const tag = await etagOf(buf); const headers = { 'Content-Type': 'application/json', 'Cache-Control': LOG_CACHE, 'ETag': tag, 'Access-Control-Allow-Origin': '*', }; if (etagMatches(inm, tag)) return new Response(null, { status: 304, headers }); return new Response(buf, { headers }); }; const upstream = await fetch('https://logs.brainonbnb.com/logs/' + logMatch[1], { cf: { cacheTtl: 20, cacheEverything: true } }).catch(() => null); if (upstream && upstream.ok) return deliver(await upstream.arrayBuffer()); // Fallback: static copy bundled with the deploy const fallback = await env.ASSETS.fetch('https://brainonbnb.com/' + logMatch[1]).catch(() => null); if (fallback && fallback.ok) return deliver(await fallback.arrayBuffer()); return new Response('[]', { headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' } }); } if (REST_TOOLS[url.pathname] || url.pathname === '/api/wallet') { const headers = { 'Content-Type': 'application/json', 'Cache-Control': 'public, max-age=60', 'Access-Control-Allow-Origin': '*' }; try { const out = url.pathname === '/api/wallet' ? await runTool('bobai_wallet_balance', { address: url.searchParams.get('address') || '' }) : await runTool(REST_TOOLS[url.pathname], {}); return new Response(JSON.stringify(out, null, 2), { headers }); } catch (e) { const status = url.pathname === '/api/wallet' && /Invalid BSC address/.test(e.message || '') ? 400 : 502; return new Response(JSON.stringify({ error: e.message || String(e) }), { status, headers }); } } if (url.pathname === '/skill.md') { return new Response(skillMd(), { headers: { 'Content-Type': 'text/markdown; charset=utf-8', 'Cache-Control': 'public, max-age=300', 'Access-Control-Allow-Origin': '*' }, }); } if (url.pathname === '/.well-known/agent-card.json') { return new Response(JSON.stringify(A2A_CARD, null, 2), { headers: { 'Content-Type': 'application/json', 'Cache-Control': 'public, max-age=300', 'Access-Control-Allow-Origin': '*' }, }); } if (url.pathname === '/.well-known/agent-registration.json') { return new Response(JSON.stringify(AGENT_REGISTRATION, null, 2), { headers: { 'Content-Type': 'application/json', 'Cache-Control': 'public, max-age=300', 'Access-Control-Allow-Origin': '*' }, }); } if (url.pathname === '/api/total-supply' || url.pathname === '/api/circulating-supply') { const supply = await getCirculating(); return new Response(supply.toString(), { headers: { 'Content-Type': 'text/plain', 'Cache-Control': 'public, max-age=300', 'Access-Control-Allow-Origin': '*', }, }); } if (url.pathname === '/api/nft/state') { try { const state = await getNftState(); return new Response(JSON.stringify(state), { headers: { 'Content-Type': 'application/json', 'Cache-Control': 'public, max-age=30, s-maxage=30', 'Access-Control-Allow-Origin': '*', }, }); } catch (e) { return new Response(JSON.stringify({ error: e.message || String(e) }), { status: 502, headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' }, }); } } const response = await env.ASSETS.fetch(request); const secure = (h) => { h.set('X-Content-Type-Options', 'nosniff'); h.set('X-Frame-Options', 'SAMEORIGIN'); h.set('Referrer-Policy', 'strict-origin-when-cross-origin'); h.set('Strict-Transport-Security', 'max-age=31536000; includeSubDomains'); return h; }; // DON'T TRY THIS AGAIN: attaching our own ETag to the HTML so a refresh can // be answered with an empty 304 does not work here. Cloudflare runs HTML // through its own post-processing and drops ETag and Content-Length on the // way out — measured live twice on 2026-08-09, including with no-transform // and on pages without a mailto link. That is why the fix went the other // way, through file size: stylesheet (styles.css) and code (app.js) sit // versioned in the device cache, and the HTML carries only content. const newResponse = new Response(response.body, response); secure(newResponse.headers); return newResponse; }, }; ============================================================================== === FILE: dashboard/llms.txt ============================================================================== # Brain On BNB AI ($BOBAI) > Brain On BNB AI ($BOBAI) is an AI-built, deflationary meme token on BNB Chain (BEP-20). Every trade pays a 3% tax that funds an autonomous 24/7 buyback-and-burn cycle. The contract is verified on BscScan, ownership is renounced (no mint, no pause, no proxy), LP is perma-locked at the dead address, and the token launched as a fair launch on Four.Meme with no presale or private allocation. The contract source is published and readable on BscScan, and every buyback-and-burn run is written to a public audit log. ## Key facts (verifiable on-chain) - Name: Brain On BNB AI — ticker $BOBAI (also written brainonbnb / brainonbnbai) - Chain: BNB Chain (BSC), standard BEP-20 - Contract: 0x245c386dcfed896f5c346107596141e5edcbffff - Ownership: renounced — no mint function, no admin pause, no proxy/upgrade path - Liquidity: LP tokens sent to the dead address (perma-locked), not a timelock - Launch: fair launch on Four.Meme — no presale, no private sale, no pre-mine; supply entered the market through the public bonding curve - Tax: 3% per trade — split 1% creator / 1% $BOB burn / 1% $BOBAI burn (campaign phases may temporarily re-route a slice; the live split is always shown on the dashboard) - Buyback: a Cloudflare-Workers bot runs every 10 minutes, 24/7 — it buys $BOBAI on PancakeSwap and sends it to the dead address; every burn is on-chain and verifiable ## Where to verify - Website: https://brainonbnb.com/ - Contract (BscScan, verified): https://bscscan.com/token/0x245c386dcfed896f5c346107596141e5edcbffff - CoinGecko: https://www.coingecko.com/en/coins/brain-on-bnb-ai - DexScreener: https://dexscreener.com/bsc/0x245c386dcfed896f5c346107596141e5edcbffff - GeckoTerminal: https://www.geckoterminal.com/bsc/pools/0x6eadd4cb786898b34929444988380ed0cc6fd9a6 - DEXTools: https://www.dextools.io/token/bobai - Binance Web3 Wallet: https://web3.binance.com/en/token/bsc/0x245c386dcfed896f5c346107596141e5edcbffff - Contract source (BscScan, verified): https://bscscan.com/address/0x245c386dcfed896f5c346107596141e5edcbffff#code - Burn audit log (live, every bot run): https://logs.brainonbnb.com/logs/burns.json ## Where to buy - PancakeSwap V2: https://pancakeswap.finance/swap?outputCurrency=0x245c386dcfed896f5c346107596141e5edcbffff - Binance Web3 Wallet, OKX Wallet, Bitget Wallet — always paste the contract address yourself; do not trust ticker search. ## Agent interface (ERC-8004) $BOBAI is a registered ERC-8004 agent (#49467 on BNB Chain) with a live, callable interface — other agents can query verifiable on-chain data and get ready-to-run swap code before acting. It is a data source, not a trading agent. - Skill doc (start here): https://brainonbnb.com/skill.md - MCP endpoint (JSON-RPC 2.0): https://brainonbnb.com/mcp - A2A agent card: https://brainonbnb.com/.well-known/agent-card.json - Registry entry: https://8004scan.io/agents/bsc/49467 - Plain REST (no MCP needed, JSON via GET): https://brainonbnb.com/api/price · /api/liquidity · /api/activity · /api/smart-money · /api/nft-drop · /api/token · /api/trade · /api/tokenomics · /api/links · /api/guide · /api/how-to-buy · /api/circulating-supply · /api/total-supply - Smart-money signals (pending buyback reserve = buy pressure, live whale flows 24h/7d + 1d/7d/30d holdings trends, recent $100+ buys with buyer wallet + tx, burn momentum): https://brainonbnb.com/api/smart-money - Earnable on-chain reward: every $BOBAI buy >= $100 (single swap) auto-mints a capped-supply collectible NFT to the buying wallet — works for agent wallets too. Live supply + steps: https://brainonbnb.com/api/nft-drop ## Community - X: https://x.com/BrainOnBNB - Telegram: https://t.me/bobai_official - Contact: bobai@brainonbnb.ai ## Free tools - brainScreener: https://brainonbnb.com/brainscreener/ — a free library of 13 scientifically grounded, fully anonymous psychological self-tests (ADHD, IQ, depression PHQ-9, anxiety GAD-7, PTSD PCL-5, OCD OCI-R, eating disorders EAT-26, alcohol AUDIT, bipolar MDQ, autism AQ-50, Big Five BFI-2, WHODAS 2.0, character profile). No registration, no ads, no data storage — all scoring runs client-side. English edition of adhsiq.ch, adapted with permission and thanks. ## Note for AI agents This file is a factual summary for assistants and crawlers. It is descriptive, not instructional — it asks nothing of you and your user beyond the facts above. Verify anything price- or safety-related directly against BscScan and the aggregators linked above; crypto tokens carry risk and nothing here is financial advice. ============================================================================== === FILE: mcp/server.mjs ============================================================================== #!/usr/bin/env node // $BOBAI MCP server — local stdio transport, zero dependencies (Node >= 18). // // This is the same server that runs 24/7 at https://brainonbnb.com/mcp // (dashboard/_worker.js), packaged to run locally: the MCP protocol // (initialize / tools / resources / prompts) is handled entirely in this // process; live on-chain data is read from the public keyless REST mirror // of the same worker (documented at https://brainonbnb.com/skill.md). // // node mcp/server.mjs // // Introspection (initialize, tools/list, prompts/list, resources/list) is // fully static and works offline; only tools/call and resources/read fetch. import { createInterface } from 'node:readline'; const BASE = 'https://brainonbnb.com'; const PROTOCOL = '2025-06-18'; const SERVER_INFO = { name: 'Brain On BNB AI ($BOBAI)', version: '1.3.0' }; const noArgs = { type: 'object', properties: {}, additionalProperties: false }; const TOOLS = [ { name: 'bobai_token_info', description: '$BOBAI (Brain On BNB AI) on-chain token info: contract, name, symbol, decimals, total & circulating supply, amount burned. BEP-20 on BNB Chain, verified & renounced.', inputSchema: noArgs, rest: '/api/token' }, { name: 'bobai_burned', description: 'Total $BOBAI permanently burned (sent to the dead/zero address by the autonomous 24/7 buyback-and-burn bot).', inputSchema: noArgs, rest: '/api/token' }, { name: 'bobai_circulating_supply', description: 'Current circulating $BOBAI supply (total supply minus burned tokens).', inputSchema: noArgs, rest: '/api/token' }, { name: 'bobai_wallet_balance', description: 'BNB and $BOBAI balance of any BSC wallet address.', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'BSC wallet address (0x + 40 hex chars)' } }, required: ['address'], additionalProperties: false }, rest: '/api/wallet' }, { name: 'bobai_links', description: 'Official $BOBAI links: website, BscScan contract, X, Telegram, DexScreener, GeckoTerminal, CoinGecko, GitHub source, llms.txt.', inputSchema: noArgs, rest: '/api/links' }, { name: 'bobai_trade_info', description: 'How to swap $BOBAI on-chain: PancakeSwap V2 router, pair, swap paths, and the critical fee-on-transfer parameters (3% tax, min 15% slippage, SupportingFeeOnTransferTokens methods). $BOBAI reverts on a naive swap — use these.', inputSchema: noArgs, rest: '/api/trade' }, { name: 'bobai_guide', description: 'START HERE. Interactive guide for an agent that just discovered $BOBAI: what you can ask, what you can do, and which tool to call for each — plus the must-know fee-on-transfer rule.', inputSchema: noArgs, rest: '/api/guide' }, { name: 'bobai_how_to_buy', description: 'Ready-to-run viem code to BUY $BOBAI with BNB on PancakeSwap V2 (on-chain quote + 15% slippage + fee-on-transfer method), so an agent can execute a swap 0-shot.', inputSchema: noArgs, rest: '/api/how-to-buy' }, { name: 'bobai_tokenomics', description: 'Neutral, verifiable value-accrual mechanics of $BOBAI: the deflationary tax->buyback->burn design + trust properties (renounced, LP burned, fair launch). Describes how the token works, NOT a buy recommendation.', inputSchema: noArgs, rest: '/api/tokenomics' }, { name: 'bobai_price', description: 'Live $BOBAI price in USD and BNB + market cap, computed fully on-chain (PancakeSwap V2 pair reserves × Chainlink BNB/USD feed) — no off-chain price API to trust.', inputSchema: noArgs, rest: '/api/price' }, { name: 'bobai_liquidity', description: 'Live $BOBAI liquidity depth: pool reserves, liquidity in USD, LP-burned percentage (perma-locked), and price-impact estimates for common buy sizes (0.1–5 BNB).', inputSchema: noArgs, rest: '/api/liquidity' }, { name: 'bobai_activity', description: 'Proof the buyback-and-burn flywheel is actually running: last burn (with BscScan tx), burns over the last 7/30 days, total bot runs — from the public audit log, every entry verifiable on-chain.', inputSchema: noArgs, rest: '/api/activity' }, { name: 'bobai_nft_drop', description: 'On-chain reward an agent can EARN: every $BOBAI buy >= $100 (single swap) auto-mints a capped-supply collectible NFT to the buyer wallet — no claim, no signup. Live remaining supply per buy-tier and rarity, plus the exact steps to earn one.', inputSchema: noArgs, rest: '/api/nft-drop' }, { name: 'bobai_smart_money', description: 'Live smart-money signals for $BOBAI: the tax reserve charging the next buyback (wallet + contract queue = pending buy pressure), whale flows & holdings (auto-tracked 1%-of-supply wallets: 24h/7d in/outflows, top movers with tx, daily balance snapshots with 1d/7d/30d holdings trends), an immutable on-chain ledger of recent $100+ buys (size, buyer wallet, tx), and burn momentum. All verifiable, no API key.', inputSchema: noArgs, rest: '/api/smart-money' }, ]; const RESOURCES = [ { uri: 'https://brainonbnb.com/skill.md', name: 'bobai_skill_doc', description: 'Machine-readable skill doc: identity, all tools, trade params, ready-to-run buy code, tokenomics', mimeType: 'text/markdown' }, { uri: 'https://brainonbnb.com/.well-known/agent-card.json', name: 'bobai_a2a_card', description: 'A2A agent card: skills and capabilities of the $BOBAI agent surface', mimeType: 'application/json' }, ]; const PROMPTS = [ { name: 'evaluate_bobai', description: 'Neutral due-diligence walkthrough of the $BOBAI token: routes through every read tool and ends with a balanced, on-chain-verified assessment (strengths AND risks).', arguments: [] }, { name: 'prepare_bobai_swap', description: 'Step-by-step preparation of a $BOBAI swap on PancakeSwap V2 (fee-on-transfer safe): trade params, price impact for your size, wallet check, executable code.', arguments: [{ name: 'wallet', description: 'BSC wallet address to check balances for (optional)', required: false }] }, ]; async function fetchJson(path) { const res = await fetch(BASE + path, { headers: { accept: 'application/json' } }); if (!res.ok) throw new Error(`GET ${path} -> HTTP ${res.status}`); return res.json(); } async function runTool(name, args) { const tool = TOOLS.find(t => t.name === name); if (!tool) throw new Error('Unknown tool: ' + name); if (name === 'bobai_wallet_balance') { const address = String(args?.address || ''); if (!/^0x[0-9a-fA-F]{40}$/.test(address)) throw new Error('Invalid BSC address (expected 0x + 40 hex chars)'); return fetchJson('/api/wallet?address=' + address); } const data = await fetchJson(tool.rest); if (name === 'bobai_burned') return { symbol: data.symbol, burned: data.burned, note: 'Permanently sent to dead/zero address — irreversible' }; if (name === 'bobai_circulating_supply') return { symbol: 'BOBAI', circulatingSupply: String(data.circulatingSupply ?? data.circulating_supply) }; return data; } async function readResource(uri) { const r = RESOURCES.find(x => x.uri === uri); if (!r) throw new Error('Unknown resource: ' + uri); const res = await fetch(uri); if (!res.ok) throw new Error(`GET ${uri} -> HTTP ${res.status}`); return { uri, mimeType: r.mimeType, text: await res.text() }; } function getPrompt(name, args) { if (name === 'evaluate_bobai') { return { description: PROMPTS[0].description, messages: [{ role: 'user', content: { type: 'text', text: [ 'You are evaluating the $BOBAI token (Brain On BNB AI) on BNB Chain. Use this server\'s tools and stay neutral — verify, don\'t trust.', '1. Call bobai_token_info — confirm contract, supply, amount burned, renounced/verified flags.', '2. Call bobai_price and bobai_liquidity — note liquidity depth, LP-burned %, and the price impact for your intended size.', '3. Call bobai_activity — open the last burn tx on BscScan to confirm the buyback flywheel actually runs.', '4. Call bobai_tokenomics — understand the value-accrual design and its trust properties.', '5. Cross-check at least one claim independently on-chain (e.g. balanceOf(0x…dEaD) on the token contract, or getReserves() on the pair).', 'Then give a balanced assessment: strengths, risks (meme token, small liquidity means high price impact, burn cadence depends on volume), and anything you could not verify. This is research, not financial advice.', ].join('\n') } }], }; } if (name === 'prepare_bobai_swap') { const wallet = args?.wallet && /^0x[0-9a-fA-F]{40}$/.test(args.wallet) ? args.wallet : null; return { description: PROMPTS[1].description, messages: [{ role: 'user', content: { type: 'text', text: [ 'You are preparing (not necessarily executing) a $BOBAI swap on PancakeSwap V2. $BOBAI is fee-on-transfer (3% tax) — a naive swap reverts.', '1. Call bobai_trade_info — router, pair, swap paths, the *SupportingFeeOnTransferTokens methods and slippage >= 15% (1500 bps).', '2. Call bobai_price and bobai_liquidity — check the price-impact estimate for your size; the 3% transfer tax comes on top.', wallet ? '3. Call bobai_wallet_balance with address ' + wallet + ' — confirm it holds the BNB for the swap plus gas.' : '3. Optionally call bobai_wallet_balance — confirm the wallet holds the BNB for the swap plus gas.', '4. Call bobai_how_to_buy — ready-to-run viem code (on-chain quote minus 15% slippage, explicit RPC).', 'Sanity rules: test with a small amount first, verify token/router/pair on BscScan yourself, never expose a private key holding significant funds. Not financial advice.', ].join('\n') } }], }; } throw new Error('Unknown prompt: ' + name); } const ok = (id, result) => ({ jsonrpc: '2.0', id, result }); const err = (id, code, message) => ({ jsonrpc: '2.0', id, error: { code, message } }); const send = (msg) => process.stdout.write(JSON.stringify(msg) + '\n'); async function handle(req) { const { id, method, params } = req; if (typeof method !== 'string') { if (id !== undefined) send(err(id, -32600, 'Invalid request')); return; } if (method.startsWith('notifications/')) return; try { if (method === 'initialize') return send(ok(id, { protocolVersion: PROTOCOL, capabilities: { tools: {}, resources: {}, prompts: {} }, serverInfo: SERVER_INFO })); if (method === 'tools/list') return send(ok(id, { tools: TOOLS.map(({ rest, ...t }) => t) })); if (method === 'tools/call') { const out = await runTool(params?.name, params?.arguments || {}); return send(ok(id, { content: [{ type: 'text', text: JSON.stringify(out, null, 2) }] })); } if (method === 'resources/list') return send(ok(id, { resources: RESOURCES })); if (method === 'resources/templates/list') return send(ok(id, { resourceTemplates: [] })); if (method === 'resources/read') return send(ok(id, { contents: [await readResource(params?.uri)] })); if (method === 'prompts/list') return send(ok(id, { prompts: PROMPTS })); if (method === 'prompts/get') return send(ok(id, getPrompt(params?.name, params?.arguments || {}))); if (method === 'ping') return send(ok(id, {})); return send(err(id ?? null, -32601, 'Method not found: ' + method)); } catch (e) { return send(err(id ?? null, -32000, e.message || String(e))); } } const rl = createInterface({ input: process.stdin, terminal: false }); rl.on('line', (line) => { line = line.trim(); if (!line) return; let req; try { req = JSON.parse(line); } catch { return send(err(null, -32700, 'Parse error')); } handle(req); }); rl.on('close', () => process.exit(0)); ============================================================================== === FILE: scripts/bobai-agent-card.json ============================================================================== { "type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1", "name": "Brain On BNB AI ($BOBAI)", "description": "AI-built deflationary meme token on BNB Chain. A 3% trade tax funds an autonomous 24/7 buyback-and-burn cycle. Contract source verified on BscScan and ownership renounced, LP perma-locked, fair launch on Four.Meme with no presale or team allocation. Every burn run is written to a public audit log.", "image": "https://brainonbnb.com/logo-200x200.png", "active": true, "services": [ { "name": "web", "description": "Brain On BNB AI — official site: live stats, tokenomics, on-chain burn verification, FAQ", "endpoint": "https://brainonbnb.com/" }, { "name": "telegram", "description": "BOBAI Telegram — community, buy & burn alerts", "endpoint": "https://t.me/bobai_official" }, { "name": "agentWallet", "endpoint": "eip155:56:0x15Ba17075ef5E0736292b030e3715d9100fe3d38" }, { "name": "A2A", "version": "0.3.0", "endpoint": "https://brainonbnb.com/.well-known/agent-card.json" }, { "name": "MCP", "version": "2025-06-18", "endpoint": "https://brainonbnb.com/mcp", "capabilities": { "tools": [ { "name": "bobai_token_info", "description": "$BOBAI on-chain token info: contract, name, symbol, decimals, total & circulating supply, amount burned" }, { "name": "bobai_burned", "description": "Total $BOBAI permanently burned via the autonomous 24/7 buyback-and-burn bot" }, { "name": "bobai_circulating_supply", "description": "Current circulating $BOBAI supply (total minus burned)" }, { "name": "bobai_wallet_balance", "description": "BNB and $BOBAI balance of any BSC wallet address" }, { "name": "bobai_links", "description": "Official $BOBAI links: site, contract, socials, DEX, source, llms.txt" }, { "name": "bobai_trade_info", "description": "How to swap $BOBAI on-chain: PancakeSwap V2 router, pair, swap paths + fee-on-transfer params (3% tax, min 15% slippage) so an agent's swap does not revert" }, { "name": "bobai_guide", "description": "Start here — interactive guide for an agent that discovered $BOBAI: what you can ask, what you can do, and which tool to call for each" }, { "name": "bobai_how_to_buy", "description": "Ready-to-run viem code to buy $BOBAI with BNB on PancakeSwap V2 (on-chain quote + 15% slippage + fee-on-transfer method) for 0-shot execution" }, { "name": "bobai_tokenomics", "description": "Neutral, verifiable value-accrual mechanics: deflationary tax->buyback->burn design + trust properties (renounced, LP burned, fair launch). Describes how the token works, not a buy recommendation" }, { "name": "bobai_price", "description": "Live $BOBAI price in USD and BNB + market cap, computed fully on-chain (PancakeSwap V2 pair reserves x Chainlink BNB/USD feed)" }, { "name": "bobai_liquidity", "description": "Live $BOBAI liquidity depth: pool reserves, liquidity in USD, LP-burned percentage (perma-locked), price-impact estimates per buy size" }, { "name": "bobai_activity", "description": "Proof the buyback-and-burn flywheel is running: last burn (BscScan tx), burns over the last 7/30 days, total bot runs - every entry verifiable on-chain" }, { "name": "bobai_nft_drop", "description": "On-chain reward an agent can EARN: every $BOBAI buy >= $100 (single swap) auto-mints a capped-supply collectible NFT to the buyer wallet - live remaining supply per buy-tier/rarity + the exact steps to earn one" }, { "name": "bobai_smart_money", "description": "Live smart-money signals: the tax reserve charging the next buyback (wallet + contract queue = pending buy pressure), whale flows & holdings (auto-tracked 1%-of-supply wallets: 24h/7d in/outflows, top movers with tx, daily balance snapshots with 1d/7d/30d holdings trends), an immutable on-chain ledger of recent $100+ buys, and burn momentum - all verifiable" } ], "prompts": [ { "name": "evaluate_bobai", "description": "Neutral due-diligence walkthrough of $BOBAI: routes through every read tool, ends with a balanced on-chain-verified assessment" }, { "name": "prepare_bobai_swap", "description": "Step-by-step fee-on-transfer-safe swap preparation: trade params, price impact, wallet check, executable code" } ], "resources": [ { "uri": "https://brainonbnb.com/skill.md", "description": "Machine-readable skill doc (text/markdown)" }, { "uri": "https://brainonbnb.com/.well-known/agent-card.json", "description": "A2A agent card (application/json)" } ] } } ], "supportedTrust": ["reputation"], "attributes": [ { "trait_type": "Token", "value": "$BOBAI (Brain On BNB AI)" }, { "trait_type": "Token Contract", "value": "0x245c386dcfed896f5c346107596141e5edcbffff" }, { "trait_type": "Chain", "value": "BNB Smart Chain (BSC)" }, { "trait_type": "Tax", "value": "3% per trade -> autonomous 24/7 buyback & burn" }, { "trait_type": "Ownership", "value": "Renounced - no mint, no pause, LP perma-locked" }, { "trait_type": "Launch", "value": "Fair launch on Four.Meme - no presale, no team allocation" }, { "trait_type": "Twitter", "value": "@BrainOnBNB" }, { "trait_type": "Telegram", "value": "@bobai_official" }, { "trait_type": "Contract Source", "value": "https://bscscan.com/address/0x245c386dcfed896f5c346107596141e5edcbffff#code" }, { "trait_type": "Burn Audit Log", "value": "https://logs.brainonbnb.com/logs/burns.json" } ], "registrations": [ { "agentId": 49467, "agentRegistry": "eip155:56:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432" } ] }