OpenZeppelin Docs MCP Server
Provides offline search and retrieval of OpenZeppelin Contracts documentation, including API references, contract details, function signatures, and NatSpec documentation for both v4.x and v5.x versions.
Click on "Install 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 Docs MCP Servershow me how to use the ERC20 contract in v5.x"
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 Docs MCP Server
An MCP (Model Context Protocol) server that provides offline search and retrieval of OpenZeppelin Contracts documentation. Pre-indexes documentation at build time using SQLite with FTS5 for fast full-text search.
Features
Offline capable - Works without internet after initial setup
Fast lookups - Pre-built SQLite index with FTS5 full-text search
Contract-aware - Understands Solidity structure (functions, events, modifiers, errors)
Version aware - Supports OpenZeppelin Contracts v4.x and v5.x
NatSpec extraction - Parses documentation directly from Solidity source files
Related MCP server: Security Context MCP Server
Installation
Quick Install (GitHub)
claude mcp add --transport stdio openzeppelin-docs -- npx -y github:pbuda/openzeppelin-docs-mcpThe index will be built automatically on first run (~2-3 minutes).
Install from npm
claude mcp add --transport stdio openzeppelin-docs -- npx -y openzeppelin-docs-mcpVerify Installation
# List configured servers
claude mcp list
# Check server status (inside Claude Code)
/mcpBuilding from Source
If you want to build and run locally:
# Clone the repository
git clone https://github.com/pbuda/openzeppelin-docs-mcp.git
cd openzeppelin-docs-mcp
# Install dependencies
npm install
# Build the documentation index (fetches repos, ~2-3 min)
npm run build:index
# Build TypeScript
npm run buildAdd Local Build to Claude Code
claude mcp add --transport stdio openzeppelin-docs -- node /absolute/path/to/openzeppelin-docs-mcp/dist/index.jsOr manually add to ~/.claude.json:
{
"mcpServers": {
"openzeppelin-docs": {
"command": "node",
"args": ["/absolute/path/to/openzeppelin-docs-mcp/dist/index.js"]
}
}
}Testing with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.jsAvailable Tools
search_oz_docs
Search OpenZeppelin Contracts documentation for guides, API references, and code examples.
{
"query": "reentrancy guard",
"version": "5.x",
"category": "all",
"limit": 5
}Parameters:
query(required) - Search query (e.g., "ERC20 approve", "access control roles")version-"4.x","5.x", or"all"(default:"5.x")category-"access","token","utils","governance","proxy","finance","metatx", or"all"limit- Max results (default: 5)
get_oz_contract
Get detailed API reference for a specific contract or library.
{
"name": "ERC20",
"version": "5.x"
}Parameters:
name(required) - Contract or library name (e.g., "Ownable", "ECDSA", "SafeERC20")version-"4.x"or"5.x"(default:"5.x")
Returns: Contract metadata, inheritance chain, all functions/events/errors with signatures and NatSpec.
get_oz_function
Get detailed information about a specific function.
{
"function_name": "ECDSA.recover",
"version": "5.x"
}Parameters:
function_name(required) - Function name, optionally with contract (e.g., "transfer", "ERC20.transferFrom")version-"4.x"or"5.x"(default:"5.x")
Returns: Function signature, parameters with types and descriptions, return values, NatSpec documentation.
list_oz_modules
List all available contracts and libraries, optionally filtered by category.
{
"category": "utils",
"version": "5.x"
}Parameters:
category- Filter by category or"all"(default:"all")version-"4.x"or"5.x"(default:"5.x")
Returns: Organized list of all contracts/libraries grouped by category.
Development
# Run in development mode (with hot reload)
npm run dev
# Rebuild the index (skip fetching if repos exist)
npx tsx scripts/build-index.ts --skip-fetch
# Force re-clone repositories
npx tsx scripts/build-index.ts --forceData Sources
The indexer fetches and parses:
OpenZeppelin Docs - MDX documentation from github.com/OpenZeppelin/docs
OpenZeppelin Contracts v5.3.0 - Solidity source with NatSpec comments
OpenZeppelin Contracts v4.9.6 - Solidity source with NatSpec comments
Database Statistics
After indexing:
~927 documentation chunks from MDX files
~357 contracts (191 v5.x, 166 v4.x)
~3,067 members (functions, events, modifiers)
License
MIT
Available Tools
5 toolsget_oz_contractC
Get detailed API reference for a specific OpenZeppelin contract or library
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Contract or library name (e.g., 'ERC20', 'Ownable', 'ECDSA', 'SafeERC20') | |
| version | No | OpenZeppelin Contracts version | 5.x |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on permissions, rate limits, error handling, or output format. For a tool that fetches API references, this omission leaves the agent without crucial operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence that efficiently conveys the core functionality without unnecessary words. It's front-loaded with the main action and resource, making it easy to parse and understand quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't address behavioral aspects like authentication, response structure, or error cases, which are important for a tool interacting with external documentation sources. The agent is left with significant gaps in understanding how to use this tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds minimal semantic context beyond the input schema, which has 100% coverage. It implies the tool retrieves documentation for a named contract/library, but doesn't elaborate on parameter interactions or usage nuances. The baseline score of 3 reflects adequate but unenhanced parameter understanding.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Get detailed API reference') and resource ('specific OpenZeppelin contract or library'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_oz_function' or 'search_oz_docs', which likely serve related but distinct purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'list_oz_modules' for browsing or 'search_oz_docs' for broader queries, leaving the agent to infer usage context without explicit direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_oz_functionC
Get detailed information about a specific function in OpenZeppelin Contracts
| Name | Required | Description | Default |
|---|---|---|---|
| function_name | Yes | Function name, optionally with contract (e.g., 'transfer', 'ERC20.transfer', 'ECDSA.recover') | |
| version | No | OpenZeppelin Contracts version | 5.x |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves 'detailed information' but doesn't specify what that includes (e.g., function signatures, parameters, return values, gas estimates, or security notes). It also omits operational details like error handling, rate limits, or authentication requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, direct sentence that efficiently conveys the core purpose without unnecessary words. It is appropriately sized for a simple lookup tool, though it could be slightly more informative without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks details on output format, error cases, or differentiation from siblings. With no output schema, the description should ideally hint at what 'detailed information' includes, but it doesn't, leaving gaps in completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, clearly documenting both parameters. The description adds no additional parameter semantics beyond what's in the schema, such as examples of valid function names beyond the schema's examples or clarification on version compatibility. This meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Get detailed information') and resource ('about a specific function in OpenZeppelin Contracts'), making the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_oz_contract' or 'search_oz_docs', which likely retrieve different types of information about OpenZeppelin components.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_oz_contract' for contract-level details or 'search_oz_docs' for broader documentation searches, leaving the agent without context for tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_oz_modulesB
List all available OpenZeppelin contracts and libraries, optionally filtered by category
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Filter by category | all |
| version | No | OpenZeppelin Contracts version | 5.x |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions listing and optional filtering but fails to describe key behaviors such as the return format (e.g., list of names, details), pagination, rate limits, or authentication requirements. This is a significant gap for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose and key feature (optional filtering). It is front-loaded with no wasted words, making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't address the return values, error handling, or behavioral traits like data freshness or limitations. For a tool with no structured data beyond the input schema, more context is needed to be fully helpful.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents both parameters ('category' and 'version') with enums and defaults. The description adds minimal value by mentioning optional filtering by category but doesn't explain the meaning of categories or versions beyond what the schema provides, aligning with the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('List') and resource ('OpenZeppelin contracts and libraries'), making the purpose specific and understandable. However, it doesn't explicitly distinguish this tool from its sibling 'oz_index_status' which might also provide listing functionality, nor does it mention the optional filtering by version which is a key parameter.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by mentioning optional filtering by category, but it doesn't provide explicit guidance on when to use this tool versus alternatives like 'search_oz_docs' or 'get_oz_contract'. No exclusions or prerequisites are stated, leaving usage context partially unclear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
oz_index_statusA
Check if the OpenZeppelin docs index is ready. Call this if other tools report the index is building.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It describes the tool's behavior as checking index readiness, which is clear but minimal. It doesn't disclose additional traits like what 'ready' means operationally, potential latency, error conditions, or return format. For a tool with zero annotation coverage, this leaves gaps in behavioral understanding, though the core function is stated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences that are front-loaded and waste-free. The first sentence states the purpose clearly, and the second provides essential usage guidance. Every word earns its place, making it highly concise and well-structured for quick comprehension by an agent.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is moderately complete. It covers the purpose and usage context adequately. However, without annotations or an output schema, it lacks details on behavioral aspects like return values or error handling, which could be helpful for a status-checking tool. It's sufficient but not fully comprehensive for the context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter semantics, so it meets the baseline of 4 for zero-parameter tools. It appropriately focuses on the tool's purpose and usage without unnecessary parameter details.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Check if the OpenZeppelin docs index is ready.' It specifies the verb ('Check') and resource ('OpenZeppelin docs index'), making the action explicit. However, it doesn't explicitly differentiate from sibling tools like 'get_oz_contract' or 'search_oz_docs' beyond implying this is a status check rather than a data retrieval operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage guidance: 'Call this if other tools report the index is building.' This clearly indicates when to use this tool (as a follow-up to index-building reports) and implies an alternative context (don't call it if the index is already ready or if other tools haven't reported building). It effectively guides the agent on appropriate invocation timing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_oz_docsC
Search OpenZeppelin Contracts documentation for guides, API references, and code examples
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (e.g., 'reentrancy guard', 'ERC20 approve', 'access control roles') | |
| version | No | OpenZeppelin Contracts version | 5.x |
| category | No | Filter by category | all |
| limit | No | Max results to return |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It states the search scope but doesn't mention critical behaviors like whether this is a read-only operation, how results are returned (e.g., format, pagination), performance characteristics, or error handling. For a search tool with 4 parameters and no annotations, this leaves significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded with the core functionality.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the search returns (format, structure, or content of results), which is critical for a search tool. The description alone doesn't provide enough context for effective tool use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all parameters thoroughly with descriptions, enums, defaults, and requirements. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Search') and resource ('OpenZeppelin Contracts documentation'), with specific content types mentioned ('guides, API references, and code examples'). However, it doesn't explicitly differentiate from sibling tools like 'get_oz_contract' or 'get_oz_function', which appear to retrieve specific items rather than search documentation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'list_oz_modules' or 'oz_index_status'. It mentions what content is searched but gives no context about appropriate use cases, prerequisites, or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
- First observed
get_oz_contract - First observed
get_oz_function - First observed
list_oz_modules - First observed
oz_index_status - First observed
search_oz_docs
TDQS
Each tool has a clearly distinct purpose: get_oz_contract retrieves contract-level details, get_oz_function focuses on specific functions, list_oz_modules provides a catalog, oz_index_status checks system readiness, and search_oz_docs performs general documentation searches. There is no overlap in functionality, making tool selection straightforward for an agent.
All tools follow a consistent snake_case naming pattern with clear verb_noun structures: get_oz_contract, get_oz_function, list_oz_modules, oz_index_status, and search_oz_docs. The 'oz' prefix is uniformly applied, and verbs like 'get', 'list', and 'search' accurately describe the actions, ensuring predictability across the set.
With 5 tools, this server is well-scoped for its purpose of accessing OpenZeppelin documentation. Each tool serves a distinct and necessary function, from indexing and searching to retrieving specific details, without being overly sparse or bloated, making it efficient for agents to navigate.
The tool set covers core documentation needs comprehensively, including listing, searching, and retrieving detailed information at both contract and function levels, with a status check for system readiness. A minor gap might be the lack of tools for updating or managing documentation, but this is reasonable for a read-only documentation server, and agents can perform all essential queries without dead ends.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
DevDocs.io keyless docs index + entry search + content (Angular, MDN, Rust, etc.).
Versioned documentation registry and semantic search for AI tools and coding assistants.
Search and read Rust documentation for the standard library and any crate on crates.io
Version-true web3 docs, ABIs and human-validated integration recipes over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables users to generate and retrieve secure, audited smart contract templates from OpenZeppelin including ERC20, ERC721, ERC1155 tokens, access control, governance, and finance contracts through natural language prompts.MIT
- AlicenseAqualityDmaintenanceProvides instant access to authoritative security documentation from organizations like OWASP, NIST, and major cloud providers through natural language semantic search. It enables users to retrieve security best practices, frameworks, and vulnerability information directly from a locally cached knowledge base.41MIT
- AlicenseNot gradedqualityCmaintenanceEnables fast, offline search and retrieval of Expo documentation from local .mdx files, with tools for searching, getting content, listing sections, API references, and quick start guides.19117MIT
- AlicenseAqualityCmaintenanceUnifies 11 protocol specification repositories (EIPs, BIPs, CIPs, etc.) and canonical contract addresses across 10 chains into a local FTS5 index, enabling coding agents to retrieve exact spec text and contract addresses via natural language queries.428MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pbuda/openzeppelin-docs-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server