Skip to main content
Glama
OpenZeppelin Contracts MCP Server

OpenZeppelin Contracts MCP Server

Official
by OpenZeppelin

OpenZeppelin Contracts MCP Server

NPM Package

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.

WARNING

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 uniswap-hooks)

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 via updateModelContext when advertised (some hosts do not attach silent context to draft-injected messages, so the message itself must be self-contained).

  • No message capability (e.g. Cursor today, including hosts that only advertise updateModelContext): 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 openLinks capability via openLink. 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 a file: dependency): run yarn --cwd packages/mcp build:apps after 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; prepublishOnly builds Apps before npm publish.

Related MCP server: genlayer-cli-mcp

Installation

Cursor

For quick installation, use the button below.

Add to Cursor

For manual installation:

  1. Go to Settings > Cursor Settings > Tools & Integrations > MCP Tools > New MCP Server.

  2. Add the contents from the Client Configuration section to your MCP configuration file and save.

  3. See the MCP server in the list.

Windsurf

  1. Go to Settings > Windsurf Settings > Cascade > Manage MCPs > View raw config.

  2. Add the contents from the Client Configuration section to your MCP configuration file and save.

  3. Click Refresh on the Manage MCP Servers page.

  4. See the MCP server in the list.

Claude Desktop

  1. Go to Settings > Developer > Edit Config.

  2. Add the contents from the Client Configuration section to your MCP configuration file and save.

  3. Restart Claude Desktop.

  4. 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-mcp

VS Code

For quick installation, use one of the buttons below.

Add to VS Code Add to VS Code Insiders

For manual installation:

  1. 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"
      ]
    }
  }
}
  1. 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 tools
cairo-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

    A3.6/5.0

    Scored across 33 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count2/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers