Set up MySQL in Metorial for Claude, ChatGPT and Cursor
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'll 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 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, 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 addressport(optional): MySQL server port (default: 3306)database: Target database nameusername: Database usernamepassword: Database passwordsslMode(optional): SSL connection mode One of "disabled", "preferred", "required".sslCa(optional): PEM-encoded CA certificate for SSL connectionssslRejectUnauthorized(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 specifiedqueryTimeout(optional): Query timeout in millisecondsmaxRows(optional): Maximum number of rows to return from queries by default
Admin: share MySQL in a portal
In the dashboard
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
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.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from MySQL.
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:
Employee: connect MySQL
In the portal
Open MySQL in the catalog
Sign in to your portal and open MySQL. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. In the setup window, enter your connection string (connectionString).
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
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.
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.
Check it worked
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. NeedstableName.list_databases: List all databases on the MySQL server.
Write tools (2)
insert_rows: Insert one or more rows into a MySQL table. NeedstableNameandrows.execute_query: Execute an arbitrary SQL query against the MySQL database. Needssql.
Destructive tools (6)
update_rows: Update rows in a MySQL table that match a WHERE condition. NeedstableNameandvalues.manage_table: Create, alter, or drop a MySQL table. NeedsactionandtableName.manage_indexes: Create or drop indexes on MySQL tables. Needsaction,tableNameandindexName.manage_users: Create, drop, or manage MySQL user accounts and their privileges. Needsaction.delete_rows: Delete rows from a MySQL table that match a WHERE condition. NeedstableName.manage_database: Create or drop MySQL databases. NeedsactionanddatabaseName.
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, Cursor, Codex and ChatGPT: connect each client to your portal and use MySQL there
- Tool permissions: tool filters and what employees see
- MySQL on metorial.com: the integration overview