VS Code vs Cursor AI - Terraform, MCP Servers & Real-World DevOps

4 minute read

VS Code & Cursor side-by-side

In the past few days, I’ve alternated between Cursor and VS Code + Copilot Enterprise while working on multiple Terraform/Terragrunt stacks. Notably, VS Code + Copilot now includes several of the popular models commonly available in Cursor, and since my team at work uses Copilot Enterprise, we benefit from enhanced access and integration at no extra cost, making it even easier to leverage these models.

VS Code models

Here are my hands-on notes: what each tool excels at, where they fall short, and the situations where one stands out over the other.

Indexing & Context Awareness 🗂️

While VS Code lacks native indexing, Cursor stands out when working with multiple Terraform modules and the Terragrunt approach. Cursor is more aware of how modules relate to each other and can apply changes across several files at once when needed. In contrast, with VS Code, you must manually add all relevant files and folders before making changes—and even then, it may miss some updates. This means you often have to specify exactly which files and edits are required. Leveraging an MCP Server that has already ingested your Terraform modules might help address these limitations.

Cursor Indexing

Note: The screenshot above shows Cursor’s automatic indexing and module awareness, which is not available in VS Code by default.

  Cursor VS Code + Copilot
Automatic project indexing ✅ Scans every folder/module once the repo opens. ❌ Absent. You must Add to Chat each file or folder manually.
Cross-module updates ✅ Understands module dependencies and edits all impacted files in one shot. ⚠️ Needs explicit instructions; sometimes forgets nested modules.
Terragrunt awareness ✅ Parses *.hcl, keeps remote-state / include chains intact. 💤 Treats terragrunt.hcl like plain text unless guided.

Work-around for VS Code
Point Copilot to an MCP server that already ingested your Terraform modules. The additional context reduces missing edits, though it’s still not fully turnkey.

MCP Servers Everywhere 🎉

Speaking of MCP Servers, VS Code now supports them as well, and can even leverage the same endpoints you’ve set up in Cursor. 🙂

VS COde MCPs

  • Cursor introduced MCP servers earlier, letting you pipe custom LLM endpoints or knowledge bases.
  • Recent VS Code builds can reuse those exact MCP endpoints. One click on “Trust Cursor MCP Servers” and they show up as regular tools inside Copilot.

Why it matters:

  1. Unified config – define the endpoint once, consume it from any IDE.
  2. Cost control – plan with o3 (cheap, analytical) and code with claude-4x (pricey, precise) without routing through a middle layer.
  3. Shared memory – both editors query the same knowledge store, so answers stay consistent.

Custom Instructions vs Global Rules 📝

In Cursor, you can set up global or project-specific rules to define behaviors, coding styles, and even custom commands, allowing Cursor to better tailor its responses and implementations. VS Code offers a similar feature called Custom Instructions, which can be placed in the .github/ folder for project-wide use or stored locally for a global effect without committing them to each repository.

To get started in VS Code, simply use the “Chat: New Instructions File” command to scaffold a template. In fact, you can instruct Copilot Chat to create one based on what you’ve defined in Cursor

VS Code Instructions

Feature Cursor (.cursor/config.yaml) VS Code (Custom Instructions)
Scope Global or per project Project (.github/) or user home
Format YAML with rules + shell hooks Markdown/JSON in “instructions.md”
Typical usage Style guides, command macros, branch naming Same + org-wide conventions

From VS Code run “Chat: New Instructions File” to scaffold a template. I keep a repo-level version under .github/ai-instructions.md and a global fallback in ~/ai/instructions.md.

Code Generation Quality 🤖

When it comes to code generation, Cursor generally outperforms VS Code, despite both often relying on the same underlying models. Cursor tends to deliver more comprehensive and sophisticated solutions, especially for complex tasks. That said, for simpler changes or quick edits, VS Code is more than capable, making it a practical choice if you want to minimize Cursor usage and keep costs down. 💸

Cursor

  • Produces end-to-end scaffolds (Terraform module + Terratest + CI job) with fewer nudges.
  • Better at refactoring large, interconnected codebases.

VS Code + Copilot

  • Faster for single-file tweaks, docstrings, variable renames.
  • Adequate for straightforward modules; you just pay with a bit more hand-holding.

💸 Budget hint: Draft the architecture in VS Code (cheap tokens), switch to Cursor only when you need the heavy lifting.

Quick-Glance Decision Matrix 🧐

Before diving into the details, here’s a quick decision matrix to help you choose the right tool for common DevOps scenarios. This table summarizes which editor excels for specific tasks, from large-scale refactoring to quick module updates or working offline.

Need Suggested Tool
Mass refactor across 15 Terraform modules Cursor
Add an S3 bucket + outputs in one module VS Code
Enforce org-wide branch prefix & PR titles Either (via Custom Instructions / rules)
Get cheapest “planning” model with same MCP context VS Code
You’re offline or air-gapped Cursor self-hosted MCP

Wishlist & Next Steps 🔮

As both tools continue to evolve, there are still a few areas where improvements would make daily DevOps work even smoother. Here are some features and enhancements I’d love to see in future releases:

  1. Native indexing in VS Code for Terraform/Terragrunt graphs.
  2. A shared UI to edit Custom Instructions / Cursor Rules once and sync both editors.
  3. Toggle to auto-include changed files during a chat session (currently manual in Code).

Final Thoughts

Cursor still owns the throne for complex, multi-module refactors. VS Code, however, closed much of the gap by embracing MCP servers and Custom Instructions, making it a perfectly capable (and cheaper) daily driver for incremental work.

Happy automating! 🚀

Leave a Comment