OpenZeppelin Contracts MCP Server
OfficialThis MCP server enables AI agents to generate smart contract source code using OpenZeppelin libraries across multiple blockchain languages and standards.
Solidity Contracts
ERC-20, ERC-721, ERC-1155 (fungible, non‑fungible, multi‑token)
Stablecoin and real‑world asset (RWA) tokens
ERC‑4337 account contracts (ECDSA, P256, WebAuthn, Multisig, etc.)
Governor (DAO) contracts with timelock and voting
Custom contracts with access control, pausability, and upgradability
Cairo Contracts (StarkNet)
ERC‑20, ERC‑721, ERC‑1155 (with royalties, votes)
Account, Multisig, Governor, Vesting
Custom contracts with access control and pausability
Confidential Contracts (Solidity)
ERC‑7984 confidential fungible tokens with FHEVM support
Stellar Contracts
Fungible tokens (SEP‑41) and stablecoins
Non‑fungible tokens (SEP‑50)
Governor and tokenized vault contracts
Stylus Contracts (Arbitrum)
ERC‑20, ERC‑721, ERC‑1155
Uniswap v4 Hooks
Wide variety of hook contracts: base hooks, dynamic fees, oracle, anti‑sandwich, limit orders, rehypothecation, and more
Each tool returns generated source code as Markdown text and never writes to disk. Hosts that support the MCP Apps extension can also render an interactive Wizard UI for configuration and live code preview.
Provides tools to generate smart contract source code using OpenZeppelin Contracts libraries for different blockchain platforms and token standards.
Enables generation of Solidity smart contracts for ERC20, ERC721, ERC1155, stablecoins, RWAs, accounts, governors, and custom implementations.
Supports creation of Stellar-based smart contracts for fungible tokens, stablecoins, and non-fungible tokens.
Allows generation of Stylus-based smart contracts implementing ERC20, ERC721, and ERC1155 token standards.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenZeppelin Contracts MCP Server generate an ERC20 token contract in Solidity for my new project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
OpenZeppelin Contracts MCP Server
A Model Context Protocol (MCP) server that allows AI agents to generate smart contracts using OpenZeppelin Contracts libraries.
This server runs locally and requires Node.js to be installed. For a hosted version, see OpenZeppelin MCP Servers.
AI agents determine when and how to use the MCP server and therefore may produce inaccurate results. You should always review any information produced by the AI agent to ensure that any results are accurate and suit your purposes.
Features
Provides tools to generate smart contract source code for the following languages and contract kinds. Resulting contracts use OpenZeppelin Contracts libraries for each language. Tools are named in the format <language>-<contract>.
Language | Contracts |
solidity | erc20, erc721, erc1155, stablecoin, rwa, account, governor, custom |
cairo | erc20, erc721, erc1155, erc6909, account, multisig, governor, vesting, custom |
confidential | erc7984 |
stellar | fungible, stablecoin, non-fungible, governor, vault, account |
stylus | erc20, erc721, erc1155 |
tron | trc20, trc721, trc1155, governor, custom |
uniswap-hooks | hooks (tool name is just |
MCP Apps
Hosts that support the MCP Apps extension (for example Cursor and Claude) can render an interactive Wizard UI for each tool: the same options as the web Wizard for that contract kind, a live code preview, and a button to hand the current source back to the agent. Language and kind pickers are omitted because the tool name already selects them.
Send Updates to Agent checks host MCP Apps capabilities:
message(e.g. Claude): sends a chat message that includes the full current source so the agent sees option changes. Also best-effort stages viaupdateModelContextwhen advertised (some hosts do not attach silent context to draft-injected messages, so the message itself must be self-contained).No
messagecapability (e.g. Cursor today, including hosts that only advertiseupdateModelContext): the button is Copy to Clipboard (same idea as the web Wizard copy action).Outbound links (tooltip “Read more”, import hyperlinks in the preview) use the host
openLinkscapability viaopenLink. If the host does not advertise it, those links are hidden so nothing looks clickable that cannot open.
Clients without Apps support continue to work — tools still return source code as Markdown text. The server always returns tool text; hosts that do not implement MCP Apps simply ignore the UI metadata.
App HTML artifacts
Interactive App HTML is not committed to git. It is generated into packages/mcp/apps/ and included in the published npm tarball.
Published package (
npm/npx): Apps HTML is already in the package; no extra build step.Local checkout (Cursor/Claude pointed at
packages/mcp/dist/cli.js, or afile:dependency): runyarn --cwd packages/mcp build:appsafter cloning or changing MCP App UI sources. If HTML is missing, the server fails closed at startup with a message to run that command (npm consumers should reinstall or report a packaging bug).CI / publish: CI builds Apps before MCP tests;
prepublishOnlybuilds Apps before npm publish.
Related MCP server: genlayer-cli-mcp
Installation
Cursor
For quick installation, use the button below.
For manual installation:
Go to Settings > Cursor Settings > Tools & Integrations > MCP Tools > New MCP Server.
Add the contents from the Client Configuration section to your MCP configuration file and save.
See the MCP server in the list.
Windsurf
Go to Settings > Windsurf Settings > Cascade > Manage MCPs > View raw config.
Add the contents from the Client Configuration section to your MCP configuration file and save.
Click Refresh on the Manage MCP Servers page.
See the MCP server in the list.
Claude Desktop
Go to Settings > Developer > Edit Config.
Add the contents from the Client Configuration section to your MCP configuration file and save.
Restart Claude Desktop.
Click the "Search and tools" button and see the MCP server in the list.
Client Configuration (Cursor/Windsurf/Claude Desktop)
{
"mcpServers": {
"OpenZeppelinContracts": {
"command": "npx",
"args": [
"-y",
"@openzeppelin/contracts-mcp"
]
}
}
}Claude Code
claude mcp add OpenZeppelinContracts -- npx -y @openzeppelin/contracts-mcpVS Code
For quick installation, use one of the buttons below.
For manual installation:
Follow VS Code documentation to Add an MCP server to your workspace using the following configuration:
{
"servers": {
"OpenZeppelinContracts": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@openzeppelin/contracts-mcp"
]
}
}
}Start the MCP server according to Manage MCP servers.
Usage
When interacting with an AI agent, for example in your IDE's Write or Agent mode, ask it to write or modify smart contracts for your use case. When the AI agent determines it is appropriate to do so, it will use the MCP server to generate the contracts or determine best practices for your use case.
Available Tools
33 toolscairo-accountCairo AccountA
Make a custom smart contract that represents an account that can be deployed and interacted with other contracts, and can be extended to implement custom logic. An account is a special type of contract that is used to validate and execute transactions.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), type (required), info, deploy, +5 more.
cairo-customCairo CustomA
Make a custom smart contract.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, access, macros, +2 more.
cairo-erc1155Cairo ERC1155B
Make a non-fungible token per the ERC-1155 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), baseUri (required), info, access, +9 more.
cairo-erc20Cairo ERC20A
Make a fungible token per the ERC-20 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, votes, +12 more.
cairo-erc6909Cairo ERC6909A
Make a minimal multi-token per the ERC-6909 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, access, macros, +7 more.
cairo-erc721Cairo ERC721A
Make a non-fungible token per the ERC-721 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, votes, +14 more.
cairo-governorCairo GovernorA
Make a contract to implement governance, such as for a DAO.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), delay (required), period (required), info, +13 more.
cairo-multisigCairo MultisigA
Make a multi-signature smart contract, requiring a quorum of registered signers to approve and collectively execute transactions.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), quorum (required), info, macros, +1 more.
cairo-vestingCairo VestingA
Make a vesting smart contract that manages the gradual release of ERC-20 tokens to a designated beneficiary based on a predefined vesting schedule.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), duration (required), schedule (required), startDate (required), +3 more.
confidential-erc7984Confidential ERC7984A
Make a confidential fungible token in Solidity according to the ERC-7984 standard, similar to ERC-20 but with confidentiality.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), contractURI (required), networkConfig (required), +5 more.
solidity-accountSolidity AccountA
Make an account contract that follows the ERC-4337 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, signer, upgradeable, +5 more.
solidity-customSolidity CustomA
Make a custom smart contract.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, access, pausable, +1 more.
solidity-erc1155Solidity ERC1155A
Make a non-fungible token per the ERC-1155 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: uri (required), name (required), info, access, +8 more.
solidity-erc20Solidity ERC20A
Make a fungible token per the ERC-20 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, votes, +15 more.
solidity-erc721Solidity ERC721A
Make a non-fungible token per the ERC-721 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, votes, +12 more.
solidity-governorSolidity GovernorA
Make a contract to implement governance, such as for a DAO.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), delay (required), period (required), info, +13 more.
solidity-rwaSolidity RWAA
Make a real-world asset token that uses the ERC-20 standard. This contract type does not support upgradeability. Experimental, some features are not audited and are subject to change.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, votes, +17 more.
solidity-stablecoinSolidity StablecoinB
Make a stablecoin token that uses the ERC-20 standard. This contract type does not support upgradeability. Experimental, some features are not audited and are subject to change.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, votes, +17 more.
stellar-accountStellar AccountA
Make a smart account contract that authorizes operations through configurable signers and policies, for example a multisig with passkey, Ed25519 and delegated signers.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, policy, upgradeable, +4 more.
stellar-fungibleStellar FungibleA
Make a fungible token per the Fungible Token Standard, compatible with SEP-41, similar to ERC-20.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), cap, info, +10 more.
stellar-governorStellar GovernorB
Make a governor contract for on-chain governance using token-based voting.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, access, quorum, +7 more.
stellar-non-fungibleStellar Non-FungibleA
Make a non-fungible token per the Non-Fungible Token Standard, compatible with SEP-50, similar to ERC-721.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, votes, +12 more.
stellar-stablecoinStellar StablecoinB
Make a stablecoin that uses Fungible Token Standard, compatible with SEP-41.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), cap, info, +11 more.
stellar-vaultStellar VaultA
Make a tokenized vault that issues Fungible Token shares for an underlying asset, similar to ERC-4626.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, access, +4 more.
stylus-erc1155Stylus ERC1155A
Make a non-fungible token per the ERC-1155 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, supply, burnable.
stylus-erc20Stylus ERC20A
Make a fungible token per the ERC-20 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, permit, burnable, +1 more.
stylus-erc721Stylus ERC721A
Make a non-fungible token per the ERC-721 standard.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, burnable, enumerable.
tron-customTRON CustomA
Make a custom smart contract, targeting the TRON Virtual Machine.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), info, access, pausable, +1 more.
tron-governorTRON GovernorA
Make a contract to implement governance, such as for a DAO, targeting the TRON Virtual Machine.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), delay (required), period (required), info, +13 more.
tron-trc1155TRON TRC1155A
Make a multi-token contract per the TRC-1155 standard, targeting the TRON Virtual Machine.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: uri (required), name (required), info, access, +8 more.
tron-trc20TRON TRC20A
Make a fungible token per the TRC-20 standard, targeting the TRON Virtual Machine.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, votes, +15 more.
tron-trc721TRON TRC721A
Make a non-fungible token per the TRC-721 standard, targeting the TRON Virtual Machine.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: name (required), symbol (required), info, votes, +12 more.
uniswap-hooksUniswap HooksA
Make a Uniswap v4 hook contract using the OpenZeppelin Uniswap Hooks library.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Inputs: hook (required), name (required), inputs (required), shares (required), +7 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Most tools are distinguishable by a clear platform prefix plus contract standard, such as solidity-erc20, cairo-erc20, and tron-trc20. However, several similar fungible-token generators exist across ecosystems, and stablecoin/RWA/custom variants can be confused without reading the full descriptions.
The dominant pattern is platform-contractType (for example solidity-erc721, cairo-governor, stellar-vault), which is predictable and readable. A few tools deviate from that prefix pattern, such as uniswap-hooks and confidential-erc7984, and stellar uses standard names like fungible instead of ERC-style names.
The 33-tool surface is heavy for an MCP server and contains many near-duplicate variants across chains and standards. While the domain is broad, the catalog would benefit from grouping or fewer platform-specific tools.
The tool set covers most common smart-contract categories: fungible/non-fungible tokens, governance, accounts, stablecoins, RWAs, vaults, vesting, multisig, and custom contracts. Gaps exist, such as limited Stylus/Tron coverage for some patterns, but the custom-contract tools provide a workaround.
Maintenance
Related MCP Connectors
The OpenZeppelin Solidity Contracts MCP server integrates OpenZeppelin's security and style rules into AI-driven development workflows, enabling AI assistants to generate safe, correct, and production-ready smart contracts. It automatically validates generated code against OpenZeppelin standards (including imports, modifiers, naming conventions, and security checks) and supports various contract types including ERC-20, ERC-721, ERC-1155, Stablecoins, RWA, Governor, and Account contracts through prompt-driven workflows.
The OpenZeppelin Cairo Contracts MCP server generates secure smart contracts in the Cairo language for Starknet environments based on OpenZeppelin templates. It brings OpenZeppelin's proven security and style rules directly into AI-driven development workflows to create safe, production-ready contracts. Key capabilities include providing templates for ERC-20, ERC-721, ERC-1155, Multisig, Governor, and Vesting contracts.
The OpenZeppelin Stellar Contracts MCP server generates secure smart contracts for the Stellar blockchain based on OpenZeppelin templates. It integrates with AI assistants to automatically enforce OpenZeppelin's security best practices, style rules, and standards at every prompt, enabling developers to create production-ready Fungible Token, Non-Fungible Token, and Stablecoin contracts through AI-driven workflows.
The OpenZeppelin Stylus Contracts MCP server generates secure smart contracts for the Arbitrum Stylus environment using OpenZeppelin templates, including ERC-20, ERC-721, and ERC-1155 standards. It automatically validates generated code against OpenZeppelin's security and style rules, enforcing best practices for imports, modifiers, naming conventions, and security checks to prevent common vulnerabilities. The server integrates with AI development tools like Cursor, Claude, Gemini, Windsurf, and VS Code to enable AI-assisted, production-ready smart contract development.
Related MCP Servers
- AlicenseDqualityDmaintenanceA Model Context Protocol server that gives LLMs the ability to interact with Ethereum networks, manage wallets, query blockchain data, and execute smart contract operations through a standardized interface.5436 npm14MIT
- FlicenseBqualityDmaintenanceMCP server for AI agents to work with GenLayer projects, providing tools to run GenLayer CLI, lint contracts, and deploy contracts with automatic private key handling.47 npm1-
- AlicenseAqualityDmaintenanceA comprehensive MCP server for generating sophisticated GenLayer Intelligent Contracts with AI-native blockchain capabilities.168 npm7MIT
- AlicenseNot gradedqualityDmaintenanceMCP server providing AI assistants with tools for advanced EVM smart contract analysis, including proxy detection, implementation resolution, and security analysis.1MIT