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.
Contents
- What it can do
- Install — Claude Code · Claude Desktop · Cursor
- Enable trading (add a key)
- Try it
- Configuration
- Tools
- Hosted / wallet-signed mode — for web apps and other integrators
- Client identity · Safety
- Development — Release
What it can do
- Read the market — chain health, pools, token info, token search, swap quotes, and wallet
balances. No key needed.
- Swap any Cookie Chain token pair through either aggregator — the
Cookiebox Swap API or Candy Shop —
both routing across all Cookie Chain DEX liquidity. Agents pick per call with the
aggregator
parameter and can quote both to compare. chain: "solana" buys/sells the bridged COOK on Solana
mainnet via Jupiter instead.
- Transfer COOK or any SPL / Token-2022 token.
- Rest limit and stop orders in the Cookiebox limit-order escrow — take-profit at a price or
better, or a stop-loss that sells at market once the rate falls to a trigger — filled by a keeper
across every routable Cookie Chain market.
- Launch tokens on the MomoSwap launchpad — create a token on a COOK
bonding curve (standard, or a paired launch whose holder tax is paid out to holders), buy / sell the
curve, claim after graduation, and sweep your creator fees.
- Launch and mint NFT collections on the MomoSwap NFT launchpad —
launch a fixed-supply drop from a folder of images, mint items off its COOK bonding curve, sell them
back while it is live, redeem the floor after graduation, and claim a creator's proceeds.
- Manage liquidity — create pools, add / remove liquidity, claim fees, and permanently lock
positions across Cookiebox DAMM v2, Cookiebox CLMM, and CookieSwap BAMM (venue auto-detected).
- Liquid-stake COOK for bCOOK and redeem it instantly.
- Lend and borrow on Aera — supply COOK to earn interest, or lock bCOOK as
collateral and borrow COOK against it, with health-factor guards before anything is signed.
- Trade NFTs on Baked Bazaar — search, browse, buy, list, and make /
accept offers (Cookie Chain's Metaplex Auction House marketplace).
- Bridge COOK, SOL — and any token added to the bridge later — 1:1 between Cookie Chain and
Solana mainnet over Hyperlane.
- Roll dice at Dice Club — provably fair on-chain dice for
Cookie Chads holders; every roll is re-derived from the revealed seed before it is reported.
- Own a name — register, transfer, and resolve
.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.
Install
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.
Claude Code
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
Claude Desktop
Edit the config file (create it if missing), then restart Claude Desktop:
- macOS —
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows —
%APPDATA%\Claude\claude_desktop_config.json
Add the server block below under mcpServers.
Cursor
Edit ~/.cursor/mcp.json (applies everywhere) or .cursor/mcp.json in a project (project wins if
both exist), then add the server block.
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": ""
}
}
}
}
Enable trading (add a 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.
Try it
Once it's registered, just talk to your agent naturally:
- "What's the health of Cookie Chain right now?" →
chain_health
- "Find the cookhouse token and show me its price and liquidity." →
search_tokens → get_token_info
- "Quote swapping 10 COOK for bCOOK." →
get_quote
- "Swap 10 COOK for bCOOK." →
get_quote → trade (needs a key; simulated first)
- Token-2022 transfer-hook tokens (issuer code runs on every transfer and can reject it):
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.
- "What COOKHOUSE NFTs are listed, and buy the cheapest under 50 COOK." →
search_nfts → buy_nft
- "Which wallet are you about to trade from?" →
get_wallet
The 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.
Configuration
| 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. |
Tools
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.