> ## 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.

# Response ChatGPT App Guide

> Step-by-step setup for ChatGPT Developer Mode.

# Response ChatGPT App

Runs the StateSet Response workspace **inside ChatGPT** — a React widget rendered by ChatGPT Apps,
backed by a Node MCP server that exposes the `stateset-response-chat` tool.

| Piece | Role |
| - | - |
| React widget | The workspace UI, rendered in ChatGPT |
| MCP server | Exposes `stateset-response-chat` over SSE |
| Connector | Registered in ChatGPT Developer Mode |

This guide builds the widget, runs the server, and connects it.

<Note>
  ChatGPT reaches the MCP server over **SSE**, so the endpoint has to be publicly resolvable — a
  localhost URL won't work. Step 3 covers exposing it.
</Note>

## 1) Build the widget assets

```bash theme={null}
git clone https://github.com/stateset/stateset-response-chatgpt-app.git
cd stateset-response-chatgpt-app
pnpm install
pnpm run build
```

The build emits `stateset-response.html/js/css` inside `assets/`.

## 2) Run the MCP server

```bash theme={null}
cd server
pnpm install
STATESET_API_BASE_URL=https://api.stateset.com \
STATESET_API_KEY=sk-... \
pnpm start
```

Without credentials, the server uses sample data for local testing.

## 3) Expose the MCP server

Use a tunnel to expose the SSE endpoint:

```bash theme={null}
ngrok http 3030
```

The endpoint becomes `<public-url>/mcp`.

Confirm the server is actually serving MCP before wiring ChatGPT to it — a
connector that fails here gives no useful error:

```bash theme={null}
# Must return an SSE stream, not JSON
curl -sS -N -H 'Accept: text/event-stream' "$MCP_URL/mcp" | head -c 200
```

An `event:` line means the server is ready. JSON or a `404` means the MCP route
is not mounted — usually the server is running but on a different path or port
than the one you exposed.

## 4) Add the connector in ChatGPT

1. Open ChatGPT → **Settings → Developer Mode → Connectors**.
2. Click **Add connector**, choose **MCP via SSE**.
3. Name it `Stateset Response`.
4. Paste `<public-url>/mcp` as the endpoint.
5. Save and confirm the connector is online.

## 5) Test the app

```text theme={null}
@Stateset Response open the customer support workspace for org 1234.
```

## Troubleshooting

* Re-run `pnpm run build` if assets are missing.
* Verify the tunnel is reachable and SSE is stable.
* Confirm API credentials when using live data.

## Related Documentation

* App README

## Next steps

<CardGroup cols={2}>
  <Card title="Deploy the ChatGPT app" icon="rocket" href="/stateset-deploy-chatgpt-app">
    Hosting this on managed Kubernetes instead of locally.
  </Card>

  <Card title="MCP servers" icon="plug" href="/mcp-servers">
    The wider set of servers StateSet publishes.
  </Card>

  <Card title="Agent Gate" icon="shield-halved" href="/stateset-nsr-agent-gate">
    Requiring a proof before a tool call runs.
  </Card>

  <Card title="ResponseCX platform" icon="robot" href="/stateset-response/responsecx-platform">
    The platform the widget talks to.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.