Skip to main content

MCP Server

Overview​

The StackGuardian MCP Server connects AI tools directly to the StackGuardian Platform. This gives AI agents, assistants, and chatbots the ability to query workflows, retrieve stack information, and analyze deployments through natural language.

Built for platform engineers and developers who want AI-powered assistance for their StackGuardian operations.

Performance tip

The StackGuardian MCP Server works well with all AI models. However, premium models deliver exceptional results with minimal prompting. Free and entry-level models perform reliably for standard queries and may simply need slightly more detailed instructions for complex tasks.

What you can do​

  • Workflow management: View workflow runs, check execution status, and fetch logs for troubleshooting.
  • Stack operations: Query stack information, check deployment status, and retrieve configuration details.
  • Infrastructure insights: Monitor deployment runs, analyze failures, and get comprehensive visibility into your infrastructure state.
  • Organization intelligence: Access organization settings, retrieve connectors, and understand team structure.

Prerequisites​

Before you begin:

  1. A StackGuardian account with API access
  2. A compatible MCP host application
  3. The following configuration parameters:
  • API Token (SG_API_TOKEN): Your StackGuardian API key
  • Organization name (SG_ORG): Your StackGuardian organization identifier
note

The API key inherits permissions from your user role. Ensure you have the necessary access rights for the operations you want to perform.

Installation​

All installation methods require the same three configuration parameters. Replace these placeholder values with your actual credentials:

  • SG_API_TOKEN: Your StackGuardian API token
  • SG_ORG: Your organization name
ChatGPT

Prerequisites

  • ChatGPT Plus, Pro, Team, or Enterprise subscription
  • Your StackGuardian API token (SG_API_TOKEN)
  • Your StackGuardian organization name (SG_ORG)

Installation

Step 1: Enable developer mode

  1. Log in to ChatGPT
  2. Click your profile icon (bottom-left) > Settings
  3. Go to Apps & Connectors
  4. Scroll to Advanced settings and toggle on Developer mode

Step 2: Create the connector

  1. In Apps & Connectors, click Create App
  2. Configure:
    • Name: StackGuardian
    • Description: (Optional)
    • MCP Server URL:
      • For EU Region: https://api.app.stackguardian.io/mcp?SG_API_TOKEN=<YOUR_TOKEN>&SG_ORG=<YOUR_ORG>
      • For US Region: https://api.us.stackguardian.io/mcp?SG_API_TOKEN=<YOUR_TOKEN>&SG_ORG=<YOUR_ORG>
    • Authentication: None
  3. Check I trust this application
  4. Click Create
Integration with ChatGPT

Integration with ChatGPT

Codex CLI

Add this configuration to your Codex CLI MCP settings:

[mcp_servers.StackGuardian]
command = "npx"
args = [
"-y",
"mcp-remote",
"https://api.app.stackguardian.io/mcp",
"--header",
"SG_API_TOKEN: <YOUR_TOKEN>",
"--header",
"SG_ORG: <YOUR_ORG>",
]
startup_timeout_sec = 60
tool_timeout_sec = 120

For US Region, use https://api.us.stackguardian.io/mcp as URL.

note

GPT Codex connects to MCP servers through commands rather than direct URLs, which requires npx. Ensure Node.js and npm are installed on your system.

Claude Code

After installing Claude Code, run this command in your terminal to add the StackGuardian MCP server:

claude mcp add --transport http StackGuardian https://api.app.stackguardian.io/mcp \
--header "SG_API_TOKEN: <YOUR_TOKEN>" \
--header "SG_ORG: <YOUR_ORG>"

For US Region, use https://api.us.stackguardian.io/mcp as URL.

Claude Web/Desktop

Connect your StackGuardian tools to Claude (Web or Desktop) using the MCP.

Prerequisites

  • Claude Pro, Team, or Enterprise account
  • Your StackGuardian API token (SG_API_TOKEN)
  • Your StackGuardian organization name (SG_ORG)

Installation

Step 1: Enable developer mode

  1. Open Claude.ai or Claude Desktop
  2. Click your profile icon (bottom-left) > Settings
  3. Select the Developer tab
  4. Developer features activate automatically

Step 2: Add the connector

  1. In Settings, go to Connectors
  2. Click Add custom connector
  3. Configure:
    • Name: StackGuardian MCP
    • Remote URL:
      • For EU Region: https://api.app.stackguardian.io/mcp?SG_API_TOKEN=<YOUR_TOKEN>&SG_ORG=<YOUR_ORG>
      • For US Region: https://api.us.stackguardian.io/mcp?SG_API_TOKEN=<YOUR_TOKEN>&SG_ORG=<YOUR_ORG>
  4. Click Add
Integration with Claude Web/Desktop

Integration with Claude Web/Desktop

Gemini CLI

After installing Gemini CLI, run this command in your terminal to add the StackGuardian MCP server:

gemini mcp add StackGuardian https://api.app.stackguardian.io/mcp \
--transport http \
--header "SG_API_TOKEN: <YOUR_TOKEN>" \
--header "SG_ORG: <YOUR_ORG>" --scope user

For US Region, use https://api.us.stackguardian.io/mcp as URL.

VSCode Copilot

Integrate StackGuardian into VSCode with GitHub Copilot Chat using the Model Context Protocol (MCP).

Prerequisites

  • VS Code 1.99 or later
  • GitHub Copilot extension (any plan, including free)
  • Your StackGuardian API token (SG_API_TOKEN)
  • Your StackGuardian organization name (SG_ORG)

Installation

Step 1: Configure the MCP server

Create .vscode/mcp.json in your project root, or run MCP: Open User Configuration from the Command Palette for a global config:

{
"servers": {
"stackguardian": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.app.stackguardian.io/mcp?SG_API_TOKEN=<YOUR_TOKEN>&SG_ORG=<YOUR_ORG>"
]
}
}
}

For the US region, use https://api.us.stackguardian.io/mcp?SG_API_TOKEN=<YOUR_TOKEN>&SG_ORG=<YOUR_ORG> as the URL.

Step 2: Start the MCP server

A Start button will appear at the top of the mcp.json file after saving. Click it to start the server and discover available tools.

Start the MCP server

Start the MCP server

Step 3: Access via Copilot Chat

  1. Open Copilot Chat (Ctrl+Alt+I on Windows/Linux or Cmd+Ctrl+I on macOS)
  2. Switch to Agent mode from the mode dropdown
  3. Click the tools icon (πŸ› ) to verify StackGuardian tools are listed

MCP tools are only available in Agent mode. They will not appear in Ask or Edit mode.

Use cases​

  • "Why did workflow run #1247 fail? Help me to figure out what happened."
  • "What's the status of my latest workflow run?"
  • "What's the current status of all stacks in the engineering organization?"
  • β€œWhich workflows are still using template empty-tf-resource revision Revision: 2”
  • β€œHow healthy are the workflows in the mcp-testing workflow group?”

Security and permissions​

The MCP server respects the permissions associated with your API key. If your key doesn't have access to certain resources, those operations will fail with a permission error.