Listed from the MCP registry; nobody on Odel publishes it.
Cookie Chain tools for AI agents: swap, launch, liquidity, staking, NFTs, and a Solana bridge.
Runs on your machine from its package; the steps are below.

At most: moves money, runs code or commands, deletes data, or sends messages for you.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y cookie-mcp
MCP client config
{
"mcpServers": {
"cookie": {
"command": "npx",
"args": [
"-y",
"cookie-mcp"
]
}
}
}A Model Context Protocol (MCP) server that gives any AI agent onchain tools for the Cookie Chain blockchain — read the market, swap, launch tokens and NFT collections, manage liquidity, stake, trade NFTs, and bridge to Solana.
It runs locally over stdio and signs with your key on your machine, so it is non-custodial by design. For hosted apps (a web chat, a bot behind a website) it runs in external-signer mode: the server holds no key, every action stops at the signing step with a verified transaction, and the user's own browser wallet signs it — same tools, same guardrails (details). It is a community project for the whole Cookie Chain ecosystem.
aggregator
parameter and can quote both to compare. chain: "solana" buys/sells the bridged COOK on Solana
mainnet via Jupiter instead..cook names on the
CookOven name service, and use them anywhere an address is expected
(transfer to: "bot.cook").Safe by default: read-only until you add a key, and every money-moving action is simulated before it is sent.
Requires Node ≥ 22. There is nothing to install or build — npx fetches the published package on
first run. Pick your client below. All three use the same server; the only difference is where the
config lives.
The quickest way — one command, available in every project:
claude mcp add --scope user --transport stdio cookie-mcp -- npx -y cookie-mcp
This registers the server read-only (no key). See Enable trading to add a wallet.
Scopes — claude mcp add writes to one of three places; choose with --scope:
--scope | Available in | Stored in |
|---|---|---|
user | all your projects | ~/.claude.json |
(omitted) local | the current project dir | ~/.claude.json (per-folder) |
project | anyone who clones a repo | .mcp.json at the repo root |
Use --scope project only when you want the server committed into a specific repo — it writes a
.mcp.json that teammates must approve on first use. For a general-purpose tool like this, --scope user is the right default.
Verify it registered:
claude mcp list # all servers
claude mcp get cookie-mcp # this one's details
# or run /mcp inside a Claude Code session
Edit the config file (create it if missing), then restart Claude Desktop:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonAdd the server block below under mcpServers.
Edit ~/.cursor/mcp.json (applies everywhere) or .cursor/mcp.json in a project (project wins if
both exist), then add the server block.
Claude Desktop, Cursor, and a Claude Code .mcp.json all use the identical shape:
{
"mcpServers": {
"cookie-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "cookie-mcp"],
"env": {
"COOKIE_RPC_URL": "https://rpc.cookiescan.io",
"COOKIE_PRIVATE_KEY": ""
}
}
}
}
Reads work with no key. To let the agent swap, transfer, launch, stake, LP, buy NFTs, or bridge,
provide a wallet via COOKIE_PRIVATE_KEY — a base58 secret, a solana-keygen JSON byte array, or a
path to a keypair file.
Config-file clients (Desktop / Cursor / .mcp.json): put it in the env block above.
Claude Code: re-run the add with --env (note: this is saved to ~/.claude.json; avoid leaving
the raw secret in your shell history):
claude mcp add --scope user --transport stdio cookie-mcp \
--env COOKIE_RPC_URL=https://rpc.cookiescan.io \
--env COOKIE_PRIVATE_KEY=<your-key-or-path> \
-- npx -y cookie-mcp
Your key never leaves your machine, is used only to sign locally, and is redacted from all output. Every money-moving action is simulated before it is sent. A transaction that a venue API built (a swap, any launchpad action) is also held to what you asked for: if its simulation would take more than the requested amount plus fees, touch another token you hold, hand one of your token accounts or a delegate to someone else, or deliver less than the quoted minimum, it is refused unsigned.
Once it's registered, just talk to your agent naturally:
chain_healthsearch_tokens → get_token_infoget_quoteget_quote → trade (needs a key; simulated first)get_quote always returns warnings[] and trade returns routeWarnings[] — one entry per hooked mint with reviewed, title, detail. Read detail before trading. transfer handles hooked mints; add_liquidity/create_pool on Cookiebox CLMM split the open+deposit tx when a hooked mint would overflow it, and create_pool refuses up front when the mint still needs a Cookiebox TokenBadge.search_nfts → buy_nftget_walletThe agent resolves names to mint addresses with search_tokens / search_nfts, then acts on the mint —
it never turns a name straight into a trade.
| Variable | Default | Purpose |
|---|---|---|
COOKIE_RPC_URL | https://rpc.cookiescan.io | Cookie Chain RPC. |
COOKIE_PRIVATE_KEY | — | Wallet key for money-moving tools. Read-only if unset. |
COOKIE_SIGNER | local | external = no key in the process; tools return needs_signature for the user's wallet to sign. |
COOKIE_WALLET_ADDRESS | — | External mode: default wallet when a request carries no x-cookie-wallet header. |
COOKIE_MCP_HTTP_PORT / _HOST / _PATH | — / 127.0.0.1 / /mcp | Serve Streamable HTTP instead of stdio (same as --http [port]). |
COOKIE_MCP_CORS_ORIGIN | *, or none with a local key | Comma-separated browser origins allowed to call the HTTP server (* = any). |
COOKIE_MCP_HTTP_TOKEN | — | Bearer token every HTTP MCP request must send. Required with a local key over HTTP. |
COOKIE_MCP_ALLOWED_HOSTS | loopback names on a loopback bind | Comma-separated Host values the HTTP server answers to (blocks DNS rebinding). |
COOKIE_IMAGE_DIR | home directory | The only folder deploy_token.imagePath and create_nft_drop's art may read from (stdio only). |
COOKIE_SLIPPAGE_BPS | 500 | Default slippage (bps). |
COOKIE_REFERRER | mcp treasury | Referral wallet (MomoSwap only). |
COOKIE_APP_ID | — | Name of your app, sent to the venues in User-Agent (see Client identity). |
SOLANA_RPC_URL | https://api.mainnet-beta.solana.com | Solana RPC. |
JUPITER_API_KEY | — | Optional; else keyless Jupiter at 0.5 req/s. |
Reads (no key): chain_health, get_pools, get_token_info, search_tokens (resolve a token
name/ticker to its mint), get_quote, get_wallet (which key this server signs with, and the RPC it
uses — no RPC call, so it works when the chain is down), get_balance, stake_info (bCOOK liquid-staking rate / TVL /
APY / fees), launchpad reads get_launchpad_pools / get_launchpad_token /
get_launchpad_positions, and NFT reads
get_nft_listings, search_nfts (resolve an NFT/collection name to a listed mint), get_nft,
get_wallet_nfts, get_nft_offers, get_nft_market_stats, and .cook name reads
resolve_domain / get_owned_domains / get_domain_listings, and get_bridge_tokens (what the
bridge can move).
Money (need COOKIE_PRIVATE_KEY): trade (swap via Cookiebox or Cookiescan), transfer (COOK or any token,
with an optional memo written through the SPL Memo program — the way to pay an invoice or payment
request that matches transfers by memo), unwrap_cook (turn the wallet's wrapped COOK — where
launchpad referral earnings and NFT sell-backs land — back into native COOK), stake / unstake
(COOK ⇄ bCOOK liquid staking).
Limit orders (Cookiebox limit-order escrow, program L1M1tk…):
get_limit_orders lists a wallet's resting orders with no key (yours, or any address / .cook name);
place_limit_order and cancel_limit_order need COOKIE_PRIVATE_KEY. An order locks the input in a
program-owned reserve; a keeper fills it through the same router trade uses, so any pair with a route
can rest as an order, and pays the pinned output account (partial fills possible). Two kinds:
limit (default) is a take-profit: fills at the price or better. The price must sit above
the current rate.stop is a stop-loss, stop-market: price is the trigger, which must sit below the current
rate; once the executable rate falls to it the keeper sells at market and passes the proceeds
through. A hidden on-chain floor (50% below the trigger, floorPrice to override) only caps what a
compromised keeper key could pay — it is not what you receive.The only fee is the program's maker fee, 10 bps at launch, deducted from each fill and read live
from chain (fees in get_limit_orders). Orders default to a one-week expiry (expiresInSeconds,
0 = good-til-cancelled, max one year); an expired order still holds its input until it is
cancelled. Native COOK is wrapped inside the placement and refunded as COOK on cancel.
MomoSwap curve orders placed on cookiebox.app show up in get_limit_orders as well: a
curve-buy is an ordinary escrow order whose fill lands as curve shares (cancel it here like any
other); a curve-sell is a launchpad sale authorization, not an escrow — escrowed: false, the
shares stay spendable and createdAt is null. cancel_limit_order revokes it: the aggregator has no
cancel-tx for it, so this server builds the launchpad's revoke_position_sale itself after reading
the authorization from chain (launchpad-owned, right discriminator, your wallet as owner), followed by
the limit-order program's settle_curve_sell(close) when the order pays a curve-sell vault that still
exists. The result says revoked: true; nothing is refunded because nothing was held.
place_limit_order places curve orders too, for the direct COOK pair of a token still on its
curve (detected from the mints; limit only, no stops). COOK → token becomes a curve-buy: an
ordinary escrow order whose payout is your launchpad position, filled by the keeper's buy_for; the
free one-time enable_buy_for opt-in is added to the first order when your wallet lacks it, and the
pool's minBuy / per-wallet cap are checked so an unfillable order is refused up front. Token → COOK
becomes a curve-sell: an approve_position_sale for the Cookiebox keeper at your floor, one per
pool, paying your curve-sell vault — the limit-order program's wCOOK account for this pool and
wallet, created in the same transaction. Each fill pays the vault and the program's
settle_curve_sell passes it on to your wallet as native COOK minus the limit-order maker fee
(makerFeeBps, read live; netAfterFee is what you receive at the floor; payoutNative: true,
no token account needed). The floor is the price
itself: priced at P, the order fills once the curve pays P and you receive P minus the fee, like a
plain order. The keeper refuses an authorization that pays anything but the vault, so there is no
fee-free shape to place. cancel_limit_order revokes the authorization and, while the vault still
exists, settles and closes it too, returning both rents. Its expiry is clamped to the sale's own end: the
launchpad caps an authorization at 30 days and never reads the pool, but no fill is possible once the
launch closes, and a launch runs at most 7 days — so expiresAt is never past saleEndsAt, and the
one-week default would otherwise mint an order that shows a future expiry and can never fill. This
server assembles both shapes itself (the aggregator has built them since 2026-09-22, but a local
build keeps the signed bytes derived from what we read); the buy is then run through the same
instruction-level verifier as an aggregator build, and both are simulated before signing.
⚠️ The aggregator builds the transaction; this server verifies it before signing. Every instruction is decoded against the program IDL and checked — fee payer, maker, amounts, kind, expiry, the pinned refund / payout accounts, the order PDA, and that only the five expected programs are touched (escrow, compute budget, system, token, associated-token). A build that disagrees with the request is refused with nothing signed.
place_limit_orderalso refuses an order that would fill or trigger immediately against the router's current rate (usetrade), and a pair with no route at all, unlessskipMarketCheck: true. Prices go to the API as decimal strings; a number that would print in exponent form is refused rather than rounded.
DCA schedules (Cookiebox DCA escrow, program DCAkvX8… — a
separate program from the limit-order one, filled by the same keeper): get_dca_schedules lists a
wallet's running schedules with no key (yours, or any address / .cook name); open_dca and
close_dca need COOKIE_PRIVATE_KEY. A DCA is a stop-market order that fires on a clock instead
of a price, N times: the whole budget is escrowed at open, and each cycle the keeper may release
at most one amountPerCycle slice, swap it through the same router trade uses, and pay the
proceeds into the account pinned at open. The program — not the keeper — owns the schedule, so a
stolen keeper key cannot accelerate it.
cycles or amountPerCycle. The slice is rounded up, so
the count the program derives (ceil(amount / slice), max 1024) can be one lower than the one you
asked for; every result reports the derived number, never the typed one.cycleSeconds is 60 … 31,536,000 (a minute to a year). startAt (unix seconds) delays the
first cycle; a past timestamp is refused rather than clamped, because the program's max(now)
would fire it immediately.minPrice / maxPrice are an optional per-cycle band on the output, quoted per full slice.
minPrice is the protective one; maxPrice guards against an implausibly good fill on a
manipulated pool. A cycle outside the band — or with no route — is skipped, never caught up, so
the band is checked against the router's executable rate for one slice before opening and an
unsatisfiable one is refused unless skipMarketCheck: true. A band quoted off a mid price is a
band the keeper can never satisfy.Fee singleton. Native COOK input is wrapped inside
the open and refunded as COOK by close_dca.get_dca_schedules reports averagePrice — what the schedule has actually bought at so far, the
one number a list of individual fills never gives — and flags status: "overdue", which means a
cycle was missed: the program drops it instead of catching up, so it is a real loss, not a
delay.buy_for leg, unlike a curve limit order). Both are refused before anything is escrowed.close_dca returns the unspent remainder; whatever the schedule already bought is already in
the wallet. A schedule that spends its whole budget closes itself and stops being listed.The open/close transactions are built by the aggregator and verified here exactly as the limit-order
ones are — user, amounts, frequency, the band, the start time, the schedule PDA against the signing
base, the pinned refund/payout accounts, the five allowed programs — and simulated before signing.
Zip — trailing range orders (Cookiebox Zip, program ZiPzPbbM…):
get_zip_orders lists a wallet's orders with no key (yours, or any address / .cook name);
start_zip and stop_zip need a signer. A Zip order sells one token for another across a price
range and never fills back: it rests as a one-sided Cookiebox CLMM position that the Cookiebox
keeper trails, moving the range's trailing edge up to the price one tick spacing at a time, and each
move pays the part that has filled (plus the LP fees earned on the way) to your wallet. The three
tools behave exactly like Cookiebox's /trade Zip tab and its Zip orders list.
start_zip with sell, receive (mints, or "COOK"), amount
and the prices from/to — receive per sell, what one sold token fetches, so from is the
price nothing sells under and to the best one (the priceUnit every result carries). Omit the
prices for a range from one price step past the market to 10% above it. fee (bps) picks the pool
the order earns fees in; the default is the pair's deepest pool, else the 0.25% tier.from is a floor. Whatever part of the range the market already
beats is sold at once — in the pool when it is live (price limit at from), else through the
router (floor at from on the whole fill; the amount is halved until it fits, or nothing is sold
and the order rests at from). The rest starts one price step past the market. A range the market
beats entirely is just swapped (swapped: true). The result's note says what to expect and names
the range actually placed when prices snapped to the pool's steps or the range was cut.from, with the range's tick arrays); an empty pool parked on the wrong side of
the order has its price moved there (with no liquidity a swap trades nothing). A pool with
liquidity is never moved — its price is the market.enable.
The keeper refuses to fund any of it. Several transactions: with an external signer each is handed
back as an intermediate step — submit, then call again; the flow re-prices against the market on
every call, continues with a same-range position of yours an earlier call opened, and never sells
or opens twice. Every refusal (a hooked mint with no published extra-account list, a mint the CLMM
won't pool, an amount you don't hold) comes before anything is sent.start_zip with position (its NFT mint) instead. A one-sided
position infers the direction, one holding both tokens needs sell. On a position whose order is
already running this repairs a paused order — tick arrays, payout accounts, the NFT's
delegation (re-approved when you still hold it) — without stopping it.enable makes the order PDA the NFT's SPL delegate, and the
program lets that delegate do exactly two things: move the trailing edge (one CPI to the CLMM's
reposition_liquidity_v2, with the received-token deposit capped at 0 so the range can never
contain the price again) and finish once the whole range has filled.cranker defaults to the Cookiebox keeper and is pinned into the order. "anyone" leaves it
unpinned, which the trust model warns against: a hostile cranker passing the old liquidity at
every step hands about 1 − 1/minStep of the order back unconverted (no loss, but no fill).
minStep (default 1) is how many tick spacings the price must move past the edge before it
follows. Payouts in COOK arrive as native COOK, never wCOOK; a Token-2022 payout arrives net of its
transfer fee. No protocol fee.get_zip_orders reports what each order sells and receives, its from–to range and the
current price (receive per sell), what is left in it, who may crank it, and a status with the
keeper's next move in words: filling, waiting, fully-filled (the keeper pays out and closes
next), paused (delegation gone, a transfer hook with no published extra-account list, payout
account closed, or a tick array missing — start_zip on the position repairs all but the hook),
empty, filled (paid out; the empty position is left for you to close) or stale (position
gone). Predicted from the program's own edge rule, which src/core/zip/decision.ts mirrors.stop_zip takes everything back: closes the order (rent to its owner), revokes the
delegation, withdraws what is left in the position with its fees and rewards, and closes the
position (its rent back too). On a filled order it closes the empty position left behind. The
owner, or whoever holds the NFT now, may stop it (a holder who is not the owner only closes the
order). position may be the NFT mint, the position account or the order address; a stale order
stops too.Launchpad (need COOKIE_PRIVATE_KEY, MomoSwap): deploy_token launches a
token on a COOK bonding curve (a logo is required — pass imageBase64 and it is pinned to IPFS, or
set noLogo: true to launch without one; the metadata is immutable, so a logo cannot be added later.
Costs the launchpad creation fee, read from its config at call time, plus any
devBuyCook; maxCostCook caps the total and is required with devBuyPctOfTotalSupply),
launchpad_buy / launchpad_sell trade that curve, claim_launchpad
settles a position (the real SPL token after graduation, a Fair-mode refund, or a Jackpot/Survivor payout),
and claim_creator_fees sweeps the creator's share of trading fees from a launch you created.
⚠️ Before graduation, holdings are program-tracked curve shares, not SPL tokens — they do not appear in
get_balanceandtradecannot route them. Exit withlaunchpad_sell, or claim the real token withclaim_launchpadonce the pool graduates; from then on it trades like any other token.
Shares can be sent to another wallet with transfer_launchpad_shares (address or .cook name):
transfer cannot move them, because they are positions, not tokens. Only while the launch is live and
past its first-minute anti-snipe window; a first send to a wallet with no position must be at least a
minimum buy's worth, and the cost basis moves with the shares (it counts toward the recipient's
per-wallet cap). A recipient never used on chain — what a mistyped address looks like — is refused
unless allowUnusedRecipient: true, since shares sent there never come back. The launchpad builds the
transaction, and it is held instruction by instruction to exactly that transfer before signing.
Because those shares are invisible to get_balance, get_launchpad_positions is the portfolio
view: every launch a wallet has a position in, what it is worth on a live curve, and what is unclaimed
(tokens after graduation, a Fair-mode refund, a settlement payout, creator fees or vesting). It reads
the UserPosition accounts straight from the chain in batches, so it costs about one RPC round trip
per 100 launches. Pass owner for any wallet, or omit it for your own.
A pre-graduation token also has no DEX pool at all, so get_quote / trade would just report "no
route". They now recognise that case and point at the launchpad tools instead, and get_token_info and
search_tokens add a launchpad field when a mint shows no price or liquidity because it is still on a
curve (or expired on one). search_tokens also finds launches the Cookiescan registry has not listed.
Paired launches (MomoSwap's holder-reward tokens). A paired launch mints a Token-2022 token whose every transfer — buys and sells included — withholds a holder tax (1–3%); the launchpad sells the harvested tax and pays it to holders daily in a chosen pair asset (COOK, bCOOK, …). It has no deadline, expiry mode, anti-snipe window or wallet cap, and graduates to a market when the raise hits the target. Every launchpad tool handles them:
get_launchpad_pair_assets (no key) lists the pair assets and the tax tiers; deploy_token with
pairAsset + holderTaxPct launches one (a dev buy is bundled and its delivery, net of tax, is held
to our own quote of the launch curve).launchpad_buy / launchpad_sell trade a paired curve with real tokens (they show in
get_balance; there are no curve shares). The tax comes off the tokens a buyer receives and off the
tokens a seller sends in. Both carry an on-chain minimum: slippageBps (default 1%) off our own
quote of the curve (a port of the program's math, pinned to trades recorded from the program
itself), which the build must carry. A buy that reaches the graduation target is charged only what
it used.get_launchpad_pools / get_launchpad_token show a paired block (tax, pair asset, phase:
live / soon / migrating / graduated); get_launchpad_positions lists paired tokens under
pairedHoldings with any holder rewards waiting and the recent payouts. Rewards are paid out
automatically, so there is nothing to claim; only the creator's vest is claimable on a paired pool.trade / get_quote like any other. While it is
migrating (target hit, market not seeded yet) nothing can trade it, and the tools say so.NFT launchpad (MomoSwap NFT drops, program momoDc2L…): fixed-supply
collections minted off a COOK bonding curve. get_nft_drops and get_nft_drop need no key; the rest
need COOKIE_PRIVATE_KEY. Each mint costs a little more than the last, and the items are real NFTs in
the wallet from the first mint (unlike launchpad tokens), with the art hidden behind a committed reveal
until the sale ends.
nft_drop_mint mints 1–10 items, one transaction each, each capped at maxCookPerItem (fee
included) or the quote plus slippageBps (default 1%). After a drop graduates at its target, a mint
is a request a keeper settles with a random remaining item; a wallet may hold up to 10 open per drop,
so count places that many.nft_drop_settle is for when a request stays pending: it pushes the drop's FIFO mint queue through
all of your open requests, settling each head whose randomness is ready and refunding each whose randomness
expired (~3 minutes). Requests ahead of yours pay out to their own buyers; you pay only the fee.nft_drop_sell sells an item back to the curve while the drop is live (the guaranteed exit).nft_drop_redeem burns an item for the permanent floor after graduation, or for the pro-rata refund
of a drop that ended short — whichever applies.nft_drop_claim pays a drop's creator their proceeds (and a royalty partner their share).nft_drop_graduate graduates a sold-out drop. Anyone may send it (usually a keeper does); it opens
the floor and the creator's payout, and ends sell-backs.create_nft_drop launches a collection from a folder of images (optional Metaplex <name>.json
beside each for traits): the art is pinned to IPFS and its order sealed behind a fairness commitment
whose seed MomoSwap holds, so the creator cannot pick the rare mints. Run it with dryRun: true first:
the preview shows the first and last price, the raise at sell-out and the floor. A launch is final.
reveal_nft_drop later records the seed on chain (optional; the art is published either way).⚠️ The MomoSwap API builds every NFT transaction; this server checks it before signing. Each build is held to the program's vendored IDL (
src/idl/momo_nft_launchpad.json): only the instructions that action calls, in order; the account count, signer flags, fixed addresses and every PDA re-derived; this wallet in the authorising slot; the collection and item asked about;max_costwithin the approved spend; and nothing but a compute-unit limit, idempotent ATA creates and the COOK wrap around it. Then the simulation is held to a spend budget: at most the stated COOK leaves, only the named item leaves, and on a mint the item must arrive.
Liquidity (need COOKIE_PRIVATE_KEY): create_pool, add_liquidity, remove_liquidity,
claim_fees (Cookiebox DAMM v2, Cookiebox CLMM, and CookieSwap BAMM, venue auto-detected),
lock_liquidity (Cookiebox DAMM v2 and Cookiebox CLMM, permanent and irreversible — CLMM locks the
whole position; fees stay claimable either way). Concentrated-liquidity venues (CLMM / BAMM) open a
full-range position by default.
NFT marketplace (need COOKIE_PRIVATE_KEY, Baked Bazaar): buy_nft,
list_nft, cancel_listing, make_offer, accept_offer, cancel_offer. Built on the Cookie Chain
Metaplex Auction House (1% marketplace fee + creator royalties); every action is built and signed
locally. list_nft with via: "momoswap" lists a MomoSwap drop's item through MomoSwap instead, which
adds its listing fee (1%, at least 0.001 COOK; checked before signing). Never taken on its own.
Lending (Aera, the overcollateralised COOK money market): get_lending_markets
(every reserve: supplied / borrowed / available, supply and borrow APR, caps, collateral terms, oracle
health) and get_lending_position (a wallet's share tokens, collateral, debt and health factor) need no
key. Writes need COOKIE_PRIVATE_KEY: lend / withdraw_lend (supply COOK or bCOOK, hold aCOOK /
abCOOK shares that grow with interest), deposit_collateral / withdraw_collateral (lock bCOOK —
supplied and deposited as abCOOK in one transaction — or take it back out), borrow / repay (COOK,
with a 0.15% origination fee). Built straight from the program — Aera has no API and no IDL — and every
health-dependent action carries its same-slot accrue / refresh_oracle / refresh_obligation prelude
in the same transaction, which is what the program demands.
⚠️ Loans can be liquidated.
borrowandwithdraw_collateralrefuse before signing when the loan-to-value limit would be exceeded or the health factor would fall underminHealthFactor(default 1.1; 1.0 is the liquidation line, where collateral is seized at an 8% bonus to the liquidator). Pass a lower floor explicitly to accept more risk. Interest accrues per slot, so a loan left alone drifts toward that line;get_lending_positionprojects it to now. Repay works even while the protocol is paused; supplier withdrawals are limited by the reserve's available liquidity.
Dice Club (diceclub.cookiebox.app, program DiCe5Vcp…):
provably fair on-chain dice. Pick a win chance, stake COOK, win if the roll (0.00–99.99) lands under
it; a win pays stake × (100 − edge) / chance (1% edge: 50% → 1.98x, 10% → 9.9x), so the expected
return is the same at every chance. get_dice_table (no key) shows the live rules and limits — edge,
minimum stake, free bankroll, the largest stake the house takes at common chances (one bet may win at
most 1% of the free bankroll), the pending queue — and quotes a chance / amount; get_dice_bets
(no key) lists a wallet's pending bets or, by nonce, one bet's verified result. roll_dice and
refund_dice_bet need a signer.
roll_dice generates it here
(random, or clientSeed), so the house cannot know a roll before the bet lands. roll_dice waits
for the house's keeper (waitSeconds, default 45), then re-derives the roll from the revealed seed:
proof.verified means the seed opens the commitment and the roll, outcome and payout all recompute
(a link to the site's verifier comes with it). A slow keeper returns pending — check later with
get_dice_bets.refund_dice_bet returns the stake once the bet is past its deadline and first in line. Each bet
also pays ~0.002 COOK of account rent, returned when it settles. At 10 waiting bets the table
closes until the keeper catches up.Bridge (need COOKIE_PRIVATE_KEY): bridge moves a token 1:1 between Cookie Chain and Solana
mainnet over the Hyperlane warp routes (token = a symbol or mint,
default COOK; direction = cookie-to-solana | solana-to-cookie). Today that is COOK (native
COOK on Cookie ⇄ a 6-decimal Token-2022 SPL COOK on Solana) and SOL (native SOL on Solana ⇄ a
synthetic SOL token on Cookie, mint 6tL24Fn75uCMrBSZAvohAq57LSv6KrY6ceEq1wonvucb). Amounts are in the
token's own units either way. One source-chain signature dispatches the transfer; a relayer delivers on
the far side in a few minutes — check with bridge_status (a read, by Hyperlane message id).
New tokens work without an update. get_bridge_tokens and bridge don't carry a token list: they
find every warp program on Cookie Chain owned by the bridge's upgrade authority, read each one's
Hyperlane token account (route type, mint, decimals, IGP, enrolled Solana router), and accept a route
only when the Solana program it names is on the Solana mailbox and routes back to it. A token the bridge
team adds is bridgeable as soon as its route is enrolled; a program anyone else deploys is never listed.
Discovery is cached for 10 minutes. If the Cookie RPC ever refuses the program listing, the built-in
COOK and SOL routes are still checked and get_bridge_tokens says so in warnings.
Simulates first, and preflights the destination before signing, because source-chain simulation cannot see the far side:
bridge refuses it and reports what is there as destinationCollateral (null when the destination
mints the token instead, like SOL on Cookie).bridge refuses anything smaller.bridge creates it from your wallet first (one extra tx on the destination,
a little of that chain's native coin in rent, reclaimable by closing the account) and confirms it
before dispatching — so a failure there costs nothing. The warp route can create it itself, but pays
from a PDA funded once at deploy time; when that runs dry the relayer's delivery fails in
simulation, never reaches the chain, and the transfer hangs with no error anywhere (this happened
on 2026-08-26). Pass createRecipientAccount: false to rely on that PDA instead — then bridge
refuses when it is provably dry. The result reports the account as recipientTokenAccount.The bridge website adds a flat fee to its own transfers (0.01 SOL / 15,000 COOK to the relayer). That
fee is enforced by the site, not by the warp programs, and bridge does not add it.
get_balance with chain: "solana" shows the Solana side before you bridge — the wallet's SPL
COOK (what solana-to-cookie spends), its SOL (the fee and interchain gas, and what a SOL bridge
spends), and bridgeTokens: every other token the bridge can move out of Solana, discovered on-chain
like the routes. It does not enumerate unrelated Solana tokens. On an RPC that refuses
getTokenAccountsByOwner (Shyft's free plan does), it reads each token's standard account instead and
adds a warning that tokens held elsewhere aren't counted.
Swap on Solana (get_quote / trade with chain: "solana"): routes Solana mainnet liquidity
through Jupiter instead of Cookie Chain — how you buy or sell the bridged SPL COOK
(36ZrtQoab5MhhySaP1YSTwUahSk6GRVUTtZ6cuVfm9e1) once it is on the far side. Same non-custodial shape as
every other swap: Jupiter quotes and builds, we simulate on your Solana RPC, sign locally, send, confirm.
Fees are paid in SOL, and the same COOKIE_PRIVATE_KEY signs on both chains — run get_wallet
first. Two things to know:
SOL → COOK and
COOK → USDC work while an unrelated pair like SOL → USDC is refused. Jupiter would route it;
this server is for Cookie Chain, and every extra pair is surface that can move funds.So1111…112 is COOK on Cookie Chain but wSOL on Solana — the identical mint string, a different
asset. Token metadata is resolved per chain, and the aggregator parameter (Cookie Chain only) is
rejected rather than ignored when chain: "solana".trade refuses the public Solana endpoint. Quotes need no RPC at all, but a swap does, and
api.mainnet-beta.solana.com rate-limits sendTransaction hardest — a send that lands late against
your slippage cap fails. Point SOLANA_RPC_URL at a dedicated RPC (a free Helius/Triton/QuickNode
key is enough).The bridge works out of the box on mainnet. For a different deployment, override the mailboxes
(COOKIE_MAILBOX / SOLANA_MAILBOX), the upgrade authority discovery trusts
(BRIDGE_COOKIE_UPGRADE_AUTHORITY; "" turns discovery off), and add a Cookie warp program to always
check with COOKIE_WARP_PROGRAM_ID. The Solana side and the IGP are read from the routes themselves.
.cook names (CookOven): resolve_domain looks a name up — owner,
registration date, resolver/metadata pointers — or reports it as available with the live price;
get_owned_domains lists every name a wallet holds and which is its primary. Writes need
COOKIE_PRIVATE_KEY: register_domain, set_primary_domain (or clear: true to unset),
transfer_domain, update_domain. Everything is read and built straight from the on-chain registry —
no API, no indexer. The suffix is optional everywhere: chef and chef.cook are the same name.
Once you own a name you can use it instead of an address: transfer, get_balance,
get_wallet_nfts, get_nft_offers, get_launchpad_positions and transfer_domain all accept a
.cook name wherever they take a Cookie Chain wallet. A plain base58 address costs no extra lookup.
.cook domain marketplace (CookOven Marketplace): the secondary
market for names that are already registered — often cheaper than the 15,000–35,000 COOK registration,
and the only way to get a name somebody else already owns. get_domain_listings browses it with no key
(filter by name, seller, maxPriceCook or maxLength; sort by price, length or recency) and
reports the live marketplace fee, which the seller pays out of the sale price. Writes need
COOKIE_PRIVATE_KEY: list_domain (asking price in COOK), buy_domain, cancel_domain_listing.
Read and built straight from the program — no API, no indexer.
⚠️ Listing escrows the name.
list_domainhands the domain to the marketplace's escrow account in the same instruction, so while it is listed the registry reports the escrow as its owner: the seller cannottransfer_domain,update_domainorset_primary_domainon it, and it stops resolving to a payable address. Those tools say so explicitly rather than reporting a stranger as the owner, and passing a listed name where an address is expected is refused — the escrow is a program account, so paying it would strand the funds.cancel_domain_listingreverses a listing at any time and refunds its rent. There is no re-price instruction: cancel, then list again.
buy_domainrequiresmaxPriceCookfor the same reasonregister_domaindoes — the instruction carries no price argument, so that cap is the only guard. Without it you get the asking price quoted back and nothing is spent.
Use the COOK / native mint So11111111111111111111111111111111111111112 for COOK. Every tool returns
JSON; failures return { error, hint } — never a stack trace, never your key.
The default setup assumes you are both the operator and the user. A hosted product — a web chat, a Telegram bot, a shared agent — cannot hold users' keys and should not ask for them. For that, cookie-mcp runs without any key and lets the user's own wallet sign:
COOKIE_SIGNER=external COOKIE_MCP_HTTP_TOKEN=<long random secret> \
COOKIE_MCP_ALLOWED_HOSTS=mcp.example.com COOKIE_MCP_CORS_ORIGIN=https://app.example.com \
npx cookie-mcp --http 3000 --host 0.0.0.0
Every request names the wallet it acts for with an x-cookie-wallet: <base58> header (or set
COOKIE_WALLET_ADDRESS for a single-wallet deployment). Reads work as before.
A request may also name the app it comes from with x-cookie-app: <id>; it overrides
COOKIE_APP_ID for that request (see Client identity).
Every money-moving tool runs all of its checks — instruction decoding, spend refusals, the simulation and its balance check — and then, instead of signing, returns a normal (non-error) result:
{
"status": "needs_signature",
"tool": "transfer",
"kind": "transaction",
"what": "transfer",
"signer": "FFWf…4wq2",
"transactionBase64": "AQAAAA…",
"version": "legacy",
"blockhash": "6FdF…TSvT",
"lastValidBlockHeight": 24638662,
"submit": { "via": "cookie-rpc" },
"step": "final",
"summary": { "to": "…", "symbol": "COOK", "amount": "0.001" },
"next": "sign transactionBase64 with wallet … then call submit_signed_tx …"
}
Your app hands transactionBase64 to the browser wallet unchanged (it is already co-signed by
any ephemeral or API-side signers), then calls submit_signed_tx with the signed bytes and the
same submit / blockhash / lastValidBlockHeight / what fields. It sends on the named route
(Cookie RPC, Solana RPC, or Candy Shop) and confirms. It refuses bytes that still lack a signature
and never builds transactions itself.
step: "intermediate" marks a prerequisite (wrapping COOK for a dev buy, creating a Solana token
account before a bridge, CLMM tick-array init). After it confirms, call the same tool again with the
same arguments to continue.
kind: "message" (only deploy_token and reveal_nft_drop, for the launchpad login) asks the
wallet to signMessage the exact text; call the tool again with loginSignature: { message, signature }. In
external mode the session is not cached server-side (the wallet header proves nothing), so every
launch asks for its own login signature.
The NFT tools add bazaarLog. Pass it back to submit_signed_tx and, once the transaction
confirms, it tells Baked Bazaar's indexer about the trade (a local signer does this itself), so the
listing or offer shows up without waiting for the indexer's own scan.
Blockhashes expire in about a minute. If the wallet prompt is slow, submit_signed_tx reports the
timeout with the signature and a "do not retry blindly" hint; re-run the tool for fresh bytes.
The HTTP server is stateless (one fresh server per POST) and answers /healthz. A loopback bind
is not private: any web page open in a browser on the same machine can reach 127.0.0.1. So
every request is checked first. The Host must be one the server answers to (loopback names on a
loopback bind, else COOKIE_MCP_ALLOWED_HOSTS), which defeats DNS rebinding. A request from a
browser (one with an Origin header) must match COOKIE_MCP_CORS_ORIGIN. Unset, that allows any
origin with an external signer, where a page can only get unsigned transactions the user's wallet
still has to approve, and no origin when the server holds a local key. With
COOKIE_MCP_HTTP_TOKEN set, Authorization: Bearer <token> is required. The server refuses to
start with a local COOKIE_PRIVATE_KEY unless both COOKIE_HTTP_ALLOW_LOCAL_KEY=1 and
COOKIE_MCP_HTTP_TOKEN are set, because anyone reaching the port could spend from that key.
As a library. The same flows are importable without MCP:
import {
ExternalSigner,
transfer,
submitSignedTransaction,
runWithRequestContext,
} from "cookie-mcp";
import { createServer } from "cookie-mcp/server"; // embed the MCP server in your own process
Money functions resolve their signer from COOKIE_SIGNER + the request context
(runWithRequestContext({ wallet }, () => transfer({...}))) and throw SignatureRequired with the
same payload the tool returns. Local agents (COOKIE_PRIVATE_KEY, stdio) are unaffected by any of this.
Each domain is also its own entry, so an app that needs one flow does not bundle every venue SDK the
barrel pulls in: cookie-mcp/trade, /transfer, /stake, /bridge, /bridge-routes, /nft,
/domains, /launchpad, /lending, /limit-orders, /dca, /liquidity, /quote, /balances, plus
/signer, /context, /submit and /errors. They share state with the barrel (one request context,
one wallet cache), so mixing them is safe.
import { trade } from "cookie-mcp/trade"; // ~100 KB gzipped, against ~450 KB for the barrel
import { runWithRequestContext } from "cookie-mcp/context";
import { SignatureRequired } from "cookie-mcp/signer";
The library also bundles for edge runtimes (Cloudflare Workers, Vercel Edge). On Workers enable
nodejs_compat (for AsyncLocalStorage, node:net, node:dns) and make sure your variables reach
process.env — configuration is read from it at import time — which is the default from compatibility
date 2025-04-01, or the nodejs_compat_populate_process_env flag before that. deploy_token's
imageUrl fetch goes over node:https, which Workers provide from compatibility date 2025-08-15
(or enable_nodejs_http_modules); on an older date pass imageBase64 instead.
Every request cookie-mcp makes to a venue API or the RPC carries a User-Agent such as
cookie-mcp/0.7.0 (stdio; local; app=cookie-chat/2.1) — the version, the transport (stdio, http
or library when embedded), the signer mode, and the app id if one is set — plus the same string in
X-Cookie-Client (outside a browser, where a custom header would force a CORS preflight). Set
COOKIE_APP_ID (or send x-cookie-app per request over HTTP) to name your app: a token of up to 64
characters from A-Z a-z 0-9 . _ : / @ + -, anything else is dropped. Venue operators can then
attribute traffic to cookie-mcp, to a version, and to your integration. get_wallet shows the exact
string this process sends. This is not telemetry: no extra request is made and no wallet data is
added — only requests that were going out anyway now say who they come from.
Non-custodial: no remote key storage. With a local key it stays in COOKIE_PRIVATE_KEY, signs locally,
and is redacted from all output. In hosted mode the process holds no key at all and the user's wallet
signs. Read-only until a signer is configured; every money-moving action is simulated before it is
sent (or handed out for signing).
yarn install
yarn test # lint + format + typecheck + unit tests + boot smoke
yarn mcp # run the server on stdio from source (tsx)
yarn build # bundle to dist/ (CLI, `cookie-mcp/server` factory, `cookie-mcp` library + subpaths)
To point an agent at a local checkout instead of the published package, set the command to
npx tsx /ABS/PATH/cookie-mcp/src/mcp/server.ts. --http [port] serves Streamable HTTP instead.
A release is an npm publish plus a re-publish of the same version to the
MCP Registry; third-party directories (mcpservers.org
and friends) mirror the registry entry, so the registry step is what actually updates them. Keep npm
latest current with main — the directories scrape GitHub, and a lagging npm gives people a
README that promises tools the installed server does not have.
yarn release <X.Y.Z | patch | minor | major> runs every step below end to end: it bumps, gates,
commits and tags locally, shows the release notes and asks once, then pushes the commit and tag to
main, creates the GitHub release and publishes to npm and the registry. Finished steps are
detected and skipped, so a failed run resumes with the same command. --dry-run runs the
preflight, gate and tarball check without changing anything, and --yes skips the confirmation
before pushing and publishing. It needs one token, MCP_GITHUB_TOKEN: a classic PAT from an owner
of the GitHub org with repo (the GitHub release is created through the REST API with it — the gh
CLI is not used) and read:org (the registry, see step 7). Preflight checks that it can push to the
repo, and refuses to publish without it (a dry run only warns);
read -s MCP_GITHUB_TOKEN && export MCP_GITHUB_TOKEN keeps it out of shell history.
package.json version,
src/version.ts (the version the MCP handshake reports), and server.json both top-level
version and packages[0].version. The registry rejects a mismatch,
and mcpName in package.json must stay io.github.cookiechain/cookie-mcp (the registry checks
the published tarball for it).[Unreleased] heading to
# [X.Y.Z](https://github.com/cookiechain/cookie-mcp/releases/tag/vX.Y.Z) with a dated line
under it, then open a fresh # [Unreleased] above it for the next cycle.yarn test — the same lint / format / typecheck / unit / smoke run as CI. Every new tool
must be listed in EXPECTED_TOOLS in scripts/smoke.ts (the smoke only reports missing names,
so a tool you forgot to add there passes silently) and in the Tools list above.npm pack --dry-run. It must contain only dist/**, README.md,
LICENSE and package.json — no src/, .env, key material or absolute paths.
prepublishOnly runs yarn build (tsup) so dist/ is always rebuilt from the tagged source.Release X.Y.Z, tag vX.Y.Z, git push --tags, and create
the GitHub release from the tag with the CHANGELOG section as its body (the CHANGELOG links point
at that release page).npm publish, then verify with npm view cookie-mcp version and a pinned
boot from a clean directory: npx -y cookie-mcp@X.Y.Z must start and register every tool.
An
E404 … PUT …/cookie-mcp … could not be found or you do not have permissionfromnpm publishis almost never a missing package — npm reports an unauthenticated publish as 404. Runnpm whoami; if it fails,npm loginand publish again.
brew install mcp-publisher, then from the repo root
mcp-publisher login github && mcp-publisher publish. The io.github.cookiechain/* namespace
requires you to be an owner of the GitHub org. If the device-flow login still falls back to
your personal namespace with a 403, the org restricts OAuth apps — log in with a classic PAT
that has read:org instead: MCP_GITHUB_TOKEN=<pat> mcp-publisher login github.This project is licensed under the terms of the MIT license. See the LICENSE file.