Skip to main content
Glama

RugShield 402 🛡️ — Open-Source MCP Server for DEX Security & Honeypot Detection

License: MIT MCP Standard TypeScript Base Mainnet x402 Protocol

This repository contains the complete open-source Model Context Protocol (MCP) server implementation of RugShield 402. It equips LLMs, autonomous trading agents, and IDEs (Claude Desktop, Cursor, Windsurf) with tools to simulate token buys/sells, analyze honeypot traps, calculate exact transfer tax rates, and verify DEX liquidity depth on Base and EVM networks.


🛠️ MCP Tools Implemented

This MCP server provides the following tools via standard stdio and streamable HTTP transports:

Tool Name

Description

Key Parameters

rugshield_pre_swap_scan

Comprehensive pre-trade swap simulation: detects honeypots, malicious transfer limits, and liquidity drain traps.

token_address (string, 42-char hex), simulate_sell (boolean, default: true)

check_honeypot

Decompiles token bytecode and executes buy/sell test against Base RPC. Returns exact buy/sell tax in basis points (bps), blacklist checks, and risk score.

token_address (string, 42-char hex)

verify_liquidity_lock

Analyzes DEX pool reserves (Uniswap v3, Aerodrome), LP token lock status, bonding curve state, and total USD liquidity depth.

token_address (string, 42-char hex)

detect_holder_clusters

Maps top token holder distributions, detects Sybil wallet clusters, and computes developer concentration risk.

token_address (string, 42-char hex)


Related MCP server: BlueAgent x402 Services

🚀 Running from Source (Local Stdio Transport)

You can run this MCP server locally on your machine from source code using Node.js and the Model Context Protocol SDK.

1. Installation & Build

# Clone the open-source repository
git clone https://github.com/ak10082247-max/rugshield-402.git
cd rugshield-402

# Install dependencies
npm install

# Build the TypeScript source code
npm run build

2. Configure with Claude Desktop

Add this server to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "rugshield-402": {
      "command": "node",
      "args": [
        "/absolute/path/to/rugshield-402/dist/mcp/server.js"
      ]
    }
  }
}

Or run directly with tsx during development without building:

{
  "mcpServers": {
    "rugshield-402": {
      "command": "npx",
      "args": [
        "-y",
        "tsx",
        "/absolute/path/to/rugshield-402/src/mcp/server.ts"
      ]
    }
  }
}

3. Configure with Cursor or Windsurf

Add to your workspace .cursor/mcp.json or Windsurf MCP settings:

{
  "mcpServers": {
    "rugshield-402": {
      "command": "node",
      "args": ["dist/mcp/server.js"]
    }
  }
}

🌐 Connecting to the Hosted Remote MCP Endpoint

If you prefer connecting to a hosted cloud instance without local dependencies, RugShield is deployed 24/7 on high-availability cloud infrastructure:

  • Remote MCP URL: https://rugshield-402.onrender.com/mcp

  • Protocol: Model Context Protocol (Streamable HTTP / SSE JSON-RPC 2.0)

  • Discovery Manifest: https://rugshield-402.onrender.com/.well-known/mcp/server-card.json

  • x402 Manifest: https://rugshield-402.onrender.com/.well-known/x402.json


🏛️ Simulation Engine Architecture

sequenceDiagram
    autonumber
    actor LLM as Claude / Agent / Cursor
    participant MCP as RugShield MCP Server (Local / Remote)
    participant Simulator as EVM Bytecode Simulator
    participant Base as Base Mainnet RPC
    participant DEX as Aerodrome / Uniswap v3

    LLM->>MCP: tools/call ("rugshield_pre_swap_scan", { token_address })
    MCP->>Simulator: Fork State & Simulate Buy/Sell
    Simulator->>Base: Fetch Bytecode, Balances & Storage Slots
    Simulator->>DEX: Simulate Swap on Liquidity Pool
    Simulator-->>MCP: Honeypot Verdict, Tax Rates, Risk Score
    MCP-->>LLM: Structured JSON Analysis & Safety Attestation

📦 Developer SDK & Framework Integrations

RugShield is packaged for automated multi-agent frameworks with 100% gasless autonomous payment settlement ($0 ETH / $0 SOL required):

1. Autonomous Agent Auto-Pay Quickstart (TypeScript)

Wrap standard fetch with @x402/fetch to automatically handle HTTP 402 challenges, sign EIP-712 transfer authorizations on Base, and retry in under 15ms:

npm install @x402/fetch @x402/core @x402/evm viem
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:8453", new ExactEvmScheme(account));

// 1-line wrapper automatically signs & unlocks full 100% honeypot simulation
const xFetch = wrapFetchWithPayment(fetch, client);
const res = await xFetch("https://rugshield-402.onrender.com/v1/scan", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ token_address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", simulate_sell: true }),
});
const report = await res.json();
console.log("Full Verified Analysis:", report);

2. Autonomous Agent Auto-Pay Quickstart (Python)

Using the built-in Python client (sdk/python/rugshield.py):

from rugshield import RugShieldClient

# Pass your agent wallet private key - automatically handles 402 challenges & EIP-712 signing
client = RugShieldClient(private_key="0xYOUR_AGENT_PRIVATE_KEY")
report = client.scan_token("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")

print(f"Honeypot: {report.get('is_honeypot')}")
print(f"Exact Sell Tax: {report.get('sell_tax_bps')} bps")

3. ElizaOS Autonomous Agent Plugin

npm install @kurox_real/plugin-rugshield-402
import { rugshieldPlugin } from "@kurox_real/plugin-rugshield-402";

export const character = {
  name: "AutonomousDeFiTrader",
  plugins: [rugshieldPlugin],
};

4. Coinbase AgentKit (LangChain / Python / TS)

npm install @kurox_real/agentkit-rugshield-402
import { rugshieldActionProvider } from "@kurox_real/agentkit-rugshield-402";
import { AgentKit } from "@coinbase/agentkit";

const agentKit = await AgentKit.from({
  actionProviders: [rugshieldActionProvider()],
});

5. Direct REST API (cURL)

# Returns 402 with structured 50% free preview + unlock instructions:
curl -X POST https://rugshield-402.onrender.com/v1/scan \
  -H "Content-Type: application/json" \
  -d '{"token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "simulate_sell": true}'

💳 Optional Cloud Subscriptions (MCPize / Apify)

For teams seeking turnkey managed infrastructure with flat monthly credit card billing rather than self-hosting:


📄 License

This open-source project is licensed under the MIT License — see the LICENSE file for details.

Available Tools

3 tools
analyze_liquidityAInspect

LIQUIDITY & POOL DEPTH ANALYZER: Queries verifiable USD liquidity across Aerodrome Finance, Uniswap v3/v2, and active launchpad bonding curves (Clanker / Virtuals) on Base Mainnet. Prevents catastrophic trade slippage. Cost: 0.005 USDC on Base.

ParametersJSON Schema
NameRequiredDescriptionDefault
token_addressYesThe ERC-20 token address on Base (0x...) to analyze liquidity depth for

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It usefully discloses the cost (0.005 USDC on Base) and the chain/venue scope, which is real value beyond the schema. However, it omits the read-only nature, latency, and error/failure behavior for an out-of-scope or non-Base token.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three compact sentences, all front-loaded with the resource, the venue scope, and the cost. Nothing is padded or repeated from the schema, and each sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a single, fully documented parameter and cost disclosed, the core invocation need is met. But with no output schema and no annotations, the description leaves the agent guessing at the return shape (depth figures, per-venue breakdown, status) and at whether it is read-only.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and there is only one parameter, so the schema already documents token_address fully (ERC-20 on Base, 0x..., 42 chars). The description adds no syntax or format detail beyond the schema, matching the baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (queries) and resource (verifiable USD liquidity) and enumerates the exact venues covered (Aerodrome, Uniswap v3/v2, Clanker/Virtuals bonding curves) on Base Mainnet. An agent can readily distinguish this from rugshield_pre_swap_scan and check_honeypot.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The line 'Prevents catastrophic trade slippage' implies a pre-trade context but never states explicitly when to call this versus the sibling tools (rugshield_pre_swap_scan, check_honeypot), nor does it name any alternative. Usage is implied rather than declared.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

check_honeypotAInspect

HONEYPOT & TAX SIMULATOR: Decompiles bytecode and simulates buy/sell execution against Base Mainnet RPC to verify if a token can be sold. Returns exact buy/sell taxes in bps and flags blacklist restrictions. Cost: 0.005 USDC on Base.

ParametersJSON Schema
NameRequiredDescriptionDefault
token_addressYesThe ERC-20 token address on Base (0x...) to verify for honeypot risks

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it discloses the execution method (RPC simulation on Base Mainnet), the return content (buy/sell taxes in bps, blacklist flags), and an unusual operational constraint (0.005 USDC cost on Base). It stops short of describing failure modes, latency, or what happens if the simulation times out.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Effectively two sentences plus a cap-style label; every clause carries information (method, output, cost) and the core purpose is front-loaded. Slightly dense in the second sentence but no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-input onchain simulation tool with no annotations and no output schema, the description covers method, results, and cost adequately. It omits failure behavior and any RPC-dependency caveats, which keeps it from being fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

One parameter with 100% schema description coverage, so the schema already explains token_address fully. The description adds no format, validation, or address-type detail beyond what the schema provides, which is the baseline case for a fully documented single parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific resource (ERC-20 token on Base) and the exact mechanism (decompiles bytecode and simulates buy/sell execution against Base Mainnet RPC) to answer a concrete question: can the token be sold. The purpose is unmistakable and materially distinct from a liquidity analyzer or a generic pre-swap scan.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: an agent can infer this is a pre-trade safety check, but the description never says when to prefer it over rugshield_pre_swap_scan or analyze_liquidity, nor does it state prerequisites or exclusions. The cost line hints at a gating consideration but does not route the agent between siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rugshield_pre_swap_scanAInspect

MANDATORY: Call this tool before executing any DEX swap on Base. Simulates buys/sells to detect honeypots, malicious taxes, and liquidity drains. Cost: 0.005 USDC on Base.

ParametersJSON Schema
NameRequiredDescriptionDefault
simulate_sellNoWhether to simulate immediate sell order to test for honeypot traps
token_addressYesThe ERC-20 token address on Base (0x...) to analyze

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full disclosure burden. It usefully adds the cost (0.005 USDC on Base) and the mechanism (simulating buys/sells), but omits permissions/wallet requirements, latency, and crucially what the result looks like (boolean, risk score, detailed report) for a pre-trade decision tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight, front-loaded sentences with the mandatory trigger leading, followed by behavior and cost — every element earns its place. Minor redundancy ('on Base' repeated) and the all-caps 'MANDATORY' keep it from a clean 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with no annotations and no output schema, the description should ideally explain what the scan returns so an agent can act on it. It covers when, what, and cost, but the interpretation of results (pass/fail, risk score, findings) is entirely absent — a meaningful gap for a gating pre-trade check.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both token_address and simulate_sell are already documented in the schema; baseline 3 applies. The description only loosely gestures at simulate_sell via 'simulates buys/sells' and adds no format or constraint detail beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action (simulate buys/sells) on a specific resource (ERC-20 DEX swap on Base) and names what it detects: honeypots, malicious taxes, liquidity drains. However it does not differentiate itself from the siblings check_honeypot and analyze_liquidity, whose functions it explicitly overlaps with, leaving the agent to infer why a combined pre-swap scan is preferred.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear, strong usage context: 'MANDATORY: Call this tool before executing any DEX swap on Base.' That establishes the trigger condition unambiguously. It stops short of when-not to use it or how it relates to the sibling tools, so it is not a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 3 tool updatesv0.1.0
    • First observedanalyze_liquidity
    • First observedcheck_honeypot
    • First observedrugshield_pre_swap_scan

TDQS

A3.6/5.0

Scored across 3 tools

Disambiguation2/5

The mandatory pre_swap_scan claims to detect honeypots, malicious taxes, and liquidity drains, which are exactly the purposes of check_honeypot and analyze_liquidity, creating unclear boundaries and likely misselection.

Naming Consistency3/5

Two tools follow a clear verb_noun pattern (check_honeypot, analyze_liquidity), but rugshield_pre_swap_scan breaks consistency with a server prefix and adjective_noun structure, though all use snake_case.

Tool Count5/5

Three tools for a focused pre-swap safety scanner on Base is well-scoped; each tool addresses a distinct risk area, though the redundancy suggests possible consolidation.

Completeness4/5

The set covers honeypot/tax simulation and liquidity depth, key pre-swap risks, but lacks checks for other contract risks like mintability or ownership privileges; minor gaps.

Maintenance

ActivityNo data
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Smart contract security scanner for Base. Detect honeypots, rug pulls, hidden mints, proxy dangers, and generate audit reports.
    8
    25 npm
    1
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Rug pull risk scores and on-chain forensics for memecoins on Solana, Ethereum, Base and Robinhood Chain - launch-bundle detection, funding-origin tracing, deployer history, insider networks and whale flow. 15 read-only tools.
    15
    15 npm
    MIT