Skip to main content
Glama
OpenTofu MCP Server

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.

Inputs: namespace (required), name (required), dataSource (required), version.

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.

Inputs: namespace (required), name (required), target (required).

get-provider-detailsB

Get detailed information about a specific OpenTofu provider by namespace and name. Do NOT include 'terraform-provider-' prefix in the name.

Inputs: namespace (required), name (required).

get-resource-docsA

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

Inputs: namespace (required), name (required), resource (required), version.

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

Inputs: query (required), type.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 5 tools

    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

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers