Skip to main content
Glama
opentofu

OpenTofu MCP Server

Official
by opentofu

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:

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/mcp

Cursor / 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-server

Global Installation

Install globally for repeated use:

npm install -g @opentofu/opentofu-mcp-server
opentofu-mcp-server

Claude Code (Local)

Add the local server to Claude Code:

claude mcp add opentofu -- npx @opentofu/opentofu-mcp-server

Generic 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 sources

  • get-provider-details: Get detailed information about a specific provider

  • get-module-details: Get detailed information about a specific module

  • get-resource-docs: Get documentation for a specific resource

  • get-datasource-docs: Get documentation for a specific data source

Available Tools

5 tools
get-datasource-docsA

Get detailed documentation for a specific OpenTofu data source by provider namespace, provider name, and data source name.

ParametersJSON Schema
NameRequiredDescriptionDefault
namespaceYesProvider namespace (e.g., 'hashicorp', 'opentofu')
nameYesProvider name WITHOUT 'terraform-provider-' prefix (e.g., 'aws', 'kubernetes')
dataSourceYesData source name WITHOUT provider prefix (e.g., 'ami', 'vpc')
versionNoProvider version (e.g., 'v4.0.0'). If not specified, latest version will be used

TDQS

A3.7/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
namespaceYesModule namespace without prefix (e.g., 'terraform-aws-modules')
nameYesSimple module name WITHOUT 'terraform-aws-' or similar prefix (e.g., 'vpc', 's3-bucket')
targetYesModule target platform (e.g., 'aws', 'kubernetes', 'azurerm')

TDQS

A3.6/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
namespaceYesProvider namespace (e.g., 'hashicorp', 'opentofu')
nameYesProvider name WITHOUT 'terraform-provider-' prefix (e.g., 'aws', 'kubernetes', 'azurerm')

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
namespaceYesProvider namespace (e.g., 'hashicorp', 'opentofu')
nameYesProvider name WITHOUT 'terraform-provider-' prefix (e.g., 'aws', 'kubernetes')
resourceYesResource name WITHOUT provider prefix (e.g., 's3_bucket', 'instance')
versionNoProvider version (e.g., 'v4.0.0'). If not specified, latest version will be used

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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-'.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for finding OpenTofu components (e.g., 'aws', 'kubernetes', 'database', 's3')
typeNoType of registry items to search forall

TDQS

A4.2/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

  1. 5 tool updatesv0.1.4
    • Changedget-datasource-docs1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
    • Changedget-module-details1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
    • Changedget-provider-details1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
    • Changedget-resource-docs1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
    • Changedsearch-opentofu-registry1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
  2. 5 tool updates
    • First observedget-datasource-docs
    • First observedget-module-details
    • First observedget-provider-details
    • First observedget-resource-docs
    • First observedsearch-opentofu-registry

TDQS

A3.8/5.0
Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessResponsive

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

Related MCP Servers

Latest Blog Posts

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