
How to add OpenZeppelin Contracts MCP Server to Cursor
Let AI agents generate audited smart contracts using OpenZeppelin Contracts libraries. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 292★ · stdio · no auth · official
Cursor config for OpenZeppelin Contracts MCP Server
claude mcp add OpenZeppelinContracts -- npx -y @openzeppelin/contracts-mcp{
"mcpServers": {
"openzeppelin-contracts-mcp-server": {
"command": "npx",
"args": [
"-y",
"@openzeppelin/contracts-mcp"
]
}
}
}Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the OpenZeppelin Contracts MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of OpenZeppelin Contracts MCP Server's tools to confirm it's connected.
Before you start
- Node.js
- An MCP-compatible client (Cursor, Windsurf, Claude Desktop, Claude Code, or VS Code)
What OpenZeppelin Contracts MCP Server can do in Cursor
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.
Security
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 + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the OpenZeppelin Contracts MCP Server config there under the "mcpServers" key and restart the client.
Is OpenZeppelin Contracts MCP Server safe to use with Cursor?
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.
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/.