MySQL MCP serverand Python AI tasks
qbash hosts a MySQL MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse.
Developers use qbash Tasks to write cloud-hosted Python functions that pair MySQL with models such as Claude and GPT.
MCP server
Build a MySQL MCP server
Give ChatGPT, Claude and your other AI tools access to MySQL through one server. You pick which MySQL tools it shares, and you can add other connectors, memory folders and Tasks to the same server.
How to set it up
- Connect MySQL on the qbash Connectors page.
- Create an MCP server and add the MySQL tools you want to share.
- Paste the server URL into your client. It connects with OAuth or an access token.
Python AI task
Write a MySQL task in Python
A qbash Task is a hosted Python function that calls MySQL and AI models.
Flag refund requests waiting on approval
The query returns the 25 oldest pending requests over two days old. An inline prompt turns them into a note with the count and total amount.
report = qbash.integrations.mysql.execute_query(
query="""SELECT refund_id, order_id, amount, reason, requested_at
FROM refund_requests
WHERE status = ? AND requested_at < NOW() - INTERVAL 2 DAY
ORDER BY requested_at LIMIT 25""",
query_params=["pending"], output_format="json_rows",
)
rows = report["result"]
if rows:
note = qbash.ai.run_prompt(
slug="mysql-pending-refunds",
variables={"refunds": json.dumps(rows)},
)
qbash.output(note)
else:
qbash.output("No refund requests have waited more than two days.")
Sample execute_query response
{
"status": "success",
"result": [
{
"refund_id": 5310,
"order_id": 1042,
"amount": "189.50",
"reason": "Item arrived damaged",
"requested_at": "2026-10-02T09:15:00"
}
],
"row_count": 1
}
What the MySQL connector can do
- Run a SQL statement against a MySQL database. It runs with the rights of the configured account, so point the credential at a read only account to keep it to reads
- List the databases the configured account can see
- List the tables and views in a database
- Describe the columns, indexes, foreign keys and check constraints of a table
qbash Tasks: AI applications in Python
A Task is a Python function that calls MySQL, your other connectors and models such as Claude, GPT, Gemini and Grok. qbash hosts and runs it.
Run Tasks on a schedule or from your team's tools
- Deterministic where it counts Write the logic in Python and call a model only for the steps that need judgement, so the rest runs the same way every time.
- Version controlled Every save is a revision you can compare and roll back.
- Logged Each run records its inputs, output, errors and what started it.
- Shared credentials Connections belong to your organization, so a Task keeps working when its author is away.
MySQL MCP questions
Does MySQL have an official MCP server?
Oracle lists a MySQL MCP server for MySQL AI and HeatWave. qbash hosts the connection for any MySQL or MariaDB database it can reach and serves MySQL tools on one URL with other connectors and Tasks.
Can qbash reach a MySQL server on a private network?
No. The server must accept connections from qbash on a public address, and qbash refuses private and loopback addresses.
How do I keep the MySQL MCP server to reads?
Connect a MySQL user granted only SELECT. execute_query runs one statement per call with that user’s grants, so a write fails at the database.
Related data connectors
Build a MySQL task
Write it in Python with AI steps, and qbash hosts it with versions and run logs.
Build a MySQL MCP server
Pick the MySQL tools to share and connect ChatGPT, Claude or Grok Bot.