solhint-mcp

v0.1.10
io.github.vschernoff/solhint-mcp Checked 16 hours ago Published 6 days ago

MCP 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.

ParameterTypeDescription
code *stringSolidity source to lint
configobjectOptional 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.

ParameterTypeDescription
filePath *stringPath 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.

ParameterTypeDescription
patternstringOptional 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.

ParameterTypeDescription
code *stringSolidity source to fix
configobjectOptional 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.

ParameterTypeDescription
filePath *stringPath to a .sol file, relative to the project root, e.g. 'contracts/Vault.sol'.
writebooleanWrite 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.

ParameterTypeDescription
ruleId *stringRule 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.