> For the complete documentation index, see [llms.txt](https://docs.middle.app/middle-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.middle.app/middle-docs/ai/connect-chatgpt.md).

# Connect ChatGPT

Connect ChatGPT to Middle to investigate workflows, records, and logs

You can connect ChatGPT to Middle to investigate questions like why a member didn't receive points for a check-in. It can read the Middle data available to your user, including workflows, records, and logs. It cannot edit workflows or run actions.

## Before you start

You need an Organization Owner to approve the connection in Middle, and permission to add custom plugins in ChatGPT.

{% stepper %}
{% step %}

### Register ChatGPT in Middle

**Metadata document URL:**

```
https://chatgpt.com/oauth/client.json
```

1. Sign in to Middle as an Organization Owner.
2. Open **More → API Clients → Register API client**.
3. Select **Use a metadata document**.
4. In **Metadata document URL**, enter: `https://chatgpt.com/oauth/client.json`.
5. Select **Load metadata** to open the client details.
6. Review the name, website, and redirect URLs, then select **Approve and enable**.
7. Check that **Status** says **Enabled** before continuing to ChatGPT.
   {% endstep %}

{% step %}

### Add Middle in ChatGPT

{% embed url="<https://developers.openai.com/api/docs/guides/custom-mcp-server>" %}

1. Open ChatGPT on the web and go to **Plugins**.
2. Click **Add** in the upper right, then **Add custom MCP server**.

Fill in the dialog:

| Field                                 | Value                                                        |
| ------------------------------------- | ------------------------------------------------------------ |
| **Icon (optional)**                   | Leave blank.                                                 |
| **Name**                              | Enter Middle or a name specific to your instance.            |
| **Description (optional)**            | Investigate Middle workflows, records, and logs.             |
| **Connection**                        | Select **Server URL** and enter your installation URL below. |
| **Authentication**                    | Select **OAuth**.                                            |
| **Advanced OAuth settings**           | Leave unchanged.                                             |
| **I understand and want to continue** | Read the warning and check the box to proceed.               |
| **Create as a plugin**                | Click to connect.                                            |

**Server URL:** `https://example.middle.app/oauth/mcp/`. Replace `example` with your installation's subdomain.
{% endstep %}

{% step %}

### Authorize access

1. When Middle opens, sign in and complete any required authenticator check.
2. On **Authorize access**, check the client name and signed-in email. Use **Switch user** if you want to connect a different Middle user.
3. Select **Authorize** to return to ChatGPT, or **Cancel** to decline.

If you are already signed in to Middle, you may go straight to **Authorize access**. The permission shown is: “This app will be able to read the data you can access in Middle.” Approving the API client as an owner doesn't give everyone the owner's access.
{% endstep %}

{% step %}

### Try an investigation

Install the plugin from your personal or workspace plugins. Start a new conversation, type `@`, and select **Middle**. These steps follow OpenAI's [connection guide](https://developers.openai.com/plugins/deploy/connect-chatgpt).

Start with “List the Middle accounts I can access.” Then try a specific question:

> For Business 123, Sally at <sally@example.com> didn't receive points for her October 5 check-in. Find her record and the check-in rewards workflow. Check the trigger, workflow configuration, and execution logs. Explain what happened and link to the relevant Middle pages.

Replace the example with a real business, member, and date. ChatGPT can also search Middle's documentation to understand workflow parameters and other settings. For a HubSpot ticket, give ChatGPT access to HubSpot or paste the ticket's details.
{% endstep %}
{% endstepper %}

## Alternative: manual registration

Use this instead of metadata registration when configuring ChatGPT with a client ID and optional secret.

1. Copy the exact redirect URL shown in ChatGPT's server management details.
2. In Middle, open **More → API Clients → Register API client**.
3. Select **Enter details manually**.
4. Enter **ChatGPT** for **Name** and `https://chatgpt.com` for **Website**.
5. Paste ChatGPT's redirect URL into **Redirect URLs**.
6. Choose the **Client authentication** method configured in ChatGPT. HTTP Basic corresponds to `client_secret_basic`; POST body corresponds to `client_secret_post`.
7. Select **Register client**. If a secret appears, copy it and select **Continue to client**.
8. Select **Approve and enable** and copy the **Client ID**.
9. Enter that client ID and any secret in ChatGPT's OAuth settings, select **Create as a plugin**, then continue with [Authorize access](#authorize-access).

The redirect URL is where Middle sends you back after authorization. Copy it exactly, including any path or trailing slash. OpenAI explains its callback URLs in the [authentication guide](https://developers.openai.com/plugins/build/auth).

## Review or revoke access

In Middle, open **My Session → User settings**. Below **Authenticator**, find **API clients using your credentials**. This shows your authorizations and when they were last used. Select **Revoke access** and confirm to stop one authorization.

An Organization Owner can stop the client for everyone through **More → API Clients → \[client name] → Disable client**.

## If you get stuck

* **API Clients is missing:** Ask an Organization Owner to register the client.
* **Client is disabled:** Open its details in Middle and select **Approve and enable**.
* **Invalid client\_id parameter value:** Check that the API client in Middle uses `https://chatgpt.com/oauth/client.json` and is **Enabled**, then connect again.
* **Metadata won't load:** Check the error shown and confirm the URL matches the one in step 1.
* **Authorization expired:** Start connecting again from ChatGPT.
* **Server won't connect:** Check the HTTPS address and the complete `/oauth/mcp/` path.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.middle.app/middle-docs/ai/connect-chatgpt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
