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

# Config Connector (MCP)

> Manage a brand's response-automation config from Claude, through the engine API's built-in MCP server.

# Config Connector (MCP)

Manage a brand's response-automation config from Claude. The MCP server **is** the already-running
engine API — there is no separate process to deploy.

|                   |                                                   |
| ----------------- | ------------------------------------------------- |
| **Server name**   | `stateset-config-connector`                       |
| **HTTP endpoint** | `POST https://api.workstream.stateset.com/v1/mcp` |
| **stdio (local)** | `engine-api mcp-stdio`                            |
| **Protocol**      | MCP `2025-06-18`, JSON-RPC over Streamable HTTP   |
| **Auth**          | `Authorization: Bearer <api-key>`                 |

The transport is POST-only; `GET` returns `405` and compliant clients fall back to POST.

Auth accepts either a **per-brand API key**, which scopes Claude to that brand's tenant, or a
global admin key.

## Tools

| Tool                   | Purpose                                                                                                |
| ---------------------- | ------------------------------------------------------------------------------------------------------ |
| `list_brands`          | Brands visible to the caller — id, slug, status, config version                                        |
| `get_brand_config`     | Read a brand's current `deterministic_config` and version                                              |
| `get_brand_scorecard`  | Closed-loop quality rates (approval, automation, escalation) so edits are grounded in real performance |
| `list_config_versions` | Published config history, for audit                                                                    |
| `propose_config_patch` | Apply JSON-Pointer edits and return the result **without saving**                                      |
| `validate_config`      | Validate a proposed or current config                                                                  |
| `apply_config`         | Commit a new config through the audited, versioned pipeline                                            |

`apply_config` requires a `change_note` and supports `expected_config_version` for optimistic
concurrency — so two people editing the same brand can't silently overwrite each other.

### The natural loop

```
get_brand_config + get_brand_scorecard
        ↓
propose_config_patch      (nothing saved yet)
        ↓
validate_config
        ↓
apply_config              (audited, versioned)
```

<Tip>
  `get_brand_scorecard` is what makes this more than a text editor. Reading approval and
  escalation rates before proposing a change means the model is tuning against observed behavior
  rather than guessing at a threshold.
</Tip>

## 1. Mint a per-brand API key

```bash theme={null}
curl -X POST https://api.workstream.stateset.com/v1/brands/<BRAND_ID>/api-keys \
  -H "Authorization: Bearer <ADMIN_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"label":"claude-mcp"}'
```

<Warning>
  The plaintext token is returned **once**. Store it securely — it cannot be retrieved later, only
  revoked and reissued.
</Warning>

## 2. Connect from Claude

### Claude Code

```bash theme={null}
claude mcp add stateset-config \
  --transport http https://api.workstream.stateset.com/v1/mcp \
  --header "Authorization: Bearer <BRAND_API_KEY>"
```

Then in a session:

> List brands, read that brand's config and scorecard, and propose lowering the review-gate
> confidence to 0.7.

### Claude Desktop

Bridge the remote HTTP server to stdio:

```json theme={null}
{
  "mcpServers": {
    "stateset-config": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote",
        "https://api.workstream.stateset.com/v1/mcp",
        "--header", "Authorization: Bearer <BRAND_API_KEY>"
      ]
    }
  }
}
```

## Scoping

Prefer a **per-brand key** over an admin key. The brand key confines every tool call to that
brand's tenant, so a mistaken `apply_config` cannot reach another customer's configuration.

## Related

* [Control plane](/next-temporal/control-plane) — the versioned config pipeline behind `apply_config`
* [Configuration](/next-temporal/configuration) — what lives in `deterministic_config`
* [Workflow Studio](/stateset-response/responsecx-workflow-studio) — the UI equivalent
* [All MCP servers](/mcp-servers)
