Skip to content

Updating documentation for Terraform MCP Server #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gautambaghel
Copy link
Member

No description provided.

@gautambaghel gautambaghel self-assigned this Aug 6, 2025
@gautambaghel gautambaghel added documentation Improvements or additions to documentation Terraform labels Aug 6, 2025
@gautambaghel gautambaghel requested a review from a team as a code owner August 6, 2025 01:10
Copy link

github-actions bot commented Aug 6, 2025

Vercel Previews Deployed

Name Status Preview Updated (UTC)
Dev Portal ✅ Ready (Inspect) Visit Preview Thu Aug 7 01:55:59 UTC 2025
Unified Docs API ✅ Ready (Inspect) Visit Preview Thu Aug 7 01:50:34 UTC 2025

Copy link

github-actions bot commented Aug 6, 2025

Broken Link Checker

Summary

Status Count
🔍 Total 20
✅ Successful 19
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 0
❓ Unknown 0
🚫 Errors 1

Errors per input

Errors in content/terraform-docs-common/docs/docs/tools/mcp-server/index.mdx

Copy link
Contributor

@trujillo-adam trujillo-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. The additions and edits to the overview page are great.
The changes introduce some inconsistencies with our information architecture principles and styles. I didn't make suggestions for all of the style guide violations, but we can address them after you've had a chance to process this feedback.


@include 'beta.mdx'

## Overview

Complete the following steps to deploy the server.
The Terraform MCP server is a specialized service that provides AI models with access to current Terraform provider documentation and module information. You can deploy the server in two environments:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Terraform MCP server is a specialized service that provides AI models with access to current Terraform provider documentation and module information. You can deploy the server in two environments:
The Terraform MCP server is a specialized service that provides AI models with access to current Terraform provider documentation and module information. You can deploy the server in to the following environments:


When you connect an AI model to the Terraform MCP server, the model gains access to specialized tools that can:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When you connect an AI model to the Terraform MCP server, the model gains access to specialized tools that can:
When you connect an AI model to the Terraform MCP server, the model gains access to specialized tools that can perform the following actions:

Comment on lines 27 to 29
1. **Search and retrieve** current provider documentation
2. **Access module information** including inputs, outputs, and examples
3. **Find Sentinel policies** for governance and compliance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. **Search and retrieve** current provider documentation
2. **Access module information** including inputs, outputs, and examples
3. **Find Sentinel policies** for governance and compliance
1. Search and retrieve current provider documentation
1. Access module information, including inputs, outputs, and examples
1. Find Sentinel policies for governance and compliance


**Important note**: The server specifically handles registry-based information. For general Terraform questions or code generation requests not requiring registry data, AI models use their standard training data and other sources.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Important note**: The server specifically handles registry-based information. For general Terraform questions or code generation requests not requiring registry data, AI models use their standard training data and other sources.
The server specifically handles registry-based information. For general Terraform questions or code generation requests not requiring registry data, AI models use their standard training data and other sources.


The following table describes tools available in the Terraform MCP server:
Setting up and using the Terraform MCP server involves three main steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Setting up and using the Terraform MCP server involves three main steps:
Complete the following steps to set up the Terraform MCP server:

```shell-session
$ go install github.com/hashicorp/terraform-mcp-server/cmd/terraform-mcp-server@main
```

After pulling the image, add the following JSON block to your client and specify the path to the server binary in the `command` attribute:
**Client configuration:**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Client configuration:**


After installation, add this configuration to your client:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After installation, add this configuration to your client:
After installation, add the following configuration to your client:

It would be ideal to use an ordered list for this section. Bolded text as headings is inconsistent with our formatting styles.

  1. Pull the source
  2. Configure the client

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but the two choices above are either/or ... if we order list them it'll feel like users have to do both step-by-step

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the bolded text headings though

| `MCP_ALLOWED_ORIGINS` | CORS allowed origins | `""` (none) | `https://app.terraform.io` |
| `MCP_CORS_MODE` | CORS policy enforcement | `strict` | `development` |

**Note:** The legacy `TRANSPORT_MODE=http` value is still supported but `streamable-http` is recommended for new deployments.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Note:** The legacy `TRANSPORT_MODE=http` value is still supported but `streamable-http` is recommended for new deployments.


| Variable | Purpose | Default Value | Example |
|----------|---------|---------------|---------|
| `TRANSPORT_MODE` | Communication protocol | `stdio` | `streamable-http` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `TRANSPORT_MODE` | Communication protocol | `stdio` | `streamable-http` |
| `TRANSPORT_MODE` | Communication protocol. The legacy `http` value is still supported, but we recommend `streamable-http` for new deployments. | `stdio` | `streamable-http` |

Start or restart Docker to start the container using the standard transport.
The binary location depends on your Go installation and `GOPATH` configuration. Use `which terraform-mcp-server` to find the installed binary path.

## Configuration options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Configuration options
## Configuration reference
You can configure the following options when deploying the MCP server.

We should move this section to a new reference.mdx page. At the very least, we should place this section after Next steps, which marks the end of the instructions. This page would still be half instructions and half reference, but at least the reference would appear at the bottom.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, on second read I don't think we should have a second file for the reference because we use these options during the deployment itself, meaning these should be considered during deployment.

It's unlike other tools where you interact with flags or other things after deployment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Terraform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants