DEV Community

MrWizardlyLoaf
MrWizardlyLoaf

Posted on

How to Stop Your Solana AI Trading Agent From Getting Rugged

Autonomous trading agents on Solana have one expensive blind spot: they buy a token the same way they buy any other — except some of those tokens are honeypots you can buy but never sell, or have a live mint authority that dilutes you to dust a block later, or a Token-2022 extension that lets the creator move your balance straight out of your wallet.

A careful human checks the holders, the liquidity, maybe a rug checker. An agent, by default, checks nothing. One bad buy and the wallet is gone.

Here's how to give your agent the same pre-trade reflex a careful human has — as one MCP call before any buy.

The threat, concretely

Three things quietly drain agents on Solana:

  1. Honeypots — you can buy, but there is no sell route. Your position is stuck at zero.
  2. Live mint / freeze authority — the creator can inflate supply (your share to dust) or freeze your tokens in place.
  3. Token-2022 traps — extensions like permanentDelegate (creator can move your tokens), transferHook / pausable (selling can be blocked), nonTransferable.

None of these show up on a price chart. All are readable directly from the token's mint account on-chain — if something reads it before the trade fires.

The fix: a pre-trade screen as an MCP tool

RugCheck AI is a remote MCP server that reads the mint directly (getAccountInfo) and returns a SAFE / CAUTION / DANGER verdict plus the specific risks — in one call, before your agent spends a cent. No install, no API key; you point your agent at the endpoint.

See it on real tokens

I scanned three real mainnet tokens (2026-06-17 — re-run to verify, live state changes):

Token scan_token verdict Why
BONK SAFE / 100 authority renounced, liquid, sellable
USDC CAUTION / 70 issuer keeps an active mint and freeze authority
a fresh pump token DANGER / 20 no sell route (honeypot), 100% held by one wallet, $0 liquidity

The third one is the trap: an agent that bought it could never sell. RugCheck AI flags it before the buy — even though the token is too new to be indexed anywhere else. And notice USDC comes back CAUTION, not SAFE, because the issuer can still freeze your balance. The verdict tells you the truth, not a marketing label.

Wire it into your agent

Cline / Claude Dev (VS Code) — in cline_mcp_settings.json, add an mcpServers entry named rugcheck-ai with the url field set to the endpoint below.

Claude Desktop — in claude_desktop_config.json, add an mcpServers entry that runs npx -y mcp-remote <endpoint>.

Cursor — Settings, MCP, Add, Streamable HTTP, then paste the endpoint.

Endpoint:

https://web-production-58d585.up.railway.app/mcp
Enter fullscreen mode Exit fullscreen mode

Then give your agent one rule: before any buy, call scan_token(mint) and refuse on DANGER.

scan_token("<mint>") -> { verdict, safety_score, sellable, risks: [...] }
Enter fullscreen mode Exit fullscreen mode

SAFE -> proceed. CAUTION -> read the risks and size down. DANGER -> skip it.

More than one check

scan_token is the one-call verdict, but the server exposes 15 tools so an agent can drill in:

  • is_safe(mint) — a single boolean gate
  • simulate_sell(mint) — dedicated honeypot check (is there a live sell route?)
  • simulate_trade(mint, usd) — full round-trip: buy then sell back, see the real exit cost
  • holders_breakdown(mint) — top-holder concentration (dump risk)
  • check_authorities(mint) — mint/freeze authority + Token-2022 traps
  • scammer_dna(mint) — how much the token's structure looks like a deliberate scam
  • and execute_safe_swap(mint, wallet, usd), which re-screens and hands back an unsigned Jupiter swap for the agent to sign (it refuses anything that scans DANGER).

Why read the chain directly

Most "is this token safe" answers come from an indexer that hasn't seen a token minted 40 seconds ago — exactly when snipers buy. RugCheck AI calls getAccountInfo on the mint itself, so you get a real verdict on a fresh launch instead of unknown. The screening tools are read-only; the server never holds your keys.

Repo + full tool list: github.com/MrWizardlyLoaf/rugcheck-ai. Listed on the official MCP Registry as io.github.MrWizardlyLoaf/rugcheck-ai.

Screen before you buy. Your agent will thank you the first time it skips a honeypot.

Top comments (0)