MCP servers
solc-mcp
The compiler module. It compiles Solidity on your machine with solc-js and returns ABI and bytecode, ready to deploy.
Install#
Add it to your MCP client's config. Requires Node.js 20 or newer. See the quick start for where the config file lives.
claude_desktop_config.json
{
"mcpServers": {
"solc": { "command": "npx", "args": ["-y", "@roxi-os/solc-mcp"] }
}
}From source
bash
git clone https://github.com/ROXI-OS-SI/solc-mcp.git
cd solc-mcp
pnpm install
pnpm buildThen use "command": "node" with the absolute path to build/index.js as the argument.
Tools#
compile-solidity
Compile one Solidity source file and return every contract in it.
| Parameter | Type | Description |
|---|---|---|
| fileName | string | File name ending in .sol, such as Token.sol. |
| content | string | The Solidity source code. |
Output#
An array with one entry per contract in the file:
compile-solidity result
[
{
"contractName": "Greeter",
"abi": [ … ],
"bytecode": "6080604052…",
"compilerVersion": "0.8.x+commit…"
}
]If the source doesn't compile, the tool returns an error with the compiler's own messages, for example ParserError: Expected type name --> Bad.sol:1:52, so the agent can fix the code and retry.
Good to know#
- Compilation happens locally. Source code is never uploaded.
- Compiles a single file. Imports of other files, such as OpenZeppelin, aren't resolved; inline what the contract needs.
- Uses the solc-js version bundled with the package, so
pragmaranges must include it.^0.8.0works. - Deploy the result with metamask-mcp's
deploy-contract. See Compile and deploy.