solidity-agent-toolkit

v0.11.3
solidity-agent-toolkit Checked 3 days ago Published 2 days ago

MCP server providing Solidity smart contract security analysis tools, OWASP knowledge base, and development utilities for AI agents

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

run_security_scan

PRIMARY tool for security analysis of Solidity code. Slither (90+ detectors), Aderyn (fast Rust), Solhint (lint + security) need their CLIs installed; patterns runs 9 AST detectors with regex fallback on inline code, no CLI needed. Trigger: 'find vulnerabilities', 'audit my contract', 'run security scan'. NOT for: vulnerability lookups by name or SCWE ID (use lookup_knowledge).

ParameterTypeDescription
tool *stringslither: most comprehensive, 90+ vulnerability detectors (Python) | aderyn: fast Rust-based pattern detection | solhint: linting, style, and basic security rules (Node.js) | patterns: AST + regex scan…
checkIdsarrayLimit checks to specific SCWE IDs (patterns only)
codestringSolidity source code to scan (patterns only)
detectorsarraySlither detectors to run (e.g., ["reentrancy-eth"])
excludearraySlither detectors to exclude
filesarraySolhint files to lint (e.g., ["contracts/*.sol"])
jsonOutputbooleanReturn raw JSON output (Slither only)
outputFormatstringOutput format for Aderyn results
pathstringPath to Solidity project or file (default: current directory)
rulesobjectSolhint rule configuration overrides

analyze_contract

Structural analysis of Solidity contract code. Choose 'analysis' type based on intent: adversarial (map features to 17 real-world attack scenarios), proxy_safety (check upgradeability patterns), erc_compliance (verify ERC-20/721/1155/4626 interface, requires 'standard' param), access_control (access control patterns — function visibility/modifier matrix), dependencies (import/inheritance graph). Use when: 'analyze this contract', 'what attacks are possible?', 'is my proxy safe?', 'does it implement ERC20?', 'show dependencies'.

ParameterTypeDescription
analysis *stringadversarial: map contract to 17 attack scenarios (reentrancy, flash loans, MEV, oracle manipulation) | proxy_safety: check initializers, storage gaps, selfdestruct risks | erc_compliance: verify stand…
code *stringSolidity source code to analyze
categoriesarrayFilter by attack categories (adversarial only)
standardstringERC standard to check against (erc_compliance only, e.g., ERC20)

lookup_knowledge

Knowledge lookup — does NOT analyze code. Load guides (audit, threat modeling, gas, ERC, Foundry/Hardhat, Solidity UML) or search OWASP SCWE / fetch an SCWE ID with remediation. No args lists guides. Trigger: 'Solidity repository architecture/composition diagram', 'audit checklist', 'reentrancy', 'SCWE-046'. NOT for: code scanning (use run_security_scan).

ParameterTypeDescription
filtersobjectOptional filters to narrow query results
guidestringGuide id. Available guides and references: code-review, adversarial-analysis, gas-optimization, erc-standards, foundry, hardhat, glamsterdam, architecture-diagrams, audit-checklist, owasp-scwe-top10,…
querystringSCWE search query for vulnerability title, description, or alias
vulnerabilityIdstringDirect lookup: get detailed info and remediation for a specific SCWE ID (e.g., SCWE-046)

check_code_quality

Check Solidity code quality. 'style': report Solidity Style Guide violations (12 rules: naming, ordering, spacing) or auto-format with forge fmt (fix=true, requires Foundry). 'natspec': report missing @dev/@param/@return tags or generate templates (generate=true). Trigger: 'check code style', 'format my contract', 'check documentation', 'generate NatSpec'.

ParameterTypeDescription
check *stringstyle: Solidity Style Guide rules / forge fmt | natspec: NatSpec docs
code *stringSolidity source code to check
fixbooleanstyle only: if true, format the code using forge fmt instead of checking
generatebooleannatspec only: if true, generate NatSpec templates instead of validating

run_foundry

Build, inspect, test, gas-profile, and safely simulate deployments of Solidity projects via Foundry (forge). Requires Foundry CLI and, except for test, a foundry.toml project. Deploy simulation forks a network and NEVER broadcasts. Trigger: 'compile my contract', 'show ABI', 'run tests', 'gas report', 'compare gas snapshot', 'simulate deployment', 'check deployment status'.

ParameterTypeDescription
action *stringbuild: forge build, report errors/warnings | inspect: ABI/bytecode/storage layout | test: forge test (all, filtered, or single) | gas_report: per-function gas estimates | gas_snapshot: forge snapshot,…
broadcastDirstringdeploy_status: broadcast directory (default: broadcast/)
comparebooleangas_snapshot: compare with previous snapshot
contractNamestringinspect (required) / build / gas_report: contract name
forkBlockNumbernumberdeploy_simulate: block number to fork from
functionNamestringgas_report: function name filter
fuzzbooleantest: enable fuzzing with 1000 runs
inspectstringinspect: what to inspect
pathstringbuild: path to specific contract or directory
rpcUrlstringdeploy_simulate: RPC URL to fork from
scriptPathstringdeploy_simulate (required): deployment script path
testContractstringtest: run a specific test contract (requires testFunction)
testFilterstringtest: test name filter (regex pattern)
testFunctionstringtest: run a specific test function (requires testContract)
verbositynumbertest: verbosity level (0-5)

generate_diagram

Generate a Solidity class overview, detailed class diagram, or local storage-layout diagram as an embedded SVG or PNG from a server-local Solidity file or directory. Trigger: "draw this contract diagram" or "show the storage slots for Vault".

ParameterTypeDescription
path *stringRequired Solidity file or directory path on the MCP server's local filesystem
contractNamestringRequired only for view storage; choose a Solidity contract name unique within the input path
formatstringArtifact format; defaults to svg
outputPathstringOptional server-local .svg or .png destination; creates parent folders and never overwrites
viewstringoverview (default): hide members and cluster folders | detailed: show class members | storage: show local storage layout; requires contractName