mcpField
O
Opentofu

Opentofu

Local
github.com/opentofuCloud & Infra112Updated 8w ago

About Opentofu

The OpenTofu MCP server gives language model assistants access to the OpenTofu Registry. It covers providers, modules, resources and data sources. It runs as a local Node.js server or as a remote Cloudflare Worker deployment.

Key features

  1. 01Search providers and modules in the OpenTofu Registry
  2. 02Retrieve detailed provider and module information
  3. 03Access resource and data source documentation
  4. 04Available as local or hosted remote server

Use cases

  1. 01Finding a suitable provider while writing OpenTofu configuration
  2. 02Looking up module usage and resource documentation

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"opentofu": {
"command": "npx",
"args": [
"-y",
"@opentofu/opentofu-mcp-server"
]
}
}
}
Run commandnpx -y @opentofu/opentofu-mcp-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@opentofu/opentofu-mcp-server

Tools

5

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
querystringYesSearch query for finding OpenTofu components (e.g., 'aws', 'kubernetes', 'database', 's3')
typeenumNoType of registry items to search forprovider | module | resource | data-source | all

Details

From the project README

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

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.