The StackGen plugin lets you create and provision compliant infrastructure based on your organizational governance. It also helps you manage drift in your cloud environments across AWS, Azure, and GCP — directly from Cursor using natural language in agent chat.
- A StackGen account
- A StackGen Personal Access Token (PAT) — create one in Settings → API Keys → Create API Key
- Cursor IDE (v2.6.0+)
If you already have the StackGen MCP server registered separately in
.cursor/mcp.json, disable or remove it first to avoid duplicate tool entries.
- Open Cursor Settings → Tools & MCP → Plugins.
- Search for StackGen and click Install.
- Open the Command Palette: ⌘⇧P (Mac) / Ctrl+Shift+P (Windows/Linux).
- Run "Cursor Settings: Tools & MCP" → go to Plugins.
- Click Install from URL and enter:
https://github.com/stackgenhq/cursor-plugin - Cursor will pull the plugin and register it locally.
After installing, open any Cursor agent chat and run:
/stackgen-mcp-setup
The agent will prompt you for:
| Value | Where to find it |
|---|---|
| StackGen base URL | Your workspace URL, e.g. https://cloud.stackgen.com or your enterprise domain |
| Personal Access Token | StackGen → Settings → API Keys → Create API Key |
The agent writes both values into the plugin's local mcp.json. No environment variables or manual file edits needed.
Then reload Cursor: ⌘⇧P → Reload Window
Cursor starts MCP servers once at launch. The reload is required after setup so the
stackgen-adminandstackgen-userservers are picked up — this is a one-time step.
Once connected, use plain English in any agent chat:
Create an infrastructure for my service.
Add my organizational policies to the above created IaC.
What are the violations of my appStack?
Can you deploy to my cloud environment?
For appStack creation from your repo, the agent will inspect the codebase, ask for cloud provider, region, and project, then proceed after you confirm. You can also run /stackgen-create-appstack to start that flow.
The plugin connects through two MCP servers automatically registered by the skill:
| Server | Used for |
|---|---|
stackgen-admin |
Projects, policies, custom modules, secrets |
stackgen-user |
AppStacks, topology, snapshots, infrastructure, drift |
| Scope | What it unlocks |
|---|---|
| Read | Query projects, appStacks, topology, snapshots |
| Read + Write | All of the above plus create infrastructure, manage incidents, trigger deployments |
Credentials are stored only in the plugin's local mcp.json and are never sent to the AI model provider.
| Command | What it does |
|---|---|
/stackgen-mcp-setup |
First-time setup — set your StackGen URL and PAT |
/stackgen-config |
Change URL, rotate PAT, or troubleshoot (after setup) |
/stackgen-create-appstack |
Analyze this repo and create an appStack (asks cloud, region, project first) |
| Symptom | Fix |
|---|---|
| Tools not appearing after install | Run /stackgen-mcp-setup, then reload Cursor (⌘⇧P → Reload Window) |
| 401 errors | Run /stackgen-config and rotate your PAT |
| Duplicate stackgen tools | Remove any stackgen-* entries from .cursor/mcp.json and reload |