GuidesMySQL and MariaDB
An AI agent for MySQL and MariaDB that knows how your tables join.
DeepORG connects to MySQL 8.0+ and MariaDB 10.2+, maps the schema into a catalog the agent can search, and runs each question as one parameterized statement. Many MySQL schemas never declared their foreign keys; you can name those joins once, in config, so the agent stops guessing them.
The short version
What you get on MySQL.
- A catalog, not a prompt full of DDL. The agent searches for the tables a question needs and reads only those.
- One statement per question. The engine compiles the agent’s query into MySQL, with nested results built by
JSON_OBJECTandJSON_ARRAYAGGinside the database. - The agent never writes SQL. It writes a GraphQL query; the engine writes the statement and hands values to the driver as parameters.
- Rules from the caller. Row filters and column lists come from the signed-in person’s role and are compiled into the statement.
Connect
Name the database in config.
curl -fsSL https://deeporg.io/install.sh | bash# config/dev.yml
sources:
- name: app
kind: database
type: mysql # or mariadb
default: true
# user:pass@tcp(host:3306)/app?multiStatements=true&parseTime=true&interpolateParams=true
connection_string: ${MYSQL_DSN}
read_only: true # start read-onlyThe connection string is the Go driver’s DSN, with the parameters the engine expects. A mysql:// prefix is accepted and stripped. Amazon Aurora MySQL, RDS for MySQL and Google Cloud SQL for MySQL connect the same way.
deeporg serveMissing joins
Tell it the joins your schema never declared.
Plenty of MySQL applications enforce relationships in code and never create a foreign key. Without one, an agent has to guess that orders.cust_id points at customers.id, and a guess is where wrong answers start.
Declare it once:
tables:
- name: orders
columns:
- name: cust_id
foreign_key: customers.idFrom then on the join is on the map, the agent can follow it, and the engine compiles it like any other relationship. A person can also pin a note to a column, such as which of two status columns is the real one, through annotations.
Your AI client
Add it to Claude Code or Codex.
claude mcp add deeporg -- deeporg mcp --path /absolute/path/to/config
codex mcp add deeporg -- deeporg mcp --path /absolute/path/to/configThat runs DeepORG over stdio with your config; your client’s model does the reasoning. Against a running server, use deeporg mcp add claude http://localhost:8080 instead.
Limits
Where MySQL differs.
- No array columns. MySQL has none, so array filters and array joins are Postgres and MongoDB features.
- Writes run step by step. MySQL has no
RETURNING, so a nested insert runs as a short sequence of statements rather than a single one. - Geo filters need MySQL 8.0. MariaDB has them too. Full-text search works on both.
- Tested versions. The test suite runs against MySQL 8.0 and MariaDB 10.11.
Go deeper
Related pages.
- MCP server for PostgreSQL: the same setup, with the five questions to ask any database MCP server.
- DeepORG vs text-to-SQL: why a guessed join is the usual failure.
- Relationships: how nested queries become joins.
- Database support: every dialect side by side.