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

# Connect ChatGPT and OpenAI agents

> Add LobbyStack to ChatGPT as an app, or use it from the OpenAI Responses API and Codex.

The server URL is `https://app.lobbystack.com/api/mcp`. Replace `app.lobbystack.com` with your own domain if you self-host. ChatGPT connects to it from the internet, so a self-hosted LobbyStack needs a public HTTPS address.

See [MCP server](/ai/mcp) for the tools each permission unlocks.

## ChatGPT

ChatGPT adds custom MCP servers as apps in developer mode, which OpenAI offers on Plus, Pro, Business, Enterprise and Education accounts on the web.

<Steps>
  <Step title="Turn on developer mode">
    In ChatGPT, open **Settings** > **Security and login** and turn on **Developer mode**.
  </Step>

  <Step title="Create the app">
    Open ChatGPT's plugins, click **+**, and create a developer-mode app. Name it `LobbyStack`, paste the server URL, and choose **OAuth** for authentication. Leave any client ID and secret empty; ChatGPT registers itself with LobbyStack.
  </Step>

  <Step title="Sign in and choose access">
    ChatGPT opens LobbyStack. Sign in, pick the business, uncheck anything ChatGPT shouldn't do, and click **Allow access**.
  </Step>
</Steps>

To disconnect, go to **Settings** > **Connected apps** in LobbyStack and click **Disconnect** next to ChatGPT.

## OpenAI Responses API

The Responses API calls remote MCP servers for you. Pass an API key in `headers`:

```bash theme={null}
curl https://api.openai.com/v1/responses \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-6-luna",
    "tools": [{
      "type": "mcp",
      "server_label": "lobbystack",
      "server_url": "https://app.lobbystack.com/api/mcp",
      "headers": { "Authorization": "Bearer '"$LOBBYSTACK_API_KEY"'" },
      "require_approval": "always"
    }],
    "input": "Who called yesterday and asked for a callback?"
  }'
```

`require_approval: "always"` makes the API stop before each tool call so your code can confirm it. Loosen it only for keys with read scopes.

## Codex

Add LobbyStack to `~/.codex/config.toml`. Codex reads the API key from the environment variable you name:

```toml ~/.codex/config.toml theme={null}
[mcp_servers.lobbystack]
url = "https://app.lobbystack.com/api/mcp"
bearer_token_env_var = "LOBBYSTACK_API_KEY"
```

Export `LOBBYSTACK_API_KEY` in your shell, start Codex, and ask it to call `get_business` to check the connection.
