Skip to main content
Glama
coingecko-longtail-agent MCP Server

coingecko-longtail-agent MCP Server

by xgbtxy

Solana Long-Tail Alpha & Risk Sentinel

Data by CoinGecko API - Superteam x CoinGecko "Long Tail" Hackathon, AI Agents track.

Screenshots (Live Agent Terminal UI)

Solana Long-Tail Pool Scan CRITICAL Risk & Exit-Liquidity Analysis

An autonomous agent that discovers emerging Solana pools via CoinGecko Onchain (GeckoTerminal) API, scores them with a deterministic risk + wash-trade anomaly model, cross-checks the SPL mint on Solana JSON-RPC (mint/freeze authority, holder concentration), and produces a JSON + Markdown due-diligence dossier. Exposed as CLI, HTTP API and MCP server (/mcp), with a Solana USDC x402 paywall on the premium dossier.

Related MCP server: TailGuard MCP Server

How Coingecko API is used

  • Discovery & Market Telemetry (src/coingecko.ts): Queries CoinGecko Onchain endpoints (/networks/solana/new_pools, /networks/solana/trending_pools, /networks/solana/tokens/{mint}/pools, and /search/pools?network=solana) to retrieve real-time token price, FDV, market cap, liquidity depth (reserve_in_usd), 24h volume, buyer/seller counts, and 1h/24h price deltas.

  • Plan & Key Support: Supports both Demo (x-cg-demo-api-key) and Pro (x-cg-pro-api-key) plans via COINGECKO_API_KEY + COINGECKO_PLAN env vars, with graceful keyless fallback and deterministic offline fixtures (--offline / ?demo=1) for zero-key testing.

  • Attribution: Every UI header/footer, Markdown dossier, JSON API response, and MCP tool output prominently displays Data by CoinGecko API.

How Solana is used

  • SPL Mint & Holder Inspection (src/solana.ts): Calls Solana JSON-RPC (getAccountInfo with jsonParsed + getTokenLargestAccounts) to verify token existence, decimals, supply, active mintAuthority / freezeAuthority rug risks, and top-1 / top-10 holder concentration.

  • Jupiter Exit-Liquidity Simulation (src/jupiter.ts): Queries read-only Jupiter swap quotes against Solana USDC (EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v) for $500 and $2,500 simulated exits to flag paper liquidity vs. real exit slippage (EXIT_SLIPPAGE / NO_EXIT_ROUTE).

  • Verifiable Solana Memo v2 Attestation (src/memo.ts): Hashes each audit decision (SHA-256) into an unsigned Solana Memo Program v2 (MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr) instruction payload so any wallet can anchor the audit trail on-chain without the agent holding private keys.

  • Solana USDC x402 Paywall (src/x402.ts): Gates /premium/analyze behind an HTTP 402 challenge accepting native Solana USDC (network: "solana").

Hackathon track mapping

Requirement

Where

Solana-native

SPL mint validation + authority/holder checks (src/solana.ts), solana network pools, USDC-on-Solana x402 (src/x402.ts)

CoinGecko API

Onchain endpoints: new_pools, trending_pools, tokens/{mint}/pools, search/pools (src/coingecko.ts); demo/pro key via COINGECKO_API_KEY

AI agent

Autonomous discover -> score -> verify -> report pipeline (src/agent.ts), MCP tools for other agents

Attribution

"Data by CoinGecko API" in every JSON, Markdown, CLI and MCP output

Architecture

flowchart LR
  CG[CoinGecko Onchain API] --> D[Discover: new/trending/search pools]
  D --> R[Risk + Anomaly scoring]
  RPC[Solana JSON-RPC] --> V[SPL mint verify: authorities, top holders]
  V --> R
  R --> DOS[Dossier JSON + Markdown]
  DOS --> CLI[CLI]
  DOS --> HTTP["HTTP /analyze (free)"]
  DOS --> PAY["/premium/analyze (x402 Solana USDC)"]
  DOS --> MCP["MCP /mcp"]

Scoring (deterministic, pure function in src/risk.ts)

Liquidity depth, liquidity/FDV, volume/liquidity turnover (wash), trades-per-unique-trader (bots), buy/sell imbalance, parabolic moves, pool age, mint & freeze authority, top-1/top-10 holder share. Output: score 0-100, level LOW/MEDIUM/HIGH/CRITICAL, anomalyScore, and itemized flags.

Setup

npm install
cp .env.example .env     # optional: COINGECKO_API_KEY, SOLANA_RPC_URL, X402_*
npm test && npm run typecheck
npm run demo             # offline deterministic dossier

Offline fixture mode (--offline) uses built-in mocks for CoinGecko + Solana RPC; fixture mints are printed by running npx tsx src/cli.ts.

CLI

npx tsx src/cli.ts analyze <mint|query> [--premium] [--json] [--offline]
npx tsx src/cli.ts scan [limit] [--json]
npx tsx src/cli.ts serve [--offline]        # HTTP + MCP on $PORT (8787)

HTTP

  • GET /analyze?q=<mint|query> - free summary

  • GET /scan?limit=10

  • GET /premium/analyze?q=<mint> - returns 402 with Solana USDC requirements (accepts[0].network = "solana"); pass X-PAYMENT verified through X402_FACILITATOR_URL. X402_DEV_MODE=1 accepts dev-paid for local demos only.

  • POST /mcp - JSON-RPC: initialize, tools/list, tools/call (analyze_token, scan_longtail)

Security

No keys in repo. .env is git-ignored; only a public receiving address is configured (X402_PAY_TO). Heuristics only - not financial advice.

Live smoke test

LIVE=1 npx vitest run test/live.smoke.test.ts

Built Dec 2026 for the Superteam x CoinGecko Long Tail Hackathon (AI Agents track).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to run read-only Solana token rug and scam risk checks, producing a 0–100 score with plain-English red flags from on-chain, RugCheck, Jupiter, and DexScreener data, plus wallet and URL scans and token monitoring. It supports a hosted Streamable HTTP endpoint and a stdio bridge, with free usage limits and an agent-purchasable Pro tier.
      9
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to scan Solana long-tail pools, audit SPL/Token-2022 mint authorities, evaluate pre-trade swap guard verdicts, and run deterministic rug drills through four stdio tools grounded in CoinGecko on-chain data and live Solana RPC state.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-compatible agents to run grounded Solana long-tail token due-diligence, pre-trade swap safety gating against CoinGecko benchmarks, autonomous pool screening, and wallet/treasury policy checks using live CoinGecko data and Solana Mainnet RPC verification. Exposes four tools (token audit, swap guard, pool scout, wallet treasury) with citation trails and ALLOW/WARN/BLOCK verdicts.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents and Blink clients to run Solana token due-diligence with traceable evidence, gate swaps by comparing live Jupiter quotes against CoinGecko benchmarks, scout DEX pools 24/7, analyze price catalysts, and audit wallet risk. Every price, liquidity, and onchain authority figure is tied to a provenance ledger entry or Solana RPC response.
      MIT