> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-ai/use-harness-ai/connect-with-ai/harness-connector-for-openai.md).

# Harness Connector for OpenAI

Connect Harness to ChatGPT and Codex CLI with OAuth to inspect software delivery, diagnose failures, and perform actions with your Harness permissions

The Harness Connector for OpenAI enables you to work with Harness from the ChatGPT desktop app, web, mobile, or Codex CLI. After you sign in to Harness and authorize access through OAuth, the connector acts on your behalf to inspect delivery health, diagnose failed executions, find resources, and perform authorized actions.

The connector is available on the [**Plugins** page](https://chatgpt.com/plugins/plugin_asdk_app_6aac044a3e4c819182c689d8be994de5?search=harness) in ChatGPT. This page covers access to Harness from OpenAI clients. To configure OpenAI models for Harness Worker Agents, go to [OpenAI Model Connector](/harness-ai/use-harness-ai/connect-with-ai/openai-model-connector.md).

## What you will learn from this topic

Use this guide to:

* Find the Harness plugin and connect your Harness account with OAuth.
* Use Harness from ChatGPT desktop, web, and mobile.
* Connect Codex CLI to Harness Hosted MCP.
* Verify access and resolve authentication or permission errors.

## Before you begin

Prepare the following:

* **Harness account:** A Harness SaaS account and a user with access to the organizations, projects, and resources you want to work with.
* **OAuth access:** OAuth enabled for your Harness account. Contact [Harness Support](https://support.harness.io) if it is not enabled. Go to [Harness Hosted MCP](/harness-ai/use-harness-ai/connect-with-ai/index/hosted-mcp.md) for hosted endpoint and authentication requirements.
* **SSO configuration:** If you use SAML or OIDC, your administrator must configure the MCP-specific reply URL or redirect URI in your identity provider. Go to [Single Sign-On (SSO) for Harness MCP](/harness-ai/use-harness-platform/authentication/single-sign-on-for-harness-mcp.md).
* **OpenAI client access:** Access to ChatGPT or an installed, signed-in Codex CLI. Your OpenAI workspace must allow the Harness app and plugin where you intend to use them.

## Connect Harness in ChatGPT

Complete both plugin installation and Harness account authorization. A plugin can appear in the directory before its account connection is ready to use.

{% stepper %}
{% step %}

### Find the Harness plugin

In ChatGPT, open **Settings > Plugins** and search for `harness`. If your interface shows **Apps**, open the available app directory instead.

Select **Harness** with the Harness logo and the description **Autonomous software delivery**. On its details page, verify that **Developer** is **Harness.io** and that **Apps** includes **Harness**.

![ChatGPT plugin directory with Harness search results, including the Harness plugin described as Autonomous software delivery](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-65b8924907235f601990a369acf8eb5462e8649b%2Fharness-openai-plugin-directory.png?alt=media)
{% endstep %}

{% step %}

### Install and authorize

Select **Install plugin** if shown, then **Connect** when prompted. Follow the account connection flow:

1. Sign in to the Harness account you want the connector to use.
2. Complete your organization's sign-in requirements, including SSO or additional authentication when prompted.
3. Review the requested access on the OAuth authorization screen and approve it to allow the connector to act on your behalf.
4. Return to ChatGPT after authorization completes.

Enter your credentials in the Harness sign-in flow. Do not paste passwords or access tokens into a conversation.
{% endstep %}

{% step %}

### Verify the connected account

Open the Harness plugin details and check **Connected accounts**. Confirm that the intended Harness user appears. The screenshot below shows a completed connection with an account marked **Primary**.

![Harness plugin details with Try now, a connected primary account, and Connect another account](https://173309742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3F2TpHXhur2QtQnORSM9%2Fuploads%2Fgit-blob-546962216de42eee42e04faa4a39f8425c0d97ef%2Fharness-openai-connected-account.png?alt=media)

Select **Try now** and send a read-only request, such as:

```
Use Harness to list the projects I can access in organization <organization identifier>.
```

Replace the placeholder with your Harness organization identifier. Check that the response contains resources from the intended account. If sign-in is requested again, complete authorization before continuing.
{% endstep %}
{% endstepper %}

Go to OpenAI's [account connection guide](https://help.openai.com/en/articles/20001494-connecting-and-managing-app-accounts-in-chatgpt) for account management details.

## Use Harness across OpenAI clients

Choose the client where you want to work:

| Client              | How to use Harness                                                                                                                                            |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ChatGPT desktop app | Open the connected Harness plugin and select **Try now**, or select Harness in a conversation.                                                                |
| ChatGPT web         | Sign in to the appropriate ChatGPT account and workspace, then select Harness from the available plugins or apps. Complete account authorization if prompted. |
| ChatGPT mobile      | Open the appropriate ChatGPT account and workspace, select Harness in a supported conversation, and complete any requested authorization.                     |
| Codex CLI           | Configure the Harness Hosted MCP connection and complete OAuth using the steps below.                                                                         |

In ChatGPT, use `@` to select Harness or choose it from the **+** menu when those controls are available. Describe the task and include the Harness organization and project identifiers so the connector can locate the right resources.

Plugin availability and controls depend on the OpenAI client, account, and workspace. Go to [Plugins in ChatGPT and Codex](https://help.openai.com/en/articles/20001256-plugins-in-chatgpt-and-codex) for OpenAI's availability and installation guidance.

### Connect Codex CLI

Use Harness Hosted MCP to access Harness from the terminal. This procedure authorizes the CLI connection separately from the ChatGPT account connection.

Add the server using the primary Harness SaaS endpoint and OAuth client ID:

```bash
codex mcp add harness --url https://mcp.harness.io/mcp --oauth-client-id mcp-client
```

Complete the browser sign-in and OAuth authorization if the command starts the flow. If it does not, start it explicitly:

```bash
codex mcp login harness
```

Sign in to the intended Harness account, review the requested access, and complete authorization. Then check that the server is configured:

```bash
codex mcp list
```

Start a Codex session and ask it to list projects in an organization you can access. A successful Harness tool response verifies access; a server entry in the configuration alone does not.

If your organization uses a dedicated SaaS cluster or a non-default region, confirm the endpoint with Harness Support before adding it. If your CLI does not recognize `--oauth-client-id`, update Codex CLI to a version that supports the option.

## Example prompts

Replace the identifiers with your own Harness resources. Available actions depend on the tools exposed for your account, your Harness licensing, and your permissions.

| Task                    | Example prompt                                                                                                                                                |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Find resources          | List the pipelines in organization `<org>` and project `<project>`.                                                                                           |
| Inspect delivery health | Summarize recent pipeline executions in organization `<org>` and project `<project>`, including failed executions.                                            |
| Diagnose a failure      | Investigate execution `<execution ID>` in organization `<org>` and project `<project>`. Identify the failed step and explain the error.                       |
| Prepare a change        | Review pipeline `<pipeline ID>` in organization `<org>` and project `<project>`. Propose a fix for the failed step and show me the change before applying it. |
| Run a pipeline          | Run pipeline `<pipeline ID>` in organization `<org>` and project `<project>` with these inputs: `<inputs>`.                                                   |

## Permissions and actions

OAuth authorizes the connector to use Harness as the signed-in user. Your Harness permissions determine which resources it can access and which actions it can perform. Connecting the plugin does not grant additional Harness permissions.

The connector supports resource discovery and inspection, as well as creating, updating, deleting, and executing actions where available and authorized. Review the target account, organization, project, and requested change before approving an action. Approval behavior depends on the client and server configuration; OAuth consent and approval of an individual action are separate steps.

Go to [Tools reference](/harness-ai/use-harness-ai/connect-with-ai/index/tools-reference.md) for available operations and [Approvals and safety](/harness-ai/use-harness-ai/connect-with-ai/index/approvals-and-safety.md) for Harness MCP approval behavior.

### Manage or disconnect accounts

In the Harness plugin details, use **Connected accounts** to review your connections. Select **Connect another account** when you need an additional Harness account, then complete its sign-in and OAuth authorization. Use the connected account's menu to manage or disconnect it when that option is available.

For a Codex CLI connection configured as `harness`, log out with:

```bash
codex mcp logout harness
```

To remove that server configuration as well, run:

```bash
codex mcp remove harness
```

## Troubleshooting

Use the symptom to identify the next step:

| Symptom                                                    | Action                                                                                                                                                                                    |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Multiple Harness listings appear                           | Select **Harness** with **Autonomous software delivery**, then verify **Harness.io** as the developer.                                                                                    |
| Harness is installed but cannot access resources           | Check **Connected accounts** and complete Harness login and OAuth authorization. Installation alone does not activate account access.                                                     |
| Harness is unavailable in a client                         | Check the OpenAI account and workspace, available plugins or apps, and administrator access controls. Availability can vary by surface.                                                   |
| Harness login works, but OAuth reports invalid credentials | Ask Harness Support to confirm OAuth enablement for the account. Go to [Hosted MCP troubleshooting](/harness-ai/use-harness-ai/connect-with-ai/index/hosted-mcp.md#troubleshooting).      |
| SSO reports a reply URL or redirect URI mismatch           | Ask your administrator to configure the MCP-specific URL using [Single Sign-On (SSO) for Harness MCP](/harness-ai/use-harness-platform/authentication/single-sign-on-for-harness-mcp.md). |
| Resources are missing or access is denied                  | Verify the connected Harness account, organization and project identifiers, and the user's Harness permissions.                                                                           |
| An action is unavailable or blocked                        | Check the tools available for your account, workspace restrictions, and [Harness MCP approval requirements](/harness-ai/use-harness-ai/connect-with-ai/index/approvals-and-safety.md).    |
| A connection requests authentication again                 | Reconnect the account in ChatGPT, or run `codex mcp login harness` for the CLI connection, and complete OAuth again.                                                                      |

## Next steps

Continue with these guides:

* [Prompt templates](/harness-ai/use-harness-ai/connect-with-ai/index/prompt-templates.md): Find more examples for Harness workflows.
* [Tools reference](/harness-ai/use-harness-ai/connect-with-ai/index/tools-reference.md): Review supported resources and operations.
* [Harness Hosted MCP](/harness-ai/use-harness-ai/connect-with-ai/index/hosted-mcp.md): Connect additional AI clients to Harness.

{% @harness-feedback/feedback module="harness-ai" pagePath="harness-ai/use-harness-ai/connect-with-ai/harness-connector-for-openai" %}
