Get the FREE Ultimate OpenClaw Setup Guide →

opentofu

OpenTofu MCP Server for accessing the OpenTofu Registry

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio opentofu-opentofu-mcp-server npx -y @opentofu/opentofu-mcp-server

How to use

The OpenTofu MCP Server provides an MCP-compatible interface to search the OpenTofu Registry and retrieve detailed information about providers, modules, resources, and data sources. It also serves comprehensive OpenTofu configuration examples and documentation through a consistent API that AI assistants can query. You can run the server locally with npx or use the hosted Cloudflare-backed service, and then connect your client or IDE tools to the MCP endpoint to perform searches, fetch provider/module details, and obtain resource/docs content. The available tooling includes search, provider/module detail lookups, and docs retrieval for resources and data sources, enabling you to build richer AI-assisted OpenTofu workflows.

How to install

Prerequisites:

  • Node.js and npm installed on your machine (Node.js 14+ recommended).
  • Internet access to install the MCP server via npm/pnpm/yarn.

Local installation and run:

  1. Ensure you have Node.js and npm: node -v npm -v
  2. Run the MCP server locally using npx (no global install required): npx @opentofu/opentofu-mcp-server
  3. Alternatively, install globally for repeated use: npm install -g @opentofu/opentofu-mcp-server opentofu-mcp-server

Configuration examples:

  • Basic local configuration (JSON): { "mcpServers": { "opentofu": { "command": "npx", "args": ["-y", "@opentofu/opentofu-mcp-server"] } } }

Notes:

  • If you prefer using the hosted service, see the hosted configuration options in the README (no local install required).
  • The server supports standard MCP client configurations and can be integrated into editors like Claude Code or Cursor via the provided snippets.

Additional notes

Tips and common topics:

  • The hosted service URL for the MCP stream is https://mcp.opentofu.org/sse. Use this for quick testing or to avoid local setup.
  • If you run locally, you can query for registry data using the following tools exposed by the server: search-opentofu-registry, get-provider-details, get-module-details, get-resource-docs, get-datasource-docs.
  • In environments behind proxies, ensure Node.js can access the internet to fetch the MCP server package when using npx.
  • If you need a different transport (e.g., SSE vs other MCP transports), adjust the mcpServers entry accordingly in your client configuration.
  • For automation, you can embed the mcp config into your app startup or CI workflows to ensure consistent MCP endpoints across environments.

Related MCP Servers

Sponsor this space

Reach thousands of developers