MCP servers

solc-mcp

The compiler module. It compiles Solidity on your machine with solc-js and returns ABI and bytecode, ready to deploy.

npm package

@roxi-os/solc-mcp

License

MIT

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 build

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

ParameterTypeDescription
fileNamestringFile name ending in .sol, such as Token.sol.
contentstringThe 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 pragma ranges must include it. ^0.8.0 works.
  • Deploy the result with metamask-mcp's deploy-contract. See Compile and deploy.