solidity-agent-toolkit
v0.11.3MCP 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).
| Parameter | Type | Description |
|---|---|---|
tool * | string | slither: 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… |
checkIds | array | Limit checks to specific SCWE IDs (patterns only) |
code | string | Solidity source code to scan (patterns only) |
detectors | array | Slither detectors to run (e.g., ["reentrancy-eth"]) |
exclude | array | Slither detectors to exclude |
files | array | Solhint files to lint (e.g., ["contracts/*.sol"]) |
jsonOutput | boolean | Return raw JSON output (Slither only) |
outputFormat | string | Output format for Aderyn results |
path | string | Path to Solidity project or file (default: current directory) |
rules | object | Solhint 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'.
| Parameter | Type | Description |
|---|---|---|
analysis * | string | adversarial: 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 * | string | Solidity source code to analyze |
categories | array | Filter by attack categories (adversarial only) |
standard | string | ERC 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).
| Parameter | Type | Description |
|---|---|---|
filters | object | Optional filters to narrow query results |
guide | string | Guide id. Available guides and references: code-review, adversarial-analysis, gas-optimization, erc-standards, foundry, hardhat, glamsterdam, architecture-diagrams, audit-checklist, owasp-scwe-top10,… |
query | string | SCWE search query for vulnerability title, description, or alias |
vulnerabilityId | string | Direct 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'.
| Parameter | Type | Description |
|---|---|---|
check * | string | style: Solidity Style Guide rules / forge fmt | natspec: NatSpec docs |
code * | string | Solidity source code to check |
fix | boolean | style only: if true, format the code using forge fmt instead of checking |
generate | boolean | natspec 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'.
| Parameter | Type | Description |
|---|---|---|
action * | string | build: 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,… |
broadcastDir | string | deploy_status: broadcast directory (default: broadcast/) |
compare | boolean | gas_snapshot: compare with previous snapshot |
contractName | string | inspect (required) / build / gas_report: contract name |
forkBlockNumber | number | deploy_simulate: block number to fork from |
functionName | string | gas_report: function name filter |
fuzz | boolean | test: enable fuzzing with 1000 runs |
inspect | string | inspect: what to inspect |
path | string | build: path to specific contract or directory |
rpcUrl | string | deploy_simulate: RPC URL to fork from |
scriptPath | string | deploy_simulate (required): deployment script path |
testContract | string | test: run a specific test contract (requires testFunction) |
testFilter | string | test: test name filter (regex pattern) |
testFunction | string | test: run a specific test function (requires testContract) |
verbosity | number | test: 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".
| Parameter | Type | Description |
|---|---|---|
path * | string | Required Solidity file or directory path on the MCP server's local filesystem |
contractName | string | Required only for view storage; choose a Solidity contract name unique within the input path |
format | string | Artifact format; defaults to svg |
outputPath | string | Optional server-local .svg or .png destination; creates parent folders and never overwrites |
view | string | overview (default): hide members and cluster folders | detailed: show class members | storage: show local storage layout; requires contractName |