@downatthebottomofthemolehole/terraform-best-practices-mcp-server 0.1.0 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +503 -49
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +1 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/lib/exec.d.ts +20 -0
  6. package/dist/lib/exec.js +1 -0
  7. package/dist/lib/exec.js.map +1 -0
  8. package/dist/lib/http.d.ts +1 -0
  9. package/dist/lib/http.js +1 -0
  10. package/dist/lib/http.js.map +1 -0
  11. package/dist/lib/text.d.ts +2 -0
  12. package/dist/lib/text.js +1 -0
  13. package/dist/lib/text.js.map +1 -0
  14. package/dist/tools/analyze_state_management.d.ts +25 -0
  15. package/dist/tools/analyze_state_management.js +166 -0
  16. package/dist/tools/analyze_state_management.js.map +1 -0
  17. package/dist/tools/analyze_terraform_code.d.ts +16 -0
  18. package/dist/tools/analyze_terraform_code.js +113 -0
  19. package/dist/tools/analyze_terraform_code.js.map +1 -0
  20. package/dist/tools/analyze_terraform_performance.d.ts +22 -0
  21. package/dist/tools/analyze_terraform_performance.js +150 -0
  22. package/dist/tools/analyze_terraform_performance.js.map +1 -0
  23. package/dist/tools/common.d.ts +21 -0
  24. package/dist/tools/common.js +1 -0
  25. package/dist/tools/common.js.map +1 -0
  26. package/dist/tools/fetch_provider_best_practices.d.ts +18 -0
  27. package/dist/tools/fetch_provider_best_practices.js +1 -0
  28. package/dist/tools/fetch_provider_best_practices.js.map +1 -0
  29. package/dist/tools/fetch_terraform_best_practices.d.ts +15 -0
  30. package/dist/tools/fetch_terraform_best_practices.js +1 -0
  31. package/dist/tools/fetch_terraform_best_practices.js.map +1 -0
  32. package/dist/tools/fetch_terraform_registry_guidance.d.ts +24 -0
  33. package/dist/tools/fetch_terraform_registry_guidance.js +1 -0
  34. package/dist/tools/fetch_terraform_registry_guidance.js.map +1 -0
  35. package/dist/tools/generate_compliance_summary.d.ts +22 -0
  36. package/dist/tools/generate_compliance_summary.js +114 -0
  37. package/dist/tools/generate_compliance_summary.js.map +1 -0
  38. package/dist/tools/generate_cost_report.d.ts +16 -0
  39. package/dist/tools/generate_cost_report.js +89 -0
  40. package/dist/tools/generate_cost_report.js.map +1 -0
  41. package/dist/tools/generate_terraform_module_docs.d.ts +22 -0
  42. package/dist/tools/generate_terraform_module_docs.js +221 -0
  43. package/dist/tools/generate_terraform_module_docs.js.map +1 -0
  44. package/dist/tools/index.d.ts +2 -0
  45. package/dist/tools/index.js +22 -1
  46. package/dist/tools/index.js.map +1 -0
  47. package/dist/tools/recommend_terraform_modules.d.ts +22 -0
  48. package/dist/tools/recommend_terraform_modules.js +239 -0
  49. package/dist/tools/recommend_terraform_modules.js.map +1 -0
  50. package/dist/tools/run_checkov.d.ts +17 -0
  51. package/dist/tools/run_checkov.js +1 -0
  52. package/dist/tools/run_checkov.js.map +1 -0
  53. package/dist/tools/run_infracost.d.ts +17 -0
  54. package/dist/tools/run_infracost.js +1 -0
  55. package/dist/tools/run_infracost.js.map +1 -0
  56. package/dist/tools/run_kics.d.ts +17 -0
  57. package/dist/tools/run_kics.js +1 -0
  58. package/dist/tools/run_kics.js.map +1 -0
  59. package/dist/tools/run_tflint.d.ts +17 -0
  60. package/dist/tools/run_tflint.js +1 -0
  61. package/dist/tools/run_tflint.js.map +1 -0
  62. package/dist/tools/run_trivy.d.ts +17 -0
  63. package/dist/tools/run_trivy.js +1 -0
  64. package/dist/tools/run_trivy.js.map +1 -0
  65. package/dist/tools/suggest_security_hardening.d.ts +16 -0
  66. package/dist/tools/suggest_security_hardening.js +73 -0
  67. package/dist/tools/suggest_security_hardening.js.map +1 -0
  68. package/dist/tools/suggest_terraform_architecture.d.ts +31 -0
  69. package/dist/tools/suggest_terraform_architecture.js +194 -0
  70. package/dist/tools/suggest_terraform_architecture.js.map +1 -0
  71. package/dist/tools/suggest_terraform_testing_strategy.d.ts +25 -0
  72. package/dist/tools/suggest_terraform_testing_strategy.js +148 -0
  73. package/dist/tools/suggest_terraform_testing_strategy.js.map +1 -0
  74. package/dist/tools/types.d.ts +8 -0
  75. package/dist/tools/types.js +1 -0
  76. package/dist/tools/types.js.map +1 -0
  77. package/mcp.json +1 -1
  78. package/package.json +7 -4
package/README.md CHANGED
@@ -1,26 +1,327 @@
1
- # terraform-best-practices-mcp
1
+ # Terraform Best Practices MCP Server
2
2
 
3
- An MCP server that helps teams produce better Terraform by combining:
3
+ <!-- mcp-name: io.github.DownAtTheBottomOfTheMoleHole/terraform-best-practices -->
4
4
 
5
- - CLI analysis: `tflint`, `checkov`, `trivy`, `kics`, `infracost`
6
- - Best-practice retrieval from `terraform-best-practices.com`
7
- - Cloud provider guidance for `azure`, `aws`, and `gcp`
8
- - Terraform Registry guidance for providers/resources/modules
5
+ [![CI/Publish](https://github.com/DownAtTheBottomOfTheMoleHole/terraform-best-practices-mcp/actions/workflows/publish-mcp.yml/badge.svg)](https://github.com/DownAtTheBottomOfTheMoleHole/terraform-best-practices-mcp/actions/workflows/publish-mcp.yml)
6
+ [![Coverage](https://codecov.io/github/DownAtTheBottomOfTheMoleHole/terraform-best-practices-mcp/graph/badge.svg?branch=main)](https://codecov.io/github/DownAtTheBottomOfTheMoleHole/terraform-best-practices-mcp)
7
+ [![npm](https://img.shields.io/npm/v/@downatthebottomofthemolehole/terraform-best-practices-mcp-server.svg)](https://registry.npmjs.org/@downatthebottomofthemolehole/terraform-best-practices-mcp-server)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
9
+ [![Node Version](https://img.shields.io/badge/node-%3E%3D24.14.0-brightgreen)](https://nodejs.org/)
9
10
 
10
- ## Tool Catalog
11
+ > **Note:** This is a community-maintained MCP server. It is not an official Model Context Protocol server from HashiCorp or any cloud provider.
11
12
 
12
- - `run_tflint`
13
- - `run_checkov`
14
- - `run_trivy`
15
- - `run_kics`
16
- - `run_infracost`
17
- - `fetch_terraform_best_practices`
18
- - `fetch_provider_best_practices`
19
- - `fetch_terraform_registry_guidance`
13
+ A Model Context Protocol (MCP) server for producing better Terraform through CLI analysis (`tflint`, `checkov`, `trivy`, `kics`, `infracost`), best-practice guidance from [terraform-best-practices.com](https://www.terraform-best-practices.com/), cloud provider recommendations (Azure, AWS, GCP), and Terraform Registry resource and module guidance.
20
14
 
21
- ## Prerequisites
15
+ ## Overview
22
16
 
23
- - Node.js 24+
17
+ This server provides eighteen MCP tools across CLI analysis, best-practice retrieval, and interactive reporting workflows:
18
+
19
+ - `run_tflint` to lint Terraform code.
20
+ - `run_checkov` to run security and compliance scanning.
21
+ - `run_trivy` to scan Terraform configuration for vulnerabilities.
22
+ - `run_kics` to run IaC security and compliance scanning.
23
+ - `run_infracost` to estimate cloud costs.
24
+ - `fetch_terraform_best_practices` to retrieve curated Terraform best practices.
25
+ - `fetch_provider_best_practices` to retrieve cloud provider Terraform guidance.
26
+ - `fetch_terraform_registry_guidance` to retrieve Terraform Registry resource and module guidance.
27
+ - `analyze_terraform_code` to analyze code structure, modularity, and best practices.
28
+ - `analyze_terraform_performance` to identify runtime and performance bottlenecks.
29
+ - `analyze_state_management` to assess backend state strategy and collaboration safety.
30
+ - `generate_cost_report` to generate cost analysis with optimization suggestions.
31
+ - `generate_terraform_module_docs` to produce module documentation from Terraform code.
32
+ - `recommend_terraform_modules` to recommend reusable modules from detected patterns.
33
+ - `suggest_terraform_architecture` to suggest multi-environment and multi-region patterns.
34
+ - `suggest_terraform_testing_strategy` to recommend CI-driven testing by risk profile.
35
+ - `suggest_security_hardening` to provide security hardening recommendations.
36
+ - `generate_compliance_summary` to create compliance reports from scan outputs.
37
+
38
+ ### Platform Compatibility
39
+
40
+ This MCP server is platform-agnostic and works in local and CI environments:
41
+
42
+ - Local development
43
+ - GitHub Actions
44
+ - GitLab CI/CD
45
+ - Azure DevOps
46
+ - CircleCI, Jenkins, and Bitbucket Pipelines
47
+ - AI Agents and Copilot workflows
48
+
49
+ The primary requirements are Node.js and optionally the CLI tools on `PATH`. If a CLI is missing, the server returns installation guidance instead of failing silently.
50
+
51
+ ### Tool Matrix
52
+
53
+ | Tool | Category | Typical outcome |
54
+ | --- | --- | --- |
55
+ | `run_tflint` | CLI Analysis | Lint findings for Terraform code |
56
+ | `run_checkov` | CLI Analysis | Security and compliance scan results |
57
+ | `run_trivy` | CLI Analysis | Vulnerability scan results for IaC |
58
+ | `run_kics` | CLI Analysis | IaC security findings |
59
+ | `run_infracost` | CLI Analysis | Monthly cost baseline for current IaC |
60
+ | `fetch_terraform_best_practices` | Guidance | Curated best-practice checklist from terraform-best-practices.com |
61
+ | `fetch_provider_best_practices` | Guidance | Cloud provider (Azure/AWS/GCP) Terraform recommendations |
62
+ | `fetch_terraform_registry_guidance` | Guidance | Registry guidance for providers, resources, and modules |
63
+ | `analyze_terraform_code` | Analysis | Code structure and modularity assessment |
64
+ | `analyze_terraform_performance` | Analysis | Performance bottleneck and optimization report |
65
+ | `analyze_state_management` | Analysis | State backend strategy and collaboration safety review |
66
+ | `generate_cost_report` | Reporting | Cost analysis with optimization suggestions |
67
+ | `generate_terraform_module_docs` | Reporting | Generated module documentation markdown |
68
+ | `recommend_terraform_modules` | Reporting | Reusable module recommendations from code patterns |
69
+ | `suggest_terraform_architecture` | Architecture | Multi-environment and multi-region architecture patterns |
70
+ | `suggest_terraform_testing_strategy` | Testing | CI-driven testing strategy by risk profile |
71
+ | `suggest_security_hardening` | Security | Security hardening recommendations from scan output |
72
+ | `generate_compliance_summary` | Compliance | Compliance report from scan outputs |
73
+
74
+ ## Tools
75
+
76
+ ### `run_tflint`
77
+
78
+ Run tflint against a Terraform project directory.
79
+
80
+ Inputs:
81
+
82
+ - `path` (string, optional): Terraform project path to scan. Default: `.`.
83
+ - `extraArgs` (string[], optional): Extra CLI arguments.
84
+ - `timeoutMs` (integer, optional): Command timeout in milliseconds.
85
+
86
+ ### `run_checkov`
87
+
88
+ Run checkov over a Terraform directory.
89
+
90
+ Inputs:
91
+
92
+ - `path` (string, optional): Terraform project path to scan. Default: `.`.
93
+ - `extraArgs` (string[], optional): Extra CLI arguments.
94
+ - `timeoutMs` (integer, optional): Command timeout in milliseconds.
95
+
96
+ ### `run_trivy`
97
+
98
+ Run trivy config scanning against Terraform code.
99
+
100
+ Inputs:
101
+
102
+ - `path` (string, optional): Terraform project path to scan. Default: `.`.
103
+ - `extraArgs` (string[], optional): Extra CLI arguments.
104
+ - `timeoutMs` (integer, optional): Command timeout in milliseconds.
105
+
106
+ ### `run_kics`
107
+
108
+ Run kics IaC scanning against Terraform code.
109
+
110
+ Inputs:
111
+
112
+ - `path` (string, optional): Terraform project path to scan. Default: `.`.
113
+ - `extraArgs` (string[], optional): Extra CLI arguments.
114
+ - `timeoutMs` (integer, optional): Command timeout in milliseconds.
115
+
116
+ ### `run_infracost`
117
+
118
+ Run infracost breakdown for a Terraform directory.
119
+
120
+ Inputs:
121
+
122
+ - `path` (string, optional): Terraform project path to scan. Default: `.`.
123
+ - `extraArgs` (string[], optional): Extra CLI arguments.
124
+ - `timeoutMs` (integer, optional): Command timeout in milliseconds.
125
+
126
+ ### `fetch_terraform_best_practices`
127
+
128
+ Fetch Terraform best-practice guidance from curated checks and optional live summaries from terraform-best-practices.com.
129
+
130
+ Inputs:
131
+
132
+ - `topic` (string, optional): Topic filter such as state, modules, security, or naming.
133
+ - `liveFetch` (boolean, optional): When true, fetches and summarises live content. Default: `true`.
134
+
135
+ ### `fetch_provider_best_practices`
136
+
137
+ Fetch Terraform best-practice guidance for Azure, AWS, or GCP from curated checks and optional live provider docs summaries.
138
+
139
+ Inputs:
140
+
141
+ - `provider` (string, required): Cloud provider (`azure`, `aws`, or `gcp`).
142
+ - `topic` (string, optional): Focus area such as state, IAM, modules, networking, or cost.
143
+ - `liveFetch` (boolean, optional): When true, fetches and summarises the linked provider guidance page. Default: `true`.
144
+
145
+ ### `fetch_terraform_registry_guidance`
146
+
147
+ Fetch Terraform Registry guidance for providers, resources, and modules.
148
+
149
+ Inputs:
150
+
151
+ - `provider` (string, optional): Provider name (e.g. `aws`, `azurerm`, `google`).
152
+ - `resource` (string, optional): Resource type used with provider (e.g. `s3_bucket`, `resource_group`).
153
+ - `module` (string, optional): Module path in the form `namespace/name/provider`.
154
+ - `topic` (string, optional): Topic filter for the summary output.
155
+ - `liveFetch` (boolean, optional): When true, fetches and summarises selected Registry pages. Default: `true`.
156
+
157
+ ### `analyze_terraform_code`
158
+
159
+ Analyze Terraform code structure, modularity, and best practices.
160
+
161
+ Inputs:
162
+
163
+ - `code` (string, required): Terraform code snippet to analyze (max 50,000 chars).
164
+ - `focusArea` (string, optional): Analysis focus area (`modularity`, `variables`, `outputs`, `locals`, `general`). Default: `general`.
165
+
166
+ ### `analyze_terraform_performance`
167
+
168
+ Analyze Terraform runtime and performance bottlenecks and optimization opportunities.
169
+
170
+ Inputs:
171
+
172
+ - `terraformCode` (string, required): Terraform code for performance-focused heuristics.
173
+ - `stateSizeMb` (number, optional): State size in MB for scale-aware recommendations.
174
+ - `workspaceCount` (integer, optional): Number of workspaces sharing the same root stack.
175
+ - `providerRateLimitSensitive` (boolean, optional): When true, emphasise provider API throttling protections. Default: `true`.
176
+
177
+ ### `analyze_state_management`
178
+
179
+ Assess backend state strategy and collaboration safety.
180
+
181
+ Inputs:
182
+
183
+ - `terraformCode` (string, required): Terraform code including backend and state-related configuration.
184
+ - `teamSize` (integer, optional): Number of engineers applying Terraform changes. Default: `6`.
185
+ - `environmentCount` (integer, optional): Number of environments managed by the estate. Default: `2`.
186
+ - `currentBackend` (string, optional): State backend in use (`auto`, `s3`, `azurerm`, `gcs`, `remote`, `local`, `unknown`). Default: `auto`.
187
+ - `useWorkspaces` (boolean, optional): Whether multiple environments are managed through workspaces. Default: `false`.
188
+
189
+ ### `generate_cost_report`
190
+
191
+ Generate cost analysis with optimization suggestions from Infracost output.
192
+
193
+ Inputs:
194
+
195
+ - `infracostJson` (string, required): JSON output from infracost breakdown or diff command.
196
+ - `includeOptimizations` (boolean, optional): When true, generates cost optimization suggestions. Default: `true`.
197
+
198
+ ### `generate_terraform_module_docs`
199
+
200
+ Generate module documentation markdown from Terraform code.
201
+
202
+ Inputs:
203
+
204
+ - `terraformCode` (string, required): Terraform module code to document.
205
+ - `moduleName` (string, optional): Friendly name used in generated markdown docs. Default: `terraform-module`.
206
+ - `includeUsageExample` (boolean, optional): Include a usage example section. Default: `true`.
207
+ - `includeInputsOutputsTables` (boolean, optional): Render inputs and outputs as markdown tables. Default: `true`.
208
+
209
+ ### `recommend_terraform_modules`
210
+
211
+ Recommend reusable Terraform modules from detected code patterns.
212
+
213
+ Inputs:
214
+
215
+ - `terraformCode` (string, required): Terraform code used to infer module recommendations.
216
+ - `provider` (string, optional): Preferred cloud provider (`aws`, `azure`, `gcp`, `any`). Default: `any`.
217
+ - `deploymentIntent` (string, optional): Primary deployment goal (`networking`, `kubernetes`, `serverless`, `storage`, `database`, `observability`, `security`, `general`). Default: `general`.
218
+ - `maxRecommendations` (integer, optional): Maximum recommendations to return (1--10). Default: `5`.
219
+
220
+ ### `suggest_terraform_architecture`
221
+
222
+ Suggest architecture patterns for multi-environment and multi-region estates.
223
+
224
+ Inputs:
225
+
226
+ - `workloadType` (string, optional): Primary workload profile (`web-api`, `data-platform`, `event-driven`, `platform-foundation`, `general`). Default: `general`.
227
+ - `environments` (string[], optional): Target environments (`dev`, `test`, `stage`, `prod`, `sandbox`, `dr`). Default: `["dev", "prod"]`.
228
+ - `multiRegion` (boolean, optional): Whether workloads run across multiple regions. Default: `false`.
229
+ - `complianceProfile` (string, optional): Compliance profile (`none`, `cis`, `pci-dss`, `hipaa`, `sox`). Default: `none`.
230
+ - `teamSize` (integer, optional): Number of engineers operating Terraform code. Default: `6`.
231
+ - `currentPainPoints` (string, optional): Pain points or constraints in the current architecture.
232
+ - `includeReferenceLayout` (boolean, optional): Include a suggested repository and folder layout. Default: `true`.
233
+
234
+ ### `suggest_terraform_testing_strategy`
235
+
236
+ Recommend CI-driven Terraform testing strategy by risk profile.
237
+
238
+ Inputs:
239
+
240
+ - `terraformCode` (string, optional): Terraform code for complexity-aware recommendations.
241
+ - `deploymentCriticality` (string, optional): Business impact level (`low`, `medium`, `high`, `mission-critical`). Default: `medium`.
242
+ - `changeFrequency` (string, optional): How often infrastructure changes are introduced (`low`, `medium`, `high`). Default: `medium`.
243
+ - `ciSystem` (string, optional): Target CI system (`github-actions`, `azure-devops`, `gitlab`, `circleci`, `jenkins`, `other`). Default: `github-actions`.
244
+ - `includeExamplePipeline` (boolean, optional): Include an example pipeline sequence. Default: `true`.
245
+
246
+ ### `suggest_security_hardening`
247
+
248
+ Provide security hardening recommendations from scan output.
249
+
250
+ Inputs:
251
+
252
+ - `scanOutput` (string, required): Output from a security scanning tool (checkov, trivy, or kics).
253
+ - `scanTool` (string, optional): Name of the scanning tool (`checkov`, `trivy`, `kics`). Default: `checkov`.
254
+
255
+ ### `generate_compliance_summary`
256
+
257
+ Create compliance reports from scan outputs.
258
+
259
+ Inputs:
260
+
261
+ - `checkovOutput` (string, optional): Output from checkov scan.
262
+ - `trivyOutput` (string, optional): Output from trivy scan.
263
+ - `kicsOutput` (string, optional): Output from kics scan.
264
+ - `complianceFramework` (string, optional): Compliance framework to assess against (`cis`, `pci-dss`, `hipaa`, `sox`, `general`). Default: `general`.
265
+
266
+ ## Prompt Cookbook
267
+
268
+ Use these minimal prompts in Copilot Chat with `@tf-best-practices`. CLI tools default to the current workspace root when no `path` is provided. Adding `#file` or `#folder` context can improve chat understanding, but tool execution path is controlled by explicit tool inputs (for example, `path`).
269
+
270
+ ### Quick Start (Zero-Argument Prompts)
271
+
272
+ ```text
273
+ @tf-best-practices run run_tflint
274
+ @tf-best-practices run run_checkov
275
+ @tf-best-practices run run_trivy
276
+ @tf-best-practices run run_kics
277
+ @tf-best-practices run run_infracost
278
+ @tf-best-practices run fetch_terraform_best_practices
279
+ ```
280
+
281
+ ### CLI Analysis
282
+
283
+ ```text
284
+ @tf-best-practices run run_tflint with path ./modules/network
285
+ @tf-best-practices run run_checkov with path ./environments/prod
286
+ @tf-best-practices run run_trivy with path .
287
+ @tf-best-practices run run_kics with path .
288
+ @tf-best-practices run run_infracost with path .
289
+ ```
290
+
291
+ ### Best Practices and Guidance
292
+
293
+ ```text
294
+ @tf-best-practices run fetch_terraform_best_practices with topic modules
295
+ @tf-best-practices run fetch_provider_best_practices with provider azure
296
+ @tf-best-practices run fetch_terraform_registry_guidance with provider azurerm and resource resource_group
297
+ ```
298
+
299
+ ### Code Analysis
300
+
301
+ ```text
302
+ @tf-best-practices run analyze_terraform_code with code <paste code> and focusArea modularity
303
+ @tf-best-practices run analyze_terraform_performance with terraformCode <paste code>
304
+ @tf-best-practices run analyze_state_management with terraformCode <paste code>
305
+ ```
306
+
307
+ ### Reporting and Recommendations
308
+
309
+ ```text
310
+ @tf-best-practices run generate_cost_report with infracostJson <paste json>
311
+ @tf-best-practices run generate_terraform_module_docs with terraformCode <paste code>
312
+ @tf-best-practices run recommend_terraform_modules with terraformCode <paste code> and provider azure
313
+ @tf-best-practices run suggest_terraform_architecture with workloadType web-api and environments ["dev","stage","prod"]
314
+ @tf-best-practices run suggest_terraform_testing_strategy with ciSystem github-actions
315
+ @tf-best-practices run suggest_security_hardening with scanOutput <paste output> and scanTool checkov
316
+ @tf-best-practices run generate_compliance_summary with complianceFramework cis
317
+ ```
318
+
319
+ ## Dependencies
320
+
321
+ ### System Dependencies
322
+
323
+ - Node.js `>=24.14.0`
324
+ - npm (bundled with Node.js)
24
325
  - Optional CLIs available on `PATH` for command tools:
25
326
  - `tflint`
26
327
  - `checkov`
@@ -30,46 +331,41 @@ An MCP server that helps teams produce better Terraform by combining:
30
331
 
31
332
  If a CLI is missing, the server returns installation guidance instead of failing silently.
32
333
 
33
- ## Setup
34
-
35
- ```bash
36
- npm install
37
- npm run build
38
- ```
39
-
40
- ## Run
334
+ ### npm Dependencies
41
335
 
42
- ```bash
43
- npm run dev
44
- ```
336
+ Runtime:
45
337
 
46
- For production-style execution:
338
+ - `@modelcontextprotocol/sdk` (MCP server SDK)
339
+ - `zod` (input schema validation)
47
340
 
48
- ```bash
49
- npm run build
50
- npm start
51
- ```
341
+ Development:
52
342
 
53
- ## Publish
343
+ - `typescript` (build/compile)
344
+ - `tsx` (development runner)
345
+ - `vitest` (unit test runner)
346
+ - `@types/node` (Node.js typings)
54
347
 
55
- This package is configured for npm as:
348
+ ### Environment Variables
56
349
 
57
- - `@downatthebottomofthemolehole/terraform-best-practices-mcp-server`
350
+ - `INFRACOST_API_KEY`: Infracost API key for cloud-backed cost estimates.
58
351
 
59
- To publish:
352
+ ## Installation
60
353
 
61
354
  ```bash
62
- npm publish --access public
355
+ npm install
356
+ npm run build
63
357
  ```
64
358
 
65
- ## MCP Configuration
359
+ ## Configuration
66
360
 
67
- This project includes `.vscode/mcp.json`:
361
+ ### Usage with VS Code Copilot Chat
362
+
363
+ This workspace is preconfigured in `.vscode/mcp.json`:
68
364
 
69
365
  ```json
70
366
  {
71
367
  "servers": {
72
- "terraform-best-practices-mcp": {
368
+ "tf-best-practices": {
73
369
  "type": "stdio",
74
370
  "command": "npm",
75
371
  "args": ["run", "dev"]
@@ -78,15 +374,173 @@ This project includes `.vscode/mcp.json`:
78
374
  }
79
375
  ```
80
376
 
81
- Registry metadata files used by your other MCP repos are also included:
377
+ Reload VS Code (`Cmd+Shift+P` -> `Developer: Reload Window`) after changing MCP configuration.
82
378
 
83
- - `mcp.json`
84
- - `server.json`
379
+ Then query the server from Copilot Chat with `@tf-best-practices`, for example:
85
380
 
86
- ## References
381
+ ```text
382
+ @tf-best-practices run run_tflint
383
+ @tf-best-practices run fetch_terraform_best_practices with topic modules
384
+ ```
87
385
 
88
- - [MCP org](https://github.com/modelcontextprotocol)
89
- - [MCP docs](https://modelcontextprotocol.io/docs)
90
- - [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
91
- - [terraform-best-practices](https://www.terraform-best-practices.com/)
386
+ ### Usage with Other MCP Clients
387
+
388
+ Use stdio transport with the built entrypoint:
389
+
390
+ ```json
391
+ {
392
+ "name": "terraform-best-practices-mcp-server",
393
+ "type": "stdio",
394
+ "command": "node",
395
+ "args": ["/absolute/path/to/terraform-best-practices-mcp/dist/index.js"]
396
+ }
397
+ ```
398
+
399
+ Build first with `npm run build`, then start your MCP client.
400
+
401
+ ## Running
402
+
403
+ ```bash
404
+ npm start
405
+ ```
406
+
407
+ Development mode:
408
+
409
+ ```bash
410
+ npm run dev
411
+ ```
412
+
413
+ ## Debugging
414
+
415
+ Use `.vscode/launch.json`:
416
+
417
+ - `Debug MCP Server` (runs `npm run dev`)
418
+ - `Debug MCP Server (Built)` (runs `dist/index.js` after build)
419
+
420
+ Set breakpoints in `src/index.ts`, then press `F5`.
421
+
422
+ ## Testing
423
+
424
+ See [docs/TESTING.md](./docs/TESTING.md) for Copilot Chat scenarios, manual JSON-RPC checks, and troubleshooting guidance.
425
+
426
+ Quick validation prompt in Copilot Chat:
427
+
428
+ ```text
429
+ @tf-best-practices run run_tflint
430
+ ```
431
+
432
+ ## Interactive VS Code Workflows
433
+
434
+ ### 1. Security Triage
435
+
436
+ 1. Run a scan:
437
+
438
+ ```text
439
+ @tf-best-practices run run_checkov
440
+ ```
441
+
442
+ 1. Request hardening suggestions:
443
+
444
+ ```text
445
+ @tf-best-practices run suggest_security_hardening with scanOutput <paste checkov output> and scanTool checkov
446
+ ```
447
+
448
+ 1. Generate a compliance summary:
449
+
450
+ ```text
451
+ @tf-best-practices run generate_compliance_summary with checkovOutput <paste output> and complianceFramework cis
452
+ ```
453
+
454
+ ### 2. Cost Impact Review
455
+
456
+ 1. Generate a cost baseline:
457
+
458
+ ```text
459
+ @tf-best-practices run run_infracost
460
+ ```
461
+
462
+ 1. Produce a cost report:
463
+
464
+ ```text
465
+ @tf-best-practices run generate_cost_report with infracostJson <paste json>
466
+ ```
467
+
468
+ ### 3. Architecture Review
469
+
470
+ 1. Analyse code quality:
471
+
472
+ ```text
473
+ @tf-best-practices run analyze_terraform_code with code <paste code> and focusArea modularity
474
+ ```
475
+
476
+ 1. Review state management:
477
+
478
+ ```text
479
+ @tf-best-practices run analyze_state_management with terraformCode <paste code>
480
+ ```
481
+
482
+ 1. Get architecture recommendations:
483
+
484
+ ```text
485
+ @tf-best-practices run suggest_terraform_architecture with workloadType web-api and multiRegion true
486
+ ```
487
+
488
+ ### Best Practices
489
+
490
+ - Start with CLI analysis tools to establish a baseline before using guidance tools.
491
+ - Use `fetch_terraform_best_practices` to align with community conventions.
492
+ - Use `fetch_provider_best_practices` for provider-specific patterns.
493
+ - Keep `timeoutMs` high enough for large Terraform projects.
494
+ - Run `suggest_terraform_testing_strategy` when onboarding new CI/CD pipelines.
495
+ - Use `generate_compliance_summary` regularly for audit readiness.
496
+
497
+ ## Additional Use Cases
498
+
499
+ - Pre-merge security and compliance gates in pull requests.
500
+ - Automated cost impact reviews for infrastructure changes.
501
+ - Architecture pattern recommendations for greenfield projects.
502
+ - Module documentation generation for shared Terraform modules.
503
+ - CI-driven testing strategy definition by deployment risk profile.
504
+ - Compliance evidence generation for audit trails.
505
+
506
+ ## Related Projects
507
+
508
+ ### Terraform Resources
509
+
510
+ - [terraform-best-practices.com](https://www.terraform-best-practices.com/)
92
511
  - [Terraform Registry](https://registry.terraform.io/)
512
+ - [tflint](https://github.com/terraform-linters/tflint)
513
+ - [checkov](https://www.checkov.io/)
514
+ - [trivy](https://github.com/aquasecurity/trivy)
515
+ - [kics](https://kics.io/)
516
+ - [Infracost](https://www.infracost.io/)
517
+
518
+ ### Model Context Protocol
519
+
520
+ - [MCP official documentation](https://modelcontextprotocol.io/)
521
+ - [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
522
+ - [MCP servers registry](https://github.com/mcp)
523
+
524
+ ## Community and Contributing
525
+
526
+ - [Contributing Guide](./CONTRIBUTING.md)
527
+ - [Code of Conduct](./CODE_OF_CONDUCT.md)
528
+ - [Security Policy](./SECURITY.md)
529
+ - [Testing Guide](./docs/TESTING.md)
530
+ - [Maintainer Guide](./docs/MAINTAINERS.md)
531
+
532
+ ## Attribution and License
533
+
534
+ Maintained by Carl Dawson under the [Down At The Bottom Of The Mole Hole](https://github.com/downatthebottomofthemolehole) organization.
535
+
536
+ ## Development
537
+
538
+ ```bash
539
+ npm run lint
540
+ npm test
541
+ npm run build
542
+ ```
543
+
544
+ ## License
545
+
546
+ Licensed under the MIT License.
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js CHANGED
@@ -77,3 +77,4 @@ main().catch((error) => {
77
77
  console.error(`Fatal startup error: ${message}`);
78
78
  process.exit(1);
79
79
  });
80
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,sBAAsB,EACtB,QAAQ,EACT,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,8BAA8B;IACpC,OAAO,EAAE,OAAO;CACjB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;KACV;CACF,CACF,CAAC;AAEF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAEnE,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IAC1D,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC7B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE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C,IAAI,CAAC,CAAC;QACzC,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI;iBACL;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,0BAA0B,OAAO,EAAE;iBAC1C;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;AACjE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtF,OAAO,CAAC,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ export interface CommandExecutionOptions {
2
+ cwd?: string;
3
+ timeoutMs?: number;
4
+ maxOutputBytes?: number;
5
+ env?: NodeJS.ProcessEnv;
6
+ }
7
+ export interface CommandExecutionResult {
8
+ command: string;
9
+ args: string[];
10
+ cwd: string;
11
+ exitCode: number;
12
+ stdout: string;
13
+ stderr: string;
14
+ timedOut: boolean;
15
+ outputTruncated: boolean;
16
+ }
17
+ export declare class CommandNotFoundError extends Error {
18
+ constructor(command: string);
19
+ }
20
+ export declare function runCommand(command: string, args: string[], options?: CommandExecutionOptions): Promise<CommandExecutionResult>;
package/dist/lib/exec.js CHANGED
@@ -84,3 +84,4 @@ export async function runCommand(command, args, options = {}) {
84
84
  });
85
85
  });
86
86
  }
87
+ //# sourceMappingURL=exec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/lib/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,kBAAkB,GAAG,OAAO,CAAC;AACnC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAoB3C,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAe,EACf,IAAc,EACd,UAAmC,EAAE;IAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,kBAAkB,CAAC;IAC1D,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,wBAAwB,CAAC;IAE1E,OAAO,MAAM,IAAI,OAAO,CAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnE,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE;YACjC,GAAG;YACH,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;YAC/B,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;SA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 export async function fetchText(url, timeoutMs = 15_000) {
17
17
  clearTimeout(timeout);
18
18
  }
19
19
  }
20
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/lib/http.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,SAAS,GAAG,MAAM;IAC7D,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC;IAEhE,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,OAAO,EAAE;gBACP,YAAY,EAAE,oCAAoC;aACnD;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function toPlainText(value: string): string;
2
+ export declare function keywordSnippet(text: string, keywords: string[], maxChars?: number): string;
package/dist/lib/text.js CHANGED
@@ -37,3 +37,4 @@ export function keywordSnippet(text, keywords, maxChars = 2_000) {
37
37
  }
38
38
  return output || cleaned.slice(0, maxChars);
39
39
  }
40
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/lib/text.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,KAAK;SACT,OAAO,CA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