Web3 Solidity Audit Mcp logo

Web3 Solidity Audit Mcp

CommunityPopular
tradecatlabs
web3-solidity-audit-mcp

MCP server integrating Slither + Aderyn + SWC patterns into Claude Code for smart contract auditing. Use when analyzing Solidity files, running DeFi-specific detectors, or generating invariants. 10 MCP tools, 86 SWC detectors, DeFi preset pack, CI/CD workflow.

Overview

Publishertradecatlabs
Repositoryvibe-coding-cn
Skill nameweb3-solidity-audit-mcp
Stars
16.3K
Forks
1.6K
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by tradecatlabs on GitHub. Read the source before you install it.

Installation

Install the Web3 Solidity Audit Mcp AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tradecatlabs/vibe-coding-cn.git /tmp/vibe-coding-cn
mkdir -p .claude/skills
cp -r /tmp/vibe-coding-cn/research/vibe-cybersecurity-cn/skills/web3-bug-bounty-hunting/web3-solidity-audit-mcp .claude/skills/web3-solidity-audit-mcp
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Web3 Solidity Audit Mcp in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Web3 Solidity Audit Mcp on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Web3 Solidity Audit Mcp is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SKILL 36 — SOLIDITY AUDIT MCP: CLAUDE-NATIVE SMART CONTRACT SCANNER

From: github.com/mariano-aguero/solidity-audit-mcp — MCP server plugging Slither + Aderyn + SWC patterns into Claude Code 10 tools. 19 built-in finding explainers. 86 SWC detectors. DeFi + Web3 preset detector packs. CI/CD ready.


WHAT IT IS

An MCP server that gives Claude Code direct access to Slither, Aderyn, Slang AST, SWC pattern matching, and a gas optimizer — all in one unified pipeline with auto-deduplication. Instead of context-switching between tools, you ask Claude to audit a contract and get a merged, severity-sorted report.

Stack:

External (install separately):
  Slither   → Trail of Bits, 90+ detectors, deep data flow
  Aderyn    → Cyfrin Rust-based, fast AST analysis
  Echidna   → Property fuzzer (optional)
  Halmos    → Symbolic execution (optional)

Built-in (no install):
  Slang     → Nomic Foundation AST parser, precise pattern matching
  SWC       → 86 detectors against Smart Contract Weakness Classification registry
  Gas       → Storage packing, loop, calldata optimizations

INSTALL & CONFIGURE

bash
# Prerequisites
pip install slither-analyzer solc-select
solc-select install 0.8.20 && solc-select use 0.8.20
curl -L https://foundry.paradigm.xyz | bash && foundryup

# Aderyn (Rust)
cargo install aderyn
# or: curl -L https://raw.githubusercontent.com/Cyfrin/aderyn/dev/cyfrinup/install | bash

# MCP server
npm install -g solidity-audit-mcp
# or: npx solidity-audit-mcp

# Optional fuzzers
brew install echidna    # macOS
pip install halmos      # symbolic execution

Wire into Claude Code — add to ~/.claude/mcp.json:

json
{
  "mcpServers": {
    "audit": {
      "command": "npx",
      "args": ["solidity-audit-mcp"]
    }
  }
}

Or project-level .mcp.json in repo root:

json
{
  "mcpServers": {
    "audit": {
      "command": "node",
      "args": ["/path/to/solidity-audit-mcp/dist/index.js"]
    }
  }
}

Docker (all tools pre-installed):

bash
docker run -v $(pwd):/contracts solidity-audit-mcp audit /contracts/Token.sol

THE 10 MCP TOOLS

analyze_contract — Full Pipeline (Start Here)

analyze_contract(
  contractPath: "contracts/Vault.sol",
  analyzers: ["slither", "aderyn", "slang"],   # or omit for all
  runTests: true                                 # run forge tests too
)

Pipeline:

  1. Parse metadata (functions, state vars, inheritance)
  2. Run Slither + Aderyn in parallel
  3. Detect risky patterns via Slang AST
  4. Deduplicate findings across all tools
  5. Sort by severity
  6. Return unified report + JSON

get_contract_info — Attack Surface Map (No Analysis)

get_contract_info("contracts/Protocol.sol")

Returns instantly:

  • Functions by visibility (external, public, internal, private)
  • Payable functions — all ETH entry points
  • delegatecall usage — proxy risk surface
  • State variables and modifiers
  • Inheritance chain

Use before full audit to understand the attack surface.

check_vulnerabilities — SWC Pattern Scan

check_vulnerabilities(
  contractPath: "contracts/Token.sol",
  detectors: ["SWC-107", "SWC-115", "CUSTOM-017"]  # or omit for all 86
)

19 built-in finding explainers (full Foundry PoC + remediation):

IDFindingSeverity
SWC-107ReentrancyCritical
SWC-112Delegatecall to untrusted calleeCritical
CUSTOM-017Missing access control on critical functionCritical
CUSTOM-018ERC-7702 unprotected initializerCritical
CUSTOM-004Price oracle manipulation / flash loanCritical
CUSTOM-032ERC-4337 paymaster drainCritical
SWC-101Integer overflow/underflow (unchecked)High
SWC-104Unchecked call return valueHigh
SWC-115Authorization through tx.originHigh
CUSTOM-001Array length mismatchHigh
CUSTOM-011Signature without replay protectionHigh
CUSTOM-029Merkle double-claimHigh
SWC-116Block timestamp dependenceMedium
CUSTOM-005Missing zero address validationMedium
CUSTOM-013Hash collision via abi.encodePackedMedium
CUSTOM-015Division before multiplicationMedium
CUSTOM-016Permit without deadlineMedium
SWC-100Function default visibilityMedium
SWC-103Floating pragmaLow

explain_finding — Deep Dive on Any Finding

explain_finding(
  findingId: "CUSTOM-011",         # or "SWC-107", or keyword "reentrancy"
  contractContext: "ERC4626 vault with harvest callback"
)

Returns: root cause → impact → step-by-step exploit → vulnerable code → secure code → Foundry PoC template → remediation → references.

Use this mid-hunt when you find a suspicious pattern and want the full exploit scenario before writing a PoC.

Supported keywords: reentrancy, overflow, flash loan, oracle, replay, nonce, encodepacked, precision loss, permit, access control, merkle, airdrop, erc-7702, paymaster, erc-4337, delegatecall, tx.origin, zero address, timestamp

generate_invariants — Auto-Generate Foundry Invariant Tests

generate_invariants(
  contractPath: "contracts/Vault.sol",
  protocolType: "vault"    # auto, erc20, erc721, vault, lending, amm, governance, staking
)

Returns ready-to-paste invariant_*() functions + handler contract + forge test --invariant run commands.

Protocol-specific invariants generated:

ERC-4626 vault:    totalAssets >= total share value
                   share price non-decreasing
                   deposit/withdraw round-trip solvency
Lending:           protocol solvency, liquidatable positions
AMM:               constant product k, no free lunch on swap
Staking:           reward monotonicity, total staked balance, slash accounting
Governance:        proposal state machine, quorum immutability

diff_audit — Audit Only Changes

diff_audit(
  oldContractPath: "v1/Vault.sol",
  newContractPath: "v2/Vault.sol",
  focusOnly: true   # only report issues in changed code
)

Returns: functions added/removed/modified, new vulns introduced, issues resolved. Use on upgrade PRs.

audit_project — Whole Directory

audit_project(
  projectRoot: "./contracts",
  exclude: ["node_modules/**", "test/**", "mocks/**"]
)

Aggregated findings across all .sol files + per-contract breakdown + project-level risk score.

optimize_gas — Gas Analysis

optimize_gas("contracts/Protocol.sol", includeInformational: true)

Returns: storage packing opportunities, loop optimizations, calldata vs memory, visibility suggestions, estimated savings per change.

run_tests — Forge Integration

run_tests(projectRoot: ".", contractName: "Vault")

Returns: pass/fail/skip counts, coverage %, gas report, execution time.

generate_report — Formatted Output

generate_report(findings, contractInfo, format: "markdown", projectName: "Protocol")

Formats into: executive summary + risk level + findings table + remediation guidance.


DeFi DETECTOR PRESET

The defi.json preset contains 10 high/medium severity DeFi-specific detectors:

oracle-manipulation      → HIGH  — spot price used, no TWAP, no staleness check
flash-loan-risk          → HIGH  — balance check before/after single tx
slippage-check           → HIGH  — swap with no minOut parameter
reentrancy-erc777        → HIGH  — ERC777 tokensReceived callback reentrancy
donation-attack          → HIGH  — totalAssets() uses balanceOf (inflatable)
price-stale-check        → HIGH  — Chainlink latestRoundData without check
unchecked-transfer       → MEDIUM — transfer/transferFrom return value ignored
precision-loss           → MEDIUM — division before multiplication
front-running-vulnerable → MEDIUM — state change in predictable order
liquidity-removal-risk   → MEDIUM — LP withdrawal without reserve check

Load in Claude Code:

analyze_contract("contracts/Vault.sol", analyzers: ["slither", "aderyn"], detectorPreset: "defi")

CI/CD — GITHUB ACTIONS WORKFLOW

Drop this in .github/workflows/audit.yml to block PRs with Critical/High findings:

yaml
name: Smart Contract Audit
on:
  pull_request:
    paths: ["**.sol"]

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: "20" }
      - uses: actions/setup-python@v5
        with: { python-version: "3.11" }

      - name: Install tools
        run: |
          pip install slither-analyzer solc-select
          solc-select install 0.8.28 && solc-select use 0.8.28
          ADERYN_VER=$(curl -sf https://api.github.com/repos/Cyfrin/aderyn/releases/latest | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/')
          curl -fL "https://github.com/Cyfrin/aderyn/releases/download/${ADERYN_VER}/aderyn-x86_64-unknown-linux-gnu.tar.xz" | tar -xJf - -C /tmp
          sudo install -m 755 /tmp/aderyn /usr/local/bin/aderyn
          npm install -g solidity-audit-mcp

      - name: Audit changed contracts
        run: |
          # Get changed .sol files
          CHANGED=$(git diff --name-only origin/${{ github.base_ref }} | grep '\.sol$' || true)
          for f in $CHANGED; do
            solidity-audit-cli audit "$f" --severity-threshold high --format sarif --output results.sarif
          done

      - name: Upload SARIF
        uses: github/codeql-action/upload-sarif@v3
        with: { sarif_file: results.sarif }

Exit codes for CI gates:

0 → no findings above threshold → PR can merge
1 → findings detected → block PR
2 → execution error → investigate

CLI USAGE (Outside Claude Code)

bash
# Full audit
solidity-audit-cli audit ./contracts/Token.sol

# Filter severity
solidity-audit-cli audit ./contracts/Token.sol --severity-threshold high

# Different output formats
solidity-audit-cli audit ./contracts/Token.sol --format json
solidity-audit-cli audit ./contracts/Token.sol --format sarif --output results.sarif
solidity-audit-cli audit ./contracts/Token.sol --format markdown

# Compare versions
solidity-audit-cli diff ./v1/Token.sol ./v2/Token.sol

# Gas analysis
solidity-audit-cli gas ./contracts/Token.sol

SAAS / REMOTE MODE

Run as a remote MCP server that any client connects to via SSE:

bash
# Start
MCP_API_KEY=your-secret npm run saas:up  # → http://localhost:3000

# Configure client
{
  "mcpServers": {
    "audit": {
      "transport": "sse",
      "url": "http://your-server:3000/sse",
      "headers": { "Authorization": "Bearer your-secret" }
    }
  }
}

# Health check
GET /health  → { "tools": 10, "slither": {"available": true}, "aderyn": {"available": true} }

ERN — SOLIDITY AUDIT MCP APPLIED

# STEP 1: Attack surface map before touching code
get_contract_info("contracts/ErnVault.sol")
→ lists: payable functions, delegatecall usage, external functions without modifiers

# STEP 2: Full pipeline with DeFi preset
analyze_contract(
  "contracts/ErnDistributor.sol",
  analyzers: ["slither", "aderyn", "slang"]
)
→ Slither will flag: DISTRIBUTOR_ROLE with no granted address
→ Aderyn will flag: unchecked return value in aToken.transfer()
→ SWC will flag: CUSTOM-017 missing access control on distributeRewards()

# STEP 3: Generate invariants for yield accounting
generate_invariants(
  "contracts/ErnVault.sol",
  protocolType: "vault"
)
→ Returns ready-to-paste Foundry invariant tests:
  invariant_totalAssetsGteDebt()        ← aToken balance >= totalDeposited
  invariant_sharePriceNonDecreasing()   ← cumulativeRewardPerShare only increases
  invariant_depositWithdrawRoundTrip()  ← user gets back what they put in

# STEP 4: Explain the signature replay finding in detail
explain_finding("CUSTOM-011", contractContext: "Ern distributor with off-chain signatures")
→ Returns: exploit scenario + vulnerable code + fixed code + Foundry PoC template

# STEP 5: Run invariant tests
run_tests(projectRoot: ".", contractName: "ErnVault")
→ Any invariant failure = confirmed Critical finding

→ NEXT: 00-START-HERE.md

Frequently asked questions

What does the Web3 Solidity Audit Mcp AI skill do?

MCP server integrating Slither + Aderyn + SWC patterns into Claude Code for smart contract auditing. Use when analyzing Solidity files, running DeFi-specific detectors, or generating invariants. 10 MCP tools, 86 SWC detectors, DeFi preset pack, CI/CD workflow.

Why use Web3 Solidity Audit Mcp on TypingMind?

Because you install it once and use it with any model. Web3 Solidity Audit Mcp is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Web3 Solidity Audit Mcp in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/tradecatlabs/vibe-coding-cn/tree/develop/research/vibe-cybersecurity-cn/skills/web3-bug-bounty-hunting/web3-solidity-audit-mcp. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Web3 Solidity Audit Mcp?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Web3 Solidity Audit Mcp?

As many as you like. As long as a model supports skills, you can use Web3 Solidity Audit Mcp with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Web3 Solidity Audit Mcp AI skill free?

Yes. It is published on GitHub by tradecatlabs under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇