> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stigg.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

<Note>The Stigg MCP server is currently in **public beta**. Feedback and bug reports are welcome.</Note>

## Overview

The Stigg MCP server exposes your Stigg environment to any AI agent that supports the [Model Context Protocol](https://modelcontextprotocol.io/). Once connected, your agent can provision customers, manage subscriptions, check entitlements, and report usage in natural language, without writing a single API call.

### Who it's for

Developers who want to use AI coding assistants to interact with Stigg during development, testing, or operations tasks.

### How it works

The MCP server acts as a bridge between your AI client and the Stigg API. It authenticates using a Stigg environment API key, so every action the agent takes is scoped to that environment.

<Note>
  The MCP server URL is `https://mcp.stigg.io`. Clients that support HTTP transport connect directly; others use the `@stigg/typescript-mcp` npm package as a local bridge.
</Note>

***

## Connect your AI client

Select your AI client below and follow the two-step setup.

<Steps>
  <Step title="Get your API key">
    In the Stigg app, go to **Integrations > API keys** and copy the key for the environment you want the agent to operate on. For better isolation, [create a dedicated scoped key](#security) for each AI client.
  </Step>

  <Step title="Configure the client">
    <Tabs>
      <Tab title="Claude Code">
        Run the following command in your terminal:

        ```bash theme={null}
        claude mcp add stigg \
          --header "X-API-KEY: <YOUR_API_KEY>" \
          --transport http https://mcp.stigg.io
        ```

        Replace `<YOUR_API_KEY>` with your Stigg environment API key. Start a new Claude Code session, then type `/mcp` to confirm the server is connected and its tools are listed.
      </Tab>

      <Tab title="Claude Desktop">
        Open your Claude Desktop configuration file:

        * **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
        * **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

        Add the `stigg` entry under `mcpServers` inside the `preferences` object. Your file should look like this:

        ```json claude_desktop_config.json theme={null}
        {
          "preferences": {
            "mcpServers": {
              "stigg": {
                "url": "https://mcp.stigg.io",
                "headers": {
                  "X-API-KEY": "<YOUR_API_KEY>"
                }
              }
            }
          }
        }
        ```

        If your config file already has other keys inside `preferences` (such as `coworkWebSearchEnabled`), keep them and add `mcpServers` alongside them — don't replace the whole file.

        Replace `<YOUR_API_KEY>` with your Stigg environment API key, then restart Claude Desktop.
      </Tab>

      <Tab title="ChatGPT">
        In ChatGPT, go to **Settings > Connectors** and add a new MCP server with the following values:

        | Field        | Value                  |
        | ------------ | ---------------------- |
        | Server URL   | `https://mcp.stigg.io` |
        | Connection   | API Key (header)       |
        | Header name  | `X-API-KEY`            |
        | Header value | `<YOUR_API_KEY>`       |

        Replace `<YOUR_API_KEY>` with your Stigg environment API key.
      </Tab>

      <Tab title="Cursor">
        Open `~/.cursor/mcp.json` (create it if it doesn't exist) and add the following entry under `mcpServers`:

        ```json ~/.cursor/mcp.json theme={null}
        {
          "mcpServers": {
            "stigg_typescript_api": {
              "command": "npx",
              "args": ["-y", "@stigg/typescript-mcp"],
              "env": {
                "STIGG_API_KEY": "<YOUR_API_KEY>"
              }
            }
          }
        }
        ```

        Replace `<YOUR_API_KEY>` with your Stigg environment API key. Restart Cursor to apply the change.
      </Tab>

      <Tab title="VS Code">
        Open the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`), run **MCP: Open User Configuration**, and add the following entry under `mcpServers`:

        ```json MCP User Configuration theme={null}
        {
          "mcpServers": {
            "stigg_typescript_api": {
              "command": "npx",
              "args": ["-y", "@stigg/typescript-mcp"],
              "env": {
                "STIGG_API_KEY": "<YOUR_API_KEY>"
              }
            }
          }
        }
        ```

        Replace `<YOUR_API_KEY>` with your Stigg environment API key.
      </Tab>

      <Tab title="Windsurf">
        Open your Windsurf MCP configuration file and add the following entry under `mcpServers`:

        ```json MCP Configuration theme={null}
        {
          "mcpServers": {
            "stigg_typescript_api": {
              "command": "npx",
              "args": ["-y", "@stigg/typescript-mcp"],
              "env": {
                "STIGG_API_KEY": "<YOUR_API_KEY>"
              }
            }
          }
        }
        ```

        Replace `<YOUR_API_KEY>` with your Stigg environment API key.
      </Tab>

      <Tab title="Codex">
        Open your Codex MCP configuration file and add the following entry under `mcpServers`:

        ```json MCP Configuration theme={null}
        {
          "mcpServers": {
            "stigg_typescript_api": {
              "command": "npx",
              "args": ["-y", "@stigg/typescript-mcp"],
              "env": {
                "STIGG_API_KEY": "<YOUR_API_KEY>"
              }
            }
          }
        }
        ```

        Replace `<YOUR_API_KEY>` with your Stigg environment API key.
      </Tab>

      <Tab title="Other">
        For any other MCP-compatible client, add the following entry under `mcpServers` in your client's MCP configuration file:

        ```json MCP Configuration theme={null}
        {
          "mcpServers": {
            "stigg_typescript_api": {
              "command": "npx",
              "args": ["-y", "@stigg/typescript-mcp"],
              "env": {
                "STIGG_API_KEY": "<YOUR_API_KEY>"
              }
            }
          }
        }
        ```

        Replace `<YOUR_API_KEY>` with your Stigg environment API key. If your client supports HTTP transport natively, use the following instead:

        ```json HTTP transport theme={null}
        {
          "mcpServers": {
            "stigg": {
              "url": "https://mcp.stigg.io",
              "headers": {
                "X-API-KEY": "<YOUR_API_KEY>"
              }
            }
          }
        }
        ```
      </Tab>
    </Tabs>
  </Step>
</Steps>

***

## Core concepts

**The MCP server is per-environment.** The API key you provide determines which Stigg environment the agent operates on — sandbox, staging, or production. Every action the agent takes (creating customers, provisioning subscriptions, reporting usage) affects that environment.

**To work across environments**, you can configure separate MCP server entries with separate API keys (e.g. `stigg-sandbox` and `stigg-production`). However, this setup is error-prone: the agent may not know which environment to target and can perform destructive actions in the wrong one. Where possible, use a single environment per session and only add the API key for the environment you intend the agent to operate on.

**The agent acts on your behalf.** There is no separate agent identity — the MCP server forwards API calls using the key you provided. The agent can do anything the key permits.

***

## What you can do

Once connected, your AI agent can perform any of the following operations by describing them in natural language. This covers the full Stigg API surface.

**Product catalog**

| Operation           | Description                                                                            |
| ------------------- | -------------------------------------------------------------------------------------- |
| **Manage plans**    | Create, update, archive, and list plans with their pricing, features, and entitlements |
| **Manage features** | Create, update, and list features (boolean, metered, or configuration)                 |
| **Manage add-ons**  | Create, update, and list add-ons and their entitlements                                |
| **Manage packages** | Publish and archive pricing packages                                                   |

**Customers & subscriptions**

| Operation                          | Description                                                                           |
| ---------------------------------- | ------------------------------------------------------------------------------------- |
| **Manage customers**               | Provision, update, and retrieve customer records                                      |
| **Provision subscriptions**        | Subscribe a customer to a plan or add-on, including scheduled and trial subscriptions |
| **Preview subscriptions**          | Calculate pricing before provisioning                                                 |
| **Cancel subscriptions**           | Cancel immediately or at period end                                                   |
| **Grant promotional entitlements** | Give a customer temporary access to a feature outside their plan                      |

**Entitlements & usage**

| Operation                  | Description                                                              |
| -------------------------- | ------------------------------------------------------------------------ |
| **Check entitlements**     | Query whether a customer has access to a feature and at what usage level |
| **Report usage**           | Record metered feature usage for a customer's active subscription        |
| **Report metering events** | Submit raw usage events for aggregation and billing                      |

***

## Security

<Warning>
  **Do not connect a production environment unless you have a clear need and understand the risks.** AI agents can take destructive, hard-to-reverse actions — deleting customers, canceling subscriptions, or modifying your product catalog — based on natural language instructions that may be misinterpreted. Always develop and test against a sandbox environment first.
</Warning>

**Use scoped API keys.** Stigg supports API keys with restricted permissions. Create a dedicated scoped key for each AI client rather than reusing a full-access service key. This limits the blast radius if a key is ever exposed or if the agent acts unexpectedly.

**Keys are environment-bound.** An API key always belongs to a specific Stigg environment. A key from your sandbox environment cannot access production data.

**Recommended setup:**

* Default to sandbox keys for all AI-assisted development and testing
* Create one scoped key per AI client (e.g., `Claude Code - Dev`, `Cursor - Staging`)
* Grant only the permissions the agent needs for its intended tasks
* Rotate keys periodically from **Settings > API keys**

<Warning>
  Never commit API keys to source control or share them in chat. Treat them like passwords.
</Warning>

***

<Card title="CLI vs MCP server" icon="arrow-right-arrow-left" href="/api-and-sdks/cli-vs-mcp">
  Not sure which tool to use? See the side-by-side comparison.
</Card>
