> For the complete documentation index, see [llms.txt](https://docs.jcore.io/clarity-gateway/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jcore.io/clarity-gateway/connections/mqtt/adding-a-text-json-mqtt-connection.md).

# Adding a Text/JSON MQTT Connection

You can add a SparkPlug MQTT connection by clicking `+` next to **Connections** in the sidebar:

![](/files/zlUNF8fpuf5wfJblJu8q)

In the **Create Connection** page that appears, enter the **Name** for your connection:

![](/files/3XXcwaTdn8IIjSj66hiz)

Then select the **MQTT Text/JSON** protocol:

![](/files/dGLHG5c8fkDt1pvMBeNl)

Fields will appear below. Enter the **Server URL**, **Username**, and **Password** of the MQTT server to connect to:

![](/files/5Yb7oi3zzkWGffhjd8uk)

Then enter the **Data To MQTT Topic**, **Data From MQTT Topic**, and **Metadata To MQTT Topic** you would like to use for the Iron Pi (or other device running Clarity Gateway):

![](/files/MlOIhQtj73Bs3GgUp8Lz)

Finally, click **Save**:

![](/files/REVgK7FOShWcMeOcFDHY)

Once the connection has been created, you will see the following page. The status bar at the top will indicate if Clarity Gateway is connecting to the server, has connected, or failed to connect:

![](/files/SQt6F9kF9RpWboFzaKoU)

To return to your connection settings from another page, click its name in the **MQTT** section of the sidebar:

![](/files/19mpnvXStJbJnwqcQoeT)


---

# 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 dynamically by asking a question.

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

```
GET https://docs.jcore.io/clarity-gateway/connections/mqtt/adding-a-text-json-mqtt-connection.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.
