# Connecting Emporix MCP Server with OpenAI

Enable communication between the Emporix MCP Server and OpenAI ChatGPT. This way, you grant access to Emporix data though the set of relevant scopes to OpenAI Platform, so that you can process it further with AI capabilities brought by the Chat GPT.

## Prerequisites

To follow the steps, make sure you have the required tools and accounts:

* [OpenAI Platform](https://platform.openai.com)
* [Emporix Tenant](https://app.emporix.io/)
* [MCP Token](/agentic-commerce-intelligence/mcp-in-emporix/mcp/retrieving-mcp-token.md)

## Configuration

{% stepper %}
{% step %}
**Go to OpenAI settings**

Open the [OpenAI Platform Playground](https://platform.openai.com/playground/prompts). In **Prompts** -> **Tools**, choose **Create** and select the **MCP Server** to configure the connection.

<figure><img src="/files/EbsVHcjlWLxIoaOiHAh8" alt="Open AI configuration"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Choose to add new tool**

Select **Add new** to add tools from the Emporix MCP server.

<figure><img src="/files/TjRSC228bBWXw6y5nvoo" alt="Add MCP tools" width="500"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**Set up connection**

Provide the connection details in the modal that shows up.

* As the **URL**, provide the MCP connection string in the following format:

  ```
  https://api.emporix.io/mcp/{domain}/{tenant}/{mcp_token}/mcp
  ```

  Replace the `{domain}`, `{tenant}` and `{mcp_token}` placeholders with the relevant values.
* Optionally, provide label name in **Label**.
* Leave the **Authentication** as *None* since the MCP token is included in the connection string.

When ready, choose **Connect** to establish connection.
{% endstep %}

{% step %}
**Select tools**

Select the tools you want to use that are based on the available scopes granted in the token:

<figure><img src="/files/DZhO999gJQ9kxV9mJ97M" alt="Add tools" width="500"><figcaption></figcaption></figure>

When done, choose **Add**.
{% endstep %}
{% endstepper %}

### Using OpenAI

You can now start a conversation with AI chat about Emporix data, for example:

<figure><img src="/files/OMhvmRENO5NV0Gu3TTis" alt="OpenAI chat" width="500"><figcaption></figcaption></figure>

The OpenAI agent can access the Emporix data to retrieve and manipulate it according to your needs within the granted scopes.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/agentic-commerce-intelligence/mcp-in-emporix/mcp/connect-openai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
