No description
  • TypeScript 98.4%
  • JavaScript 1.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
James Humphries ad9e50780d
Merge pull request #18 from opentofu/list-provider-versions
Added tools to fetch structured data for module and provider versions
2026-07-15 13:43:03 +01:00
.github/workflows Update actions 2026-07-09 10:13:43 +01:00
src Added tools to fetch structured data for module and provider versions 2026-07-15 10:56:11 +01:00
.gitignore Added cloudflare worker 2025-05-23 14:44:49 +01:00
AI-USAGE-POLICY.md sync AI usage policy from opentofu/org 2026-07-09 10:06:27 +00:00
biome.json node and package bump 2026-04-08 13:11:10 +01:00
CONTRIBUTING.md added contributing.md 2025-05-22 15:03:03 +01:00
LICENSE Initial commit 2025-05-22 11:33:01 +01:00
package.json Pin typescript version to 5.x and regenned API 2026-07-09 10:16:18 +01:00
pnpm-lock.yaml Pin typescript version to 5.x and regenned API 2026-07-09 10:16:18 +01:00
README.md Migrate from McpAgent to stateless createMcpHandler 2026-04-13 12:39:01 +01:00
tsconfig.json Update MCP server packages, introduce improved tracing for CF worker 2026-07-09 10:00:36 +01:00
worker-configuration.d.ts Update MCP server packages, introduce improved tracing for CF worker 2026-07-09 10:00:36 +01:00
wrangler.jsonc Update MCP server packages, introduce improved tracing for CF worker 2026-07-09 10:00:36 +01:00

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:

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