MySQL MCP server
Prebuilt SnapLogic agentic-tool pipelines that let an LLM read from and act on MySQL, callable as MCP tools via Pipeline Execute. Published in the SnapLogic pattern catalog.
Overview
This tool pack gives an agent access to a MySQL database through two paths: raw SQL (split into read and write tools) and structured row operations (insert and update with a record object, no SQL required). One connected MySQL account covers every table the database user can reach, including INFORMATION_SCHEMA for schema discovery.
For setup instructions, see SnapLogic MCP Server quickstart.
Example Prompts
- What tables exist in this database?
- Show me the columns and data types on the customers table
- List the top 10 customers by balance
- How many orders were placed in the last 30 days, grouped by status?
- Find every customer whose email domain is acme.com
- Call the update_customer_status procedure for customer 42 with status premium
- Delete the orders that were cancelled more than a year ago
- Set every customer with no orders to status inactive
- Add an index on the email column of the customers table
- Copy last month's rows from orders into orders_archive
Tools
| Tool Name | Functions |
|---|---|
| MySQLExecuteRead | Run an arbitrary read-only SQL query and return the result rows. |
| MySQLExecuteWrite | Run an arbitrary data-changing SQL statement or stored-procedure call. |
| MySQLInsertRows | Insert a row into a named table from a record object. |
| MySQLInsertRowsChild | My SQL Insert Rows Child |
| MySQLUpdateRows | Update rows in a named table from a record object and a WHERE condition. |
| MySQLUpdateRowsChild | My SQL Update Rows Child |
Set up the MCP Server tools
- Download mysql_tools.zip.
- In SnapLogic Designer, open the target project space (or create one), then choose Import Project / Import Pipelines and select the downloaded mysql_tools.zip. Designer unpacks each pipeline into the project.
- Attach the required account to the connectivity snaps (see Connection Setup).
- Expose the project as an MCP server — each pipeline becomes a tool named after its label. New to this? Start with the MCP quickstart, then use the MCP Server Pipeline Builder to generate the server from the imported pipelines.
Configure account
Attach a MySQL account (database or dynamic) to the MySQL snaps in Designer after import.
These pipelines ship without credentials by design — attach a valid account in Designer before the tools will execute.
See the SnapLogic account documentation for this connector: Configuring The Mysql Account.
MySQLExecuteRead
Runs an arbitrary read-only SQL statement against the connected MySQL database and returns the result rows. Use it for SELECT queries, schema discovery against INFORMATION_SCHEMA, and any question that can be answered with a query; use MySQLExecuteWrite for data-changing statements.
| Parameter | Type | Default | Description |
|---|---|---|---|
| sql_statement* | string | — | The full read-only SQL statement to execute, e.g. SELECT TABLE_NAME, TABLE_TYPE FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = DATABASE(). |
* Required parameter.
Try asking:
- What tables exist in this database?
- Show me the columns and data types on the customers table
- List the top 10 customers by balance
- How many orders were placed in the last 30 days, grouped by status?
- Find every customer whose email domain is acme.com
MySQLExecuteWrite
Runs an arbitrary data-changing SQL statement (INSERT, UPDATE, DELETE, DDL, or a stored-procedure call) against the connected MySQL database. Use it for complex or multi-table changes; for straightforward single-row work, prefer MySQLInsertRows or MySQLUpdateRows.
| Parameter | Type | Default | Description |
|---|---|---|---|
| sql_statement* | string | — | The full data-changing SQL statement to execute, e.g. CALL update_customer_status(42, 'premium'). |
* Required parameter.
Try asking:
- Call the update_customer_status procedure for customer 42 with status premium
- Delete the orders that were cancelled more than a year ago
- Set every customer with no orders to status inactive
- Add an index on the email column of the customers table
- Copy last month's rows from orders into orders_archive
MySQLInsertRows
Inserts a new row into a named MySQL table from a record object, without requiring hand-written SQL. Duplicate keys return an error rather than being silently ignored; for inserts that need SQL the record form cannot express, use MySQLExecuteWrite.
| Parameter | Type | Default | Description |
|---|---|---|---|
| table_name* | string | — | Name of the table to insert into, e.g. customers. |
| schema_name | string | — | Schema (database) containing the table. Omit to use the account's default schema. |
| record* | object | — | The row to insert as a field map of column name to value, e.g. {name: 'Acme Corp', email: '[email protected]', balance: 5000}. |
* Required parameter.
Try asking:
- Add a new customer called Acme Corp with email [email protected] and a balance of 5000
- Insert a row into the products table for SKU A-1099, price 249
- Create a customer record in the mydb schema for Northwind Ltd
- Log a new entry in the audit_events table for this run
MySQLInsertRowsChild
Lets the LLM my sql insert rows child, exposed as an MCP tool callable via Pipeline Execute.
| Parameter | Type | Default | Description |
|---|---|---|---|
| table_name | string | customers |
— |
| schema_name | string | — | — |
MySQLUpdateRows
Updates rows in a named MySQL table from a record object and a WHERE condition, without requiring hand-written SQL. Every row matching the condition is updated, so use a precise predicate to control how many rows change.
| Parameter | Type | Default | Description |
|---|---|---|---|
| table_name* | string | — | Name of the table to update, e.g. customers. |
| schema_name | string | — | Schema (database) containing the table. Omit to use the account's default schema. |
| update_condition* | string | — | SQL WHERE predicate identifying the rows to update, e.g. id = 42. All matching rows are changed. |
| record* | object | — | Columns to change as a field map of column name to new value, e.g. {balance: 7500, status: 'premium'}. |
* Required parameter.
Try asking:
- Set customer 42's balance to 7500 and status to premium
- Mark every order with status pending as processing
- Update the email on the customers row where id = 108
- In the mydb schema, set discount_rate to 0.15 for all customers on the enterprise tier
MySQLUpdateRowsChild
Lets the LLM my sql update rows child, exposed as an MCP tool callable via Pipeline Execute.
| Parameter | Type | Default | Description |
|---|---|---|---|
| table_name | string | customers |
— |
| schema_name | string | — | — |
| update_condition | string | id = 1 |
— |