solhint-mcp
v0.1.10MCP server for Solhint — lint and autofix Solidity smart contracts from any MCP client
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
lint_solidity
Lint a Solidity source string that is not on disk yet — generated or pasted code. For a file in the project use lint_file; to sweep the project use lint_project.
| Parameter | Type | Description |
|---|---|---|
code * | string | Solidity source to lint |
config | object | Optional Solhint config, e.g. { extends: 'solhint:recommended' }. Rule maps and solhint:* presets only; 'extends' paths and 'plugins' are rejected. |
lint_file
Lint one Solidity file in the project. Use when you know which file changed. The file must exist on disk; for source not saved yet use lint_solidity, for a sweep use lint_project.
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Path to a .sol file, relative to the project root, e.g. 'contracts/Vault.sol'. |
lint_project
Lint many Solidity files at once. Use before treating Solidity work as finished, or when you do not know which files changed. Without a pattern it tries contracts/** then src/**. For one known file prefer lint_file; for source not saved yet use lint_solidity.
| Parameter | Type | Description |
|---|---|---|
pattern | string | Optional project-relative glob, e.g. 'contracts/**/*.sol'. Omit to autodetect. |
fix_solidity
Apply Solhint autofixes to a Solidity source string and return the corrected source. Touches no file — use it for source not saved yet; for a file on disk use fix_file.
| Parameter | Type | Description |
|---|---|---|
code * | string | Solidity source to fix |
config | object | Optional Solhint config, e.g. { extends: 'solhint:recommended' }. Rule maps and solhint:* presets only; 'extends' paths and 'plugins' are rejected. |
fix_file
Apply Solhint autofixes to one Solidity file. Previews by default; pass write: true to save. Prefer this over editing by hand after lint_file reports fixable findings.
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Path to a .sol file, relative to the project root, e.g. 'contracts/Vault.sol'. |
write | boolean | Write the fixed source back to the file. Defaults to false (preview only). |
explain_rule
Explain one Solhint rule and suggest a correction. Use for a rule id in a lint result you do not recognise, or when asked what a warning means.
| Parameter | Type | Description |
|---|---|---|
ruleId * | string | Rule id exactly as a lint result reports it, e.g. 'avoid-low-level-calls'. |
get_config
Show the project's effective Solhint config — which rules are on, and at what severity. Use to explain why a rule did or did not fire, or before changing .solhint.json.