> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up MySQL in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/mysql
Last updated: 2026-11-24

Share MySQL with your team in Claude, ChatGPT and Cursor through Metorial: connection string or connection parameters sign-in, 11 tools (3 read-only).

---

To give your team MySQL in Claude, ChatGPT, Cursor and other AI clients, an admin shares the MySQL integration in a Metorial portal, and each person connects with a connection string. Agents can execute SQL queries to read, insert, update, and delete data in MySQL databases. The integration has 11 tools, 3 read-only, 2 write and 6 destructive, plus 2 triggers.

**What you will learn**

- How an admin shares MySQL in a portal and how each person connects
- What MySQL asks for when you connect, and where to find it
- How to keep the 3 read-only tools and reject the other 8

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- A connection string from MySQL for each person, or one for a shared connection
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in methods

| Method | Type | What a person provides |
| --- | --- | --- |
| **Connection String** (default) | Custom credentials | `connectionString` |
| **Connection Parameters** | Custom credentials | `host`, `port`, `database`, `username`, `password`, `sslMode`, `sslCa` and `sslRejectUnauthorized` |

The portal and `metorial setup` use **Connection String** unless someone picks another method.

### Connection String

To connect, a person enters:

- `connectionString`: MySQL connection URI (e.g., mysql://user:password@host:3306/dbname?ssl=required)

### Connection Parameters

To connect, a person enters these values:

- `host`: MySQL server hostname or IP address
- `port` (optional): MySQL server port (default: 3306)
- `database`: Target database name
- `username`: Database username
- `password`: Database password
- `sslMode` (optional): SSL connection mode One of "disabled", "preferred", "required".
- `sslCa` (optional): PEM-encoded CA certificate for SSL connections
- `sslRejectUnauthorized` (optional): Reject unauthorized SSL certificates when SSL is enabled

### Setup settings

Whichever method you pick, setup also asks for:

- `defaultDatabase` (optional): Default database to use for queries when not explicitly specified
- `queryTimeout` (optional): Query timeout in milliseconds
- `maxRows` (optional): Maximum number of rows to return from queries by default

## Admin: share MySQL in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose MySQL. Under **Auth Method**, keep **Connection String** or pick another. For how members connect, choose **Each person connects** so everyone enters their own connection string, or **Shared connection** to enter one connection string for everyone.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from MySQL.

4. **Choose who gets it**

   Add the access groups that should see MySQL. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user MySQL integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search mysql
```

## Employee: connect MySQL

### In the portal

1. **Open MySQL in the catalog**

   Sign in to your portal and open MySQL. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. In the setup window, enter your connection string (connectionString).

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search mysql
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. `metorial setup` uses **Connection String**. To connect with **Connection Parameters** instead, find its ID with `metorial catalog get <catalog-item-id>` and add `--auth-method <auth-method-id>`.

### Add it to your AI client

`metorial install` adds your MySQL connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list mysql
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 3 read-only tools, such as `list_tables` and `describe_table`, and lose the 2 write tools, such as `insert_rows` or `execute_query`, and the 6 destructive tools, such as `delete_rows` or `update_rows`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list mysql
metorial tools <integration-id>
metorial call <integration-id> list_tables -d '{}'
```

`metorial tools` lists the 11 tools, minus any you rejected. `list_tables` takes no input. It lists all tables in a MySQL database.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (3)

- `list_tables`: List all tables in a MySQL database.
- `describe_table`: Get detailed schema information for a specific MySQL table, including columns, data types, constraints, indexes, and foreign keys. Needs `tableName`.
- `list_databases`: List all databases on the MySQL server.

### Write tools (2)

- `insert_rows`: Insert one or more rows into a MySQL table. Needs `tableName` and `rows`.
- `execute_query`: Execute an arbitrary SQL query against the MySQL database. Needs `sql`.

### Destructive tools (6)

- `update_rows`: Update rows in a MySQL table that match a WHERE condition. Needs `tableName` and `values`.
- `manage_table`: Create, alter, or drop a MySQL table. Needs `action` and `tableName`.
- `manage_indexes`: Create or drop indexes on MySQL tables. Needs `action`, `tableName` and `indexName`.
- `manage_users`: Create, drop, or manage MySQL user accounts and their privileges. Needs `action`.
- `delete_rows`: Delete rows from a MySQL table that match a WHERE condition. Needs `tableName`.
- `manage_database`: Create or drop MySQL databases. Needs `action` and `databaseName`.

## Triggers

MySQL has 2 triggers, which fire on events in MySQL:

- `table_row_changes`: Polls a MySQL table for new or updated rows based on a timestamp or auto-incrementing column.
- `inbound_webhook`

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use MySQL there
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [MySQL on metorial.com](https://metorial.com/integrations/mysql): the integration overview