OpenTofu MCP Server
OfficialThe OpenTofu MCP Server provides an MCP-compatible interface to search and retrieve information from the OpenTofu Registry:
Search the OpenTofu Registry: Find providers, modules, resources, and data sources using simple search queries
Get provider details: Retrieve detailed information about specific providers by namespace and name
Get module details: Access detailed information about specific modules by namespace, name, and target
Get resource documentation: Fetch documentation for specific resources by provider namespace, provider name, and resource name
Get data source documentation: Obtain documentation for specific data sources by provider namespace, provider name, and data source name
Offers a remote deployment option as a Cloudflare Worker, providing globally distributed access to the OpenTofu Registry data.
Enables running the MCP server locally as a Node.js application for accessing the OpenTofu Registry.
Provides search and retrieval of OpenTofu Registry content, including information about providers, modules, resources, and data sources, along with their documentation and configuration examples.
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., "@OpenTofu MCP Serversearch for AWS provider details"
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.
OpenTofu MCP Server
A Model Context Protocol (MCP) server for accessing the OpenTofu Registry. This server allows language model assistants to search for and retrieve information about OpenTofu providers, modules, resources, and data sources.
Available as both a local Node.js server and a remote Cloudflare Worker deployment.
Features
Search the OpenTofu Registry for providers, modules, resources, and data sources
Get detailed information about specific providers and modules
Access documentation for resources and data sources
Retrieve comprehensive OpenTofu configuration examples
MCP-compatible interface for AI assistants
Related MCP server: terraform-best-practices-mcp-server
Installation
You can use this MCP server with any AI assistant that supports the Model Context Protocol. Choose between the hosted service or local installation:
Hosted Service (Recommended)
The easiest way to get started is to use our hosted service at mcp.opentofu.org. Benefits include:
✅ No local installation required
✅ Always up-to-date with the latest OpenTofu Registry data
✅ Globally distributed via Cloudflare Workers
✅ High availability and performance
Claude Code
Add the hosted OpenTofu MCP server to Claude Code:
claude mcp add opentofu -t streamable-http https://mcp.opentofu.org/mcpCursor / VS Code
Automatically install to Cursor in one click
Add this to your settings.json.
{
"mcp": {
"servers": {
"opentofu": {
"type": "streamable-http",
"url": "https://mcp.opentofu.org/mcp"
}
}
}
}You do not need to define any inputs.
Generic MCP Configuration
{
"mcpServers": {
"opentofu": {
"transport": "streamable-http",
"url": "https://mcp.opentofu.org/mcp"
}
}
}Local Server
Basic Usage
You can also run the server locally with npx:
npx @opentofu/opentofu-mcp-serverGlobal Installation
Install globally for repeated use:
npm install -g @opentofu/opentofu-mcp-server
opentofu-mcp-serverClaude Code (Local)
Add the local server to Claude Code:
claude mcp add opentofu -- npx @opentofu/opentofu-mcp-serverGeneric MCP Configuration (Local)
{
"mcpServers": {
"opentofu": {
"command": "npx",
"args": ["-y", "@opentofu/opentofu-mcp-server"]
}
}
}Available Tools
The OpenTofu MCP server provides the following tools:
Registry Search and Information
search-opentofu-registry: Search for providers, modules, resources, and data sourcesget-provider-details: Get detailed information about a specific providerget-module-details: Get detailed information about a specific moduleget-resource-docs: Get documentation for a specific resourceget-datasource-docs: Get documentation for a specific data source
Available Tools
5 toolsget-datasource-docsA
Get detailed documentation for a specific OpenTofu data source by provider namespace, provider name, and data source name.
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes | Provider namespace (e.g., 'hashicorp', 'opentofu') | |
| name | Yes | Provider name WITHOUT 'terraform-provider-' prefix (e.g., 'aws', 'kubernetes') | |
| dataSource | Yes | Data source name WITHOUT provider prefix (e.g., 'ami', 'vpc') | |
| version | No | Provider version (e.g., 'v4.0.0'). If not specified, latest version will be used |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden for behavioral disclosure. It only states what the tool does (get documentation) without mentioning potential side effects, error conditions, or necessary context. For a read-only fetch tool, a note about network dependency or expected response format would improve transparency.
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, well-structured sentence that is front-loaded with the action and immediately specifies the required identifiers. No unnecessary words.
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?
The tool is simple with no output schema. The description is adequate for understanding the tool's purpose but lacks details on expected output format or any prerequisites. Considering the context (low complexity, full schema coverage), a score of 3 is reasonable.
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% (all parameters have descriptions in the schema). The tool description merely summarizes the parameter roles without adding new meaning beyond what the schema provides. Baseline of 3 is appropriate.
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 documentation) and the target (a specific OpenTofu data source) with required identifiers (namespace, provider name, data source name). This distinguishes it from sibling tools like get-resource-docs and get-module-details, which target different entity types.
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 for data source documentation but does not explicitly state when not to use it or suggest alternatives. While the sibling names hint at differentiation, explicit exclusion (e.g., 'not for resources or modules') would make it a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-module-detailsA
Get detailed information about a specific OpenTofu module by namespace, name, and target. Use the simple module name, NOT the full repository name.
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes | Module namespace without prefix (e.g., 'terraform-aws-modules') | |
| name | Yes | Simple module name WITHOUT 'terraform-aws-' or similar prefix (e.g., 'vpc', 's3-bucket') | |
| target | Yes | Module target platform (e.g., 'aws', 'kubernetes', 'azurerm') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description only says 'get detailed information', implying a read operation but without explicit details on side effects, permissions, or rate limits. This is insufficient disclosure for a tool with no annotations.
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?
Two concise sentences with no wasted words. The most important information is front-loaded.
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?
No output schema is provided, and the description does not describe what 'detailed information' includes, leaving the agent without a clear expectation of the return structure.
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?
Input schema has 100% coverage with descriptions for all three parameters. The description reinforces the 'simple module name' rule, adding marginal value beyond the schema.
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 retrieves detailed information about an OpenTofu module using namespace, name, and target. It distinguishes from sibling tools which focus on datasource docs, provider details, etc.
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 explicitly instructs to use the simple module name, not the full repository name, which helps prevent errors. However, it does not explicitly compare to sibling tools or state when to use this tool over others.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-provider-detailsB
Get detailed information about a specific OpenTofu provider by namespace and name. Do NOT include 'terraform-provider-' prefix in the name.
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes | Provider namespace (e.g., 'hashicorp', 'opentofu') | |
| name | Yes | Provider name WITHOUT 'terraform-provider-' prefix (e.g., 'aws', 'kubernetes', 'azurerm') |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description should disclose behavioral traits. It only mentions a naming constraint, not side effects, read-only nature, error handling, or authentication needs. The 'detailed information' output is unspecified.
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 sentence with two clear instructions. It is concise and front-loaded, though it could briefly mention what 'detailed information' includes.
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?
With no output schema, the description fails to explain the return structure or content of 'detailed information'. For a data retrieval tool, this is a significant gap.
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 coverage is 100% and already describes both parameters with examples. The description repeats the prefix rule without adding new meaning, so no extra value beyond the schema baseline.
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 retrieves detailed information about an OpenTofu provider by namespace and name. It distinguishes from sibling tools (e.g., get-datasource-docs, get-resource-docs) which target different entities.
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?
Usage is implied: use when you need provider details. The prefix rule provides guidance for the name parameter, but there is no explicit advice on when to choose this tool over siblings or any exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-resource-docsA
Get detailed documentation for a specific OpenTofu resource by provider namespace, provider name, and resource name.
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | Yes | Provider namespace (e.g., 'hashicorp', 'opentofu') | |
| name | Yes | Provider name WITHOUT 'terraform-provider-' prefix (e.g., 'aws', 'kubernetes') | |
| resource | Yes | Resource name WITHOUT provider prefix (e.g., 's3_bucket', 'instance') | |
| version | No | Provider version (e.g., 'v4.0.0'). If not specified, latest version will be used |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description must convey behavioral traits. It describes a read operation but does not explicitly state read-only nature, absence of side effects, or any prerequisites. The description is minimal but non-contradictory.
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 sentence that conveys the essential purpose without extraneous words. It is front-loaded with the action and resource, making it efficient for an agent to parse.
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, the description adequately covers the main purpose and required parameters. The optional 'version' parameter is omitted from the description but is present in the schema, which is acceptable. No output schema exists, so return value explanation is not needed.
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 coverage is 100%, so the baseline is 3. The description names three parameters (namespace, provider name, resource name) but adds no additional semantics beyond the schema descriptions. The optional 'version' parameter is not mentioned in the description.
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 specifies the action ('Get detailed documentation') and the resource ('specific OpenTofu resource'), and identifies the three key identifiers (provider namespace, provider name, resource name). It clearly distinguishes from siblings like get-datasource-docs, which target different entity types.
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 for fetching resource docs but offers no explicit guidance on when to use this tool over siblings (e.g., get-datasource-docs) or when not to use it. No exclusion criteria or context are provided, leaving the agent to infer usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search-opentofu-registryA
Search the OpenTofu Registry to find providers, modules, resources, and data sources. Use simple terms without prefixes like 'terraform-provider-' or 'terraform-module-'.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query for finding OpenTofu components (e.g., 'aws', 'kubernetes', 'database', 's3') | |
| type | No | Type of registry items to search for | all |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries the burden. It discloses the search action and prefix advice but omits details about result format, pagination, or error handling. Adequate but could be improved.
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?
Two sentences, no wasted words. First sentence states purpose, second gives usage tip. Front-loaded and efficient.
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?
No output schema, but the tool is simple. The description covers the core behavior and parameter hints. Could mention return format, but it's sufficient given 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?
Schema has 100% description coverage, so both parameters are already documented. The description adds practical advice for the query parameter (omit prefixes), which adds value beyond the schema.
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 searches the OpenTofu Registry for providers, modules, resources, and data sources. It differentiates from siblings (which retrieve specific docs) by being a general search tool.
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?
Provides explicit guidance to use simple terms without prefixes, which is helpful. Does not explicitly state when not to use or alternatives, but siblings are distinct enough that confusion is unlikely.
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
v0.1.4- Changed
get-datasource-docs1 field changed- removed
Input schema / additionalPropertiesRemoved value: -false
- Changed
get-module-details1 field changed- removed
Input schema / additionalPropertiesRemoved value: -false
- Changed
get-provider-details1 field changed- removed
Input schema / additionalPropertiesRemoved value: -false
- Changed
get-resource-docs1 field changed- removed
Input schema / additionalPropertiesRemoved value: -false
- Changed
search-opentofu-registry1 field changed- removed
Input schema / additionalPropertiesRemoved value: -false
5 tool updates
- First observed
get-datasource-docs - First observed
get-module-details - First observed
get-provider-details - First observed
get-resource-docs - First observed
search-opentofu-registry
TDQS
Each tool has a clearly distinct purpose: one for data source docs, one for module details, one for provider details, one for resource docs, and one for general search. No overlap or ambiguity.
Four tools follow a 'get-<object>-<suffix>' pattern using kebab-case, while the fifth uses 'search-<target>'. This is mostly consistent with a minor deviation, but still predictable.
Five tools is well-scoped for a registry query server, covering the main object types (providers, modules, resources, data sources) plus a search function. No tools are extraneous.
The tool set provides documentation and details for all major registry entities, and a general search covers discovery. Missing direct listing tools, but search mitigates this gap.
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
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Search and browse every MCP server in the Model Context Protocol registry.
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceConnects AI models to the Terraform Registry via MCP, enabling provider lookups, resource usage examples, and module recommendations for streamlined Terraform workflows.595120MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server for producing better Terraform through CLI analysis (tflint, checkov, trivy, kics, infracost), best-practice guidance from terraform-best-practices.com, cloud provider recommendations (Azure, AWS, GCP), and Terraform Registry resource and module guidance.18651MIT
- AlicenseNot gradedqualityDmaintenanceModel Context Protocol server that standardizes tool discovery, execution, and context management for AI applications.MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server for querying package registries (npm, PyPI, crates.io) to retrieve metadata, release timelines, and maintenance signals.1-
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/opentofu/opentofu-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server