Skip to main content
Glama
AegisQuant

AegisQuant

by FameDied

aegis-swap-mcp — Safe Token Checks & Smarter Swap Routing for AI Agents

Check crypto tokens for scams, split large swaps across pools to get better prices, and protect trades from front-running—without ever handing over your wallet keys.

npm version npm downloads license honeypots blocked x402 Base USDC

Install in Cursor Install in VS Code

claude mcp add aegisquant -- npx -y aegis-swap-mcp

Agent Auto-Setup Prompt: Paste into Claude Code, Antigravity, Cursor, Hermes, OpenClaw, Codex, or Windsurf: Fetch and follow https://aegisquant-mcp.famedied.workers.dev/install.md to configure AegisQuant (aegis-swap-mcp). Start with the free tier.

AegisQuant Live Demo

When you ask an AI assistant to evaluate or prepare an on-chain trade on Base, Ethereum, Arbitrum, Polygon, Optimism, or Solana, aegis-swap-mcp screens the token for honeypots and hidden sell taxes, calculates how to split the order across pools with minimal slippage, and builds an unsigned transaction that a 252-line local firewall verifies on your machine before any wallet signs. You get 5 free token safety checks per day, and optional paid tools cost $0.005–$0.030 per call in Base USDC via x402.


Zero Trust Required: Audit These 252 Lines + Local Calldata Firewall

You do not have to trust the remote edge server with your private keys or blind transaction calldata:

  1. Private keys never leave your machine. Your micro-payer key (X402_PRIVATE_KEY or ~/.aegis-swap-mcp/wallet.json) stays strictly local and signs EIP-3009 Base USDC micro-invoices ($0.005–$0.030) via viem.

  2. Hard Local Spend Guardrails (src/cli.ts):

    • X402_MAX_PRICE_USD (default 0.05) blocks any single invoice above your cap before signing.

    • X402_DAILY_BUDGET_USD (default 5.00, persisted in ~/.aegis-swap-mcp/budget.json) enforces a hard daily USDC ceiling.

  3. Deterministic Local Calldata Firewall (src/firewall.ts): Before any build_verified_swap payload reaches your LLM or wallet, aegis-swap-mcp verifies locally:

    • tx.to matches the immutable hardcoded router allowlist per chain (CoW Protocol GPv2Settlement, KyberSwap MetaAggregationRouterV2, Uniswap UniversalRouter).

    • tx.data does not start with dangerous approval or transfer selectors (0x095ea7b3 approve, 0xa22cb465 setApprovalForAll, 0x23b872dd transferFrom).

    • The SHA-256 verification envelope (crypto.subtle.digest) matches chainId, to, data, value, minAmountOut, and recipient verbatim.

    • If any check fails, calldata is redacted and FIREWALL_BLOCKED is returned immediately.

Audit the entire runtime yourself in 2 minutes: src/cli.ts (119 lines) + src/firewall.ts (133 lines) = 252 lines total (wc -l src/cli.ts src/firewall.ts).


Related MCP server: crypto-knowledge

Optional: 10-Second Micro-Payer Wallet Setup (init-wallet)

The free tier (scan_alpha_safety, 5 calls/day/IP) works out of the box with zero wallet setup. To unlock paid routing, calldata construction, and arbitrage scans without ever exposing your main wallet:

npx aegis-swap-mcp init-wallet

This creates a fresh Base EOA strictly on your local disk at ~/.aegis-swap-mcp/wallet.json (chmod 0600), prints a terminal ASCII QR code to fund it with $2–$5 Base USDC, and aegis-swap-mcp auto-loads it automatically under X402_MAX_PRICE_USD=0.05 and X402_DAILY_BUDGET_USD=5.00 caps.


Measured On-Chain Proof (Not Synthetic Estimates)

Measured live across 18 real Base & Solana contracts (GoPlus + Honeypot.is + RugCheck + DexScreener) and live Base pool reserves — full data and reproducible script in benchmarks/LIVE_PROOF.md:

  • Live Honeypot & Trap Detection: Caught Basecat (0xB200...1D01, $336,776 liquidity) with 100% sell tax (CRITICAL_AVOID, 99.0% rug prob) and PEPE (0x52b4...777D, $279,596 liquidity) with BLACKLIST_OR_PAUSE_TRAP (99.0% rug prob), while clearing AERO, WETH, cbBTC, DEGEN, JUP, BONK, and $WIF.

  • Live KKT Split Routing + MEV Sandwich Savings ($0.035 total x402 fee for compute + build):

Live Base Pair

Trade Size

KKT Split + Tranching Gain

Naive 1% Sandwich Loss Avoided

Safe Slippage & Venue

Total Value Saved

Net ROI vs $0.035

AERO (6 live pools)

$1,000

+3.08 bps

$0.00

500 bps (KYBER_AGGREGATOR)

$0.31

7.9x

AERO (6 live pools)

$5,000

+23.76 bps

$50.00

1 bps (COW_MEV_PROTECTED)

$61.88

1,767x

AERO (6 live pools)

$25,000

+141.03 bps

$250.00

1 bps (COW_MEV_PROTECTED)

$602.58

17,215.6x

DEGEN (6 live pools)

$1,000

+50.53 bps

$10.00

1 bps (COW_MEV_PROTECTED)

$15.05

429x

DEGEN (6 live pools)

$5,000

+269.85 bps

$50.00

1 bps (COW_MEV_PROTECTED)

$184.93

5,282.7x

DEGEN (6 live pools)

$25,000

+1350.71 bps

$250.00

1 bps (COW_MEV_PROTECTED)

$3,626.78

103,621.3x


Setup Across Every Major AI Harness

1. One-Command CLI & Plugin Harnesses

Claude Code (MCP or Native Plugin)

# MCP (free tier, no wallet required)
claude mcp add aegisquant -- npx -y aegis-swap-mcp

# Or install as a Claude Code Plugin (includes /check-token, /safe-swap, /find-arb + skill)
/plugin marketplace add FameDied/aegis-swap-mcp
/plugin install aegisquant

Hermes Agent

# Free tier (note: --args must be the last option)
hermes mcp add aegisquant --command npx --args -y aegis-swap-mcp

# With Base USDC x402 auto-pay (or omit X402_PRIVATE_KEY after running init-wallet)
hermes mcp add aegisquant \
  --command npx \
  --env X402_PRIVATE_KEY=0xYOUR_BASE_USDC_MICRO_PAYER_KEY \
  --env X402_MAX_PRICE_USD=0.05 \
  --env X402_DAILY_BUDGET_USD=5.00 \
  --args -y aegis-swap-mcp

OpenClaw

openclaw mcp add aegisquant --command npx --arg -y --arg aegis-swap-mcp

OpenAI Codex CLI

codex mcp add aegisquant -- npx -y aegis-swap-mcp

OpenCode (~/.config/opencode/opencode.json)

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "aegisquant": {
      "type": "local",
      "command": ["npx", "-y", "aegis-swap-mcp"],
      "enabled": true
    }
  }
}

Goose (Block) (~/.config/goose/config.yaml)

extensions:
  aegisquant:
    name: AegisQuant MCP
    type: stdio
    cmd: npx
    args:
      - "-y"
      - "aegis-swap-mcp"
    enabled: true

2. JSON Config Harnesses (mcpServers)

Paste into your harness's MCP config file (add "env": { "X402_PRIVATE_KEY": "0x..." } or run npx aegis-swap-mcp init-wallet for paid tools):

{
  "mcpServers": {
    "aegisquant": {
      "command": "npx",
      "args": ["-y", "aegis-swap-mcp"]
    }
  }
}

Harness

Config File Location

Antigravity

~/.gemini/config/mcp_config.json (optionally copy SKILL.md to ~/.gemini/config/skills/aegisquant-defi-execution/SKILL.md)

Cursor

.cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) · %APPDATA%\Claude\claude_desktop_config.json (Windows)

Windsurf

~/.codeium/windsurf/mcp_config.json or ~/Library/Application Support/Windsurf/mcp.json (macOS)

Gemini CLI

~/.gemini/settings.json (global) or .gemini/settings.json (project)

GitHub Copilot CLI

~/.copilot/mcp-config.json (global) or .mcp.json (repo root)

Cline / Roo Code

cline_mcp_settings.json (via MCP Servers → Configure)


3. Editor & TOML/YAML Config Harnesses

VS Code / GitHub Copilot Chat (.vscode/mcp.json)

{
  "servers": {
    "aegisquant": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "aegis-swap-mcp"]
    }
  }
}

Zed (settings.json)

{
  "context_servers": {
    "aegisquant": {
      "command": "npx",
      "args": ["-y", "aegis-swap-mcp"]
    }
  }
}

Codex TOML (~/.codex/config.toml)

[mcp_servers.aegisquant]
command = "npx"
args = ["-y", "aegis-swap-mcp"]

[mcp_servers.aegisquant.env]
X402_MAX_PRICE_USD = "0.05"
X402_DAILY_BUDGET_USD = "5.00"

Hermes Agent YAML (~/.hermes/config.yaml)

mcp_servers:
  aegisquant:
    command: "npx"
    args:
      - "-y"
      - "aegis-swap-mcp"
    env:
      X402_MAX_PRICE_USD: "0.05"
      X402_DAILY_BUDGET_USD: "5.00"

4. Direct Remote Streamable HTTP & Raw x402 REST

  • MCP Streamable HTTP: https://aegisquant-mcp.famedied.workers.dev/mcp (note: the Local Calldata Firewall runs only in the local npx -y aegis-swap-mcp stdio bridge)

  • Raw x402 REST: POST https://aegisquant-mcp.famedied.workers.dev/api/v1/{tool} (paid routes return HTTP 402 Payment Required with Base64 PAYMENT-REQUIRED header + extensions.bazaar schema; /api/v1/scan_alpha_safety_pro always returns 402 for Bazaar discovery).


Tools

Tool

Price (Base USDC)

Purpose

scan_alpha_safety

FREE (5/day/IP), then $0.005

Multi-source Bayesian rug probability, HHI holder concentration, honeypot/tax override, 0.25x Fractional Kelly sizing, and live execution_preview

compute_optimal_execution

$0.015

$O(N \log N)$ KKT water-filling split solver, Almgren-Chriss tranching, constant-product MEV bound

build_verified_swap

$0.020

Strictly unsigned calldata / CoW intent + SHA-256 envelope verified by Local Calldata Firewall

audit_execution_shortfall

$0.008

On-chain RPC receipt audit, implementation shortfall decomposition, persistent D1 EWMA update

find_arb_and_yield_spreads

$0.025

Closed-form cross-pool constant-product arb optimizer (strictly net-positive after gas & tax)

batch_portfolio_shield

$0.030

Parallel safety & LP-drain audit across up to 10 tokens

Available Tools

6 tools
audit_execution_shortfallAudit Execution ShortfallBInspect

Audits an executed transaction via public RPC, decomposes implementation shortfall (delay, impact, MEV leakage, fee drag), and updates persistent EWMA telemetry.

Inputs: chain (required), tx_hash (required), pool_address (required), quoted_price (required), +6 more.

batch_portfolio_shieldBatch Portfolio ShieldBInspect

Parallel Bayesian safety, LP-drain, and holder-concentration audit across up to 10 tokens in a single x402 call.

Inputs: chain (required), token_addresses (required), portfolio_bankroll_usd.

build_verified_swapBuild Verified SwapAInspect

Builds strictly unsigned swap calldata (KyberSwap/CoW Protocol) bounded by MEV-safe slippage and a SHA-256 verification envelope for local firewall validation.

Inputs: chain (required), token_in (required), amount_in (required), token_out (required), +6 more.

compute_optimal_executionCompute Optimal ExecutionCInspect

KKT water-filling multi-pool split solver, Almgren-Chriss volatility-adjusted tranching, and MEV sandwich profitability bound with optimal slippage ceiling.

Inputs: chain (required), token_in (required), amount_in (required), token_out (required), +3 more.

find_arb_and_yield_spreadsFind Arbitrage & Yield SpreadsCInspect

Closed-form cross-pool constant-product arbitrage optimizer returning strictly net-positive spreads after gas, tax, and price impact.

Inputs: chain (required), token_address (required), custom_gas_usd.

scan_alpha_safetyScan Alpha SafetyBInspect

Multi-source Bayesian rug-probability scan, HHI concentration, honeypot/tax trap check, and 0.25x Fractional Kelly max position sizing (first 5 calls/day per IP free).

Inputs: chain (required), token_address (required), portfolio_bankroll_usd.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool maps to a distinct stage of the trade lifecycle (pre-trade safety scan, execution planning, calldata build, post-trade audit, spread discovery, batch audit), so an agent can mostly infer intent from the name. The one real overlap is scan_alpha_safety vs batch_portfolio_shield, which run the same Bayesian/honeypot checks and differ only in single-vs-batch scope; compute_optimal_execution vs build_verified_swap are also adjacent (planning vs calldata) but the descriptions separate them adequately.

    Naming Consistency5/5

    All six tools follow a strict snake_case verb_noun pattern (scan_, compute_, build_, audit_, find_, batch_). No camelCase mixing or vague noun-only names, and the naming style stays uniform despite differing domains within the tool.

    Tool Count5/5

    Six tools is well within the ideal 3-15 range and each corresponds to a distinct step in the quant trading workflow, so nothing looks padded. The surface is compact and purpose-built for a specialized DeFi execution server.

    Completeness4/5

    The pipeline covers the core path: safety scan, execution optimization, calldata construction, shortfall auditing, and arbitrage/yield discovery, including a batch variant for portfolio-scale work. Minor gaps remain: there is no tool to read back the persistent EWMA telemetry that audit_execution_shortfall writes, and no position/LP state or telemetry query tool, leaving a mild dead end for follow-up analysis.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to perform complex crypto operations like cross-chain routing, contract decoding, portfolio management, and anti-rug security checks, returning unsigned transactions for safe signing by the agent.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to query multichain balances, inspect smart contracts, and draft DeFi interactions while enforcing anti-drainer protections such as approval blocking, destination whitelisting, spend caps, and human approval gates.
      5
      Business Source 1.1