-
Notifications
You must be signed in to change notification settings - Fork 188
Configuration option terraform.mcp.server.enable to enable or disable HashiCorp Terraform MCP Server integration
#2106
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cc5a2c2
feat(mcp-server-integration): TF-28514 TF-30372: Added: enable / disa…
anubhav-goel 300f4b2
feat(mcp-server-integration): TF-28514 TF-30372: Added: changelog
anubhav-goel fa49af9
feat(mcp-server-integration): TF-28514 TF-30372: Refactored: linting
anubhav-goel c176164
feat(mcp-server-integration): TF-28514 TF-30372: Refactored: checking…
anubhav-goel 6336250
feat(mcp-server-integration): TF-28514 TF-30372: Modified: enabled to…
anubhav-goel 74a17d3
feat(mcp-server-integration): TF-28514 TF-30372: Modified: enabled to…
anubhav-goel f610d7f
feat(mcp-server-integration): TF-28514 TF-30372: Modified: if not our…
anubhav-goel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| kind: ENHANCEMENTS | ||
| body: Configuration option `terraform.mcp.server.enabled` to enable or disable HashiCorp Terraform MCP Server integration | ||
| time: 2025-09-09T16:33:30.998854+05:30 | ||
| custom: | ||
| Issue: "2106" | ||
| Repository: vscode-terraform | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| /** | ||
| * Copyright (c) HashiCorp, Inc. | ||
| * SPDX-License-Identifier: MPL-2.0 | ||
| */ | ||
|
|
||
| import * as vscode from 'vscode'; | ||
| import { config, getScope } from '../utils/vscode'; | ||
|
|
||
| export class McpServerCommands implements vscode.Disposable { | ||
| constructor(private context: vscode.ExtensionContext) { | ||
| this.context.subscriptions.push( | ||
| vscode.commands.registerCommand('terraform.enableMcpServer', async () => { | ||
| if (config('terraform').get('mcp.server.enabled') === true) { | ||
anubhav-goel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return; | ||
| } | ||
|
|
||
| const scope: vscode.ConfigurationTarget = getScope('terraform', 'mcp.server.enabled'); | ||
anubhav-goel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| await config('terraform').update('mcp.server.enabled', true, scope); | ||
anubhav-goel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }), | ||
| vscode.commands.registerCommand('terraform.disableMcpServer', async () => { | ||
| if (config('terraform').get('mcp.server.enabled') === false) { | ||
anubhav-goel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
anubhav-goel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return; | ||
| } | ||
|
|
||
| const scope: vscode.ConfigurationTarget = getScope('terraform', 'mcp.server.enabled'); | ||
anubhav-goel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| await config('terraform').update('mcp.server.enabled', false, scope); | ||
anubhav-goel marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }), | ||
| ); | ||
| } | ||
|
|
||
| dispose(): void { | ||
| // context.subscriptions will be disposed by the extension, so any explicit code should not be required. | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.