
OpenZeppelin Contracts MCP Server
OfficialLet AI agents generate audited smart contracts using OpenZeppelin Contracts libraries.
Add to your client
Copy the config for your MCP client and paste it into its config file.
claude mcp add OpenZeppelinContracts -- npx -y @openzeppelin/contracts-mcpPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"openzeppelin-contracts-mcp-server": {
"command": "npx",
"args": [
"-y",
"@openzeppelin/contracts-mcp"
]
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Node.js
- An MCP-compatible client (Cursor, Windsurf, Claude Desktop, Claude Code, or VS Code)
About OpenZeppelin Contracts MCP Server
A Model Context Protocol server from OpenZeppelin that lets AI agents generate smart contract source code from OpenZeppelin Contracts libraries. Tools are named in the format <language>-<contract> and cover Solidity (erc20, erc721, erc1155, stablecoin, rwa, account, governor, custom), Cairo (erc20, erc721, erc1155, account, multisig, governor, vesting, custom), Confidential (erc7984), Stellar (fungible, stablecoin, non-fungible), Stylus (erc20, erc721, erc1155), and Uniswap Hooks. The server runs locally over stdio via npx and integrates with Cursor, Windsurf, Claude Desktop, Claude Code, and VS Code. A hosted version is available at mcp.openzeppelin.com.
Tools & capabilities (24)
solidity-erc20Generate a Solidity ERC-20 fungible token contract using OpenZeppelin Contracts.
solidity-erc721Generate a Solidity ERC-721 non-fungible token (NFT) contract using OpenZeppelin Contracts.
solidity-erc1155Generate a Solidity ERC-1155 multi-token contract using OpenZeppelin Contracts.
solidity-stablecoinGenerate a Solidity stablecoin contract using OpenZeppelin Contracts.
solidity-rwaGenerate a Solidity real-world asset (RWA) contract using OpenZeppelin Contracts.
solidity-accountGenerate a Solidity account (smart account) contract using OpenZeppelin Contracts.
solidity-governorGenerate a Solidity governor (on-chain governance) contract using OpenZeppelin Contracts.
solidity-customGenerate a custom Solidity contract scaffold using OpenZeppelin Contracts.
cairo-erc20Generate a Cairo ERC-20 fungible token contract using OpenZeppelin Contracts for Cairo.
cairo-erc721Generate a Cairo ERC-721 non-fungible token contract using OpenZeppelin Contracts for Cairo.
cairo-erc1155Generate a Cairo ERC-1155 multi-token contract using OpenZeppelin Contracts for Cairo.
cairo-accountGenerate a Cairo account contract using OpenZeppelin Contracts for Cairo.
cairo-multisigGenerate a Cairo multisig contract using OpenZeppelin Contracts for Cairo.
cairo-governorGenerate a Cairo governor contract using OpenZeppelin Contracts for Cairo.
cairo-vestingGenerate a Cairo vesting contract using OpenZeppelin Contracts for Cairo.
cairo-customGenerate a custom Cairo contract scaffold using OpenZeppelin Contracts for Cairo.
confidential-erc7984Generate a confidential ERC-7984 contract.
stellar-fungibleGenerate a Stellar fungible token contract using OpenZeppelin Contracts for Stellar.
stellar-stablecoinGenerate a Stellar stablecoin contract using OpenZeppelin Contracts for Stellar.
stellar-non-fungibleGenerate a Stellar non-fungible token contract using OpenZeppelin Contracts for Stellar.
stylus-erc20Generate a Stylus ERC-20 contract using OpenZeppelin Contracts for Stylus.
stylus-erc721Generate a Stylus ERC-721 contract using OpenZeppelin Contracts for Stylus.
stylus-erc1155Generate a Stylus ERC-1155 contract using OpenZeppelin Contracts for Stylus.
uniswap-hooksGenerate a Uniswap v4 hooks contract using OpenZeppelin Uniswap Hooks.
When to use it
- Ask an AI coding agent to scaffold an audited ERC-20, ERC-721, or ERC-1155 token directly in your IDE.
- Generate governance, stablecoin, RWA, or smart-account contracts as a starting point for further customization.
- Produce Cairo, Stellar, or Stylus contracts for Starknet, Stellar, and Arbitrum Stylus ecosystems via natural-language prompts.
- Bootstrap Uniswap v4 hooks contracts using OpenZeppelin's Uniswap Hooks library.
Security notes
Runs locally via npx and requires Node.js; no API key or credentials are needed. AI agents decide when and how to call the generation tools and may produce inaccurate results, so always review generated smart contract code before compiling or deploying.
OpenZeppelin Contracts MCP Server FAQ
Does the server require an API key?
No. It runs locally via npx and only requires Node.js; no API key or credentials are configured.
How are the tools named?
Tools are named in the format `<language>-<contract>`, for example `solidity-erc20` or `cairo-governor`. The Uniswap Hooks tool is named just `uniswap-hooks`.
Is there a hosted version?
Yes. In addition to this local server, OpenZeppelin offers a hosted version at https://mcp.openzeppelin.com/.
Are the generated contracts safe to deploy as-is?
AI agents may produce inaccurate results. OpenZeppelin recommends always reviewing generated contracts to ensure they are accurate and suit your purposes before compiling or deploying.
Alternatives to OpenZeppelin Contracts MCP Server
Compare all alternatives →Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).
Up-to-date, version-specific library documentation injected into your coding agent.
LSP-powered coding agent toolkit: semantic symbol search, references and structural edits.
Compare OpenZeppelin Contracts MCP Server with: