Skip to content

Databases · MCP integration

Connect MySQL to your AI, with control over every query.

Use your MCP-compatible AI app to inspect a MySQL schema, investigate an order or explain a query without passing it a database password. GateRook provides the built-in MySQL connector, a scoped MCP endpoint and a visible approval step for changes.

MySQL, in your AI workflow

Illustrative example

Connection in GateRook

stage-mysql

MySQL

stage / QA
Connector type
MySQL
Name / environment
stage-mysql / stage
Host / port
mysql.stage.internal / 3306
Database
orders

The route

Your AI requests a tool. GateRook checks the endpoint policy, resolves credentials locally, and calls the configured service.

Understand the request flow

Ask your AI

Check the status and total of order 48213 in MySQL. Read only.

sql_query · arguments
{
  "connection": "stage-mysql",
  "sql": "SELECT id, status, total FROM orders WHERE id = 48213",
  "limit": 10
}
Example result
{
  "columns": [
    "id",
    "status",
    "total"
  ],
  "rows": [
    [
      48213,
      "pending",
      "149.00"
    ]
  ],
  "rowCount": 1,
  "truncated": false
}

Sample configuration and output, not a live connection. Replace example values with your environment. Tool names here are connector names; the endpoint may expose a connection-specific name.

Put context to work

What you can do with MySQL and AI

Understand an unfamiliar schema

Ask the agent to list the available tables, describe their columns and follow foreign keys before it proposes a join. The database allowlist keeps the exploration inside the databases you selected.

Investigate an application issue

Read the status of a specific order or compare grouped counts with a limited SELECT. Pair the endpoint with Redis or HTTP access to compare persisted state with the cache or API response.

Review a proposed correction

Let the agent prepare a targeted UPDATE through sql_execute. GateRook shows the exact statement for approval; the database account and environment policy still decide which changes are possible.

From service to MCP

How to connect MySQL

GateRook must be running on a computer that can reach your service. Open Connections, choose Add connection, and select MySQL. Give the connection a name and environment.

New to GateRook? Start with the full setup guide.
  1. Prepare a database login

    Create or select a MySQL user with read access to the intended tables. Keep the database reachable from your desktop. A read-only login adds a database-level boundary alongside the endpoint policy.

  2. Choose MySQL and configure the connection

    Open Connections, choose Add connection, then MySQL. Set the name, environment, host, port and database. Enter credentials in the connection form, separately from anything you paste into an AI conversation.

  3. Set TLS, scope and query limits

    Keep verify-full for a server with TLS, add its private CA when needed, and restrict the database allowlist. Advanced settings include statement timeout, pool size and connection timeout. Policies may impose stricter limits.

  4. Test the connection before saving

    Continue to Test and review connectivity and the privileges reported for the login. Finish Add to endpoint to save the connection. Leave mutation tools Off unless you intend to review proposed changes.

  5. Choose the endpoint and tool modes

    Add the tested connection to an endpoint. In Tools & policies, enable only the tools needed for the task. Start with Read only where supported; use Approval for any selected mutation and leave other tools Off. A connection alone does not grant an AI client access.

  6. Connect your AI and verify the first call

    In Clients, choose your AI app and endpoint, review the connection details, and connect. Try this guide’s example in Playground before asking your AI. Open Activity to inspect the tool, target, decision and returned result. The getting started guide covers this shared flow.

Connection settings

Configure MySQL in GateRook

These are example values for the connection form. Enter credentials into GateRook’s secret fields, not into an AI prompt. Requirements and alternatives are noted per field.

MySQL connection configuration
SettingExampleHow to use it
Connector typeMySQLChoose the built-in connector in Connections.
Name / environmentstage-mysql / stageA recognizable connection name becomes the connection argument in tool calls.
Host / portmysql.stage.internal / 3306Use a host reachable from the computer running GateRook, including its VPN.
DatabaseordersOptional default database; when omitted, qualify tables with the database name.
User / passwordgateway_reader / Enter in GateRook (write-only)Start with a database account that can only read. Choose Encrypted here or a configured secret store.
SSL modeverify-fullChecks both the certificate authority and host name. Add a PEM CA certificate for a private CA.
Database allowlistordersLimit which schemas or databases this connection exposes; environment policies can tighten the scope.

Know what you expose

MySQL tools and access boundaries

The connector determines what is possible. Endpoint modes and connection policies determine what a particular AI client may use.

Available tools and access behavior
ToolPurposeAccess behavior
sql_list_schemasDiscover the schemas, databases and tables visible to the connection user.Read only
sql_describe_tableInspect columns, types, indexes and foreign keys before writing a query.Read only
sql_queryRun a read query or EXPLAIN in a read-only transaction, with endpoint limits.Read only
sql_executePropose INSERT, UPDATE or DELETE. You review and approve the exact SQL before execution.Approval

Before you enable access

  • sql_query runs reads in a read-only transaction. sql_execute is a separate tool and requires approval for changes; a read-only database login still cannot write after approval.
  • The endpoint caps rows and execution time. Do not treat a truncated result as the full dataset.
  • Unknown user-defined functions are not automatically trusted as reads: they require approval, and are refused on prod unless allowed by policy.
  • A query result can contain application data. Choose tables, columns and access scope deliberately before exposing them to an AI app.

GateRook stores local connection secrets encrypted and resolves them for connectors. Allowed tool results are returned to your AI client and may be processed by its provider. Scope the data you expose as well as the actions you allow.

Practical answers

MySQL connection questions

Use Test connection to isolate service access problems. Use Playground and Activity to inspect endpoint permissions and tool calls.

Is GateRook a MySQL MCP server or an AI client?

GateRook connects to MySQL and exposes selected database tools through an MCP endpoint. Your AI app is the MCP client. It receives the endpoint configuration, while the database password stays with the GateRook connection.

Can the AI change database records?

Only when you expose sql_execute in Approval mode, the policy permits the statement, the database user has permission, and you approve the exact action. There is no mode for unattended writes.

Does the MySQL connector also support MariaDB?

Yes. The MySQL dialect explicitly handles MySQL and MariaDB, including their different statement timeout settings. Use MySQL in the connection picker for either server; the MariaDB guide describes that setup.

Do I need to expose the database to the public internet?

No. The local GateRook core connects from your computer, so an existing VPN and private network route can be used. The database must be reachable by that computer.

Keep exploring

PostgreSQL

Connect PostgreSQL to an MCP-compatible AI app with GateRook. Explore schemas, run read-only SQL, review changes and keep database credentials out of prompts.

MariaDB

Connect MariaDB to an MCP-compatible AI app with GateRook. Explore schemas, run read-only SQL, review changes and keep database credentials out of prompts.

Redis

Connect Redis to an AI app through MCP. Scan allowed keys, inspect values and TTLs, and troubleshoot cache data with the read-only GateRook connector.

Browse all integration guides

Your infrastructure, on your terms

Bring MySQL into the conversation.

Start with one connection. Choose what your AI can do.

Get GateRook

GateRook is in active development. Installers will appear here after a verified release.

macOS

Coming soon. The macOS build is not available yet.

Windows

Coming soon. The Windows build is not available yet.