Documentation · MariaDB
MCPDBWizard for MariaDB
MCPDBWizard for MariaDB is the same product pointed at MariaDB. You select the tables, views, procedures, functions, package members, sequences and SQL statements an agent may use, and it generates an MCP server for exactly those. An object you did not select has no tool, no method and no class, and every call binds its values rather than passing SQL text. The console, the proxy, accounts, tokens, the access grid, audit and Context Pinning all work as they do on Oracle.
It is a separate image, because a MariaDB image carries no Oracle driver at all:
docker pull ghcr.io/srmadscience/mcpdbwizard-mariadb:2.0.36
docker pull docker.io/srmadscience/mcpdbwizard-mariadb:2.0.36
Both registries hold the same multi-arch image (linux/amd64, linux/arm64). One licence
covers every product: an MCPDBWizard licence unlocks the Oracle, Postgres and MariaDB images
alike. See Commercials.
To get it running, follow Quickstart: MariaDB. To try it on a schema made for the purpose, the MariaDB hotel demo has one, with a customer-facing config that uses Context Pinning.
Supported versions
MariaDB 11.4, 11.8, 12.3 and 13.x. Each release is tested against all four, and against 11.4
and 13.0 with lower_case_table_names=1 as well as 0.
10.11 is not supported. There, a login that did not create a routine cannot read its source,
and the source is the only place MariaDB records a ROW parameter’s fields or a package’s members.
Two features need a newer server: cursor outputs need 12.3 or later, and VECTOR needs
11.8 or later.
What becomes a tool
| Object | Tools | Notes |
|---|---|---|
| Table | get_by_pk, insert, update, delete, plus a lookup per unique key, index and foreign key | Needs a primary key, as on Oracle, so a view gets none. Generated columns are never written. A SPATIAL, FULLTEXT or VECTOR index gets no lookup, because equality cannot use it. |
| Procedure or function | One tool per routine | IN, OUT and INOUT parameters, and ROW / ROW TYPE OF parameters as JSON objects. |
| Member of a package | One tool per member | Oracle-mode packages, and default-mode packages on 11.4 and later. |
| Procedure that returns result sets | Its tool returns them as result_sets | Each with its columns and at most 10,000 rows, flagged truncated past that. |
SYS_REFCURSOR output (12.3+) | Returned as rows | Up to 64 columns. Column types are known for a SELECT * over a table; otherwise a column crosses as text, or as base64 when it is not valid UTF-8. |
| Sequence | nextval | |
| Your own SQL statement | One tool per statement | Described by the server when the server is generated, so a bad statement is caught then. |
How the types cross
| MariaDB | Over MCP |
|---|---|
int and the other integer types, decimal, float, double, bit, year | number |
tinyint(1), boolean | number (MariaDB stores a boolean as a tinyint) |
char, varchar, text, enum, set | string |
date, datetime, timestamp | string, in MariaDB’s own text form |
time | string: it is a duration, and can exceed 24 hours |
binary, varbinary, blob | base64 string |
json | JSON text: a string holding the document, not an object |
geometry, point, polygon and the other spatial types | EWKT string: SRID=4326;POINT(1 2) |
vector(n) (11.8+) | array of numbers |
ROW(...), ROW TYPE OF | JSON object, keyed by field name |
A geometry is checked as EWKT on the way in, and text that is not EWKT is refused rather than
becoming NULL, which is what MariaDB’s own ST_GeomFromText would do with it. A vector’s
dimensions are 32-bit floats, so a value sent with more precision comes back rounded.
What is different from Oracle
- An object belongs to a database. Where Oracle has a schema, MariaDB has a database, and the login is not part of the name. The objects listed as your own are those of the database you connect to, whatever the login is called. See Connecting to MariaDB.
- Context Pinning uses a user variable, not
SYS_CONTEXT. A URL parameter such asCUSTOMER_NAMEis set as@mcp_customer_nameat the start of each call, after every@mcp_variable is cleared, so one caller’s value never reaches the next. Unset reads NULL. Nothing needs installing in the database. See Context Pinning. - Pooling is always on, and each tool call is one transaction, committed when it succeeds and
rolled back when it fails. But a
COMMITinside a procedure commits the call’s work up to that point, and DDL commits implicitly, so a later failure cannot undo what came before it. - Package state lasts as long as the session. A package’s variables and its initialisation section belong to the pooled connection, not to the caller, so they are shared by every caller that connection serves. Don’t keep per-caller state in a package.
- Every parameter is required. A parameter’s default is read, but not applied: the tool asks for every argument.
- Names are case-sensitive on Linux unless the server runs with
lower_case_table_names=1, and nothing is upper-cased on the way in. The default collation ignores case, so a key or a lookup on a text column does too. - A statement timeout stops a routine’s queries but not its
SLEEP(). An interrupted query fails the call; an interruptedSLEEP()orBENCHMARK()returns early and the routine carries on. - No
CREATE TYPEgrant is needed. MariaDB has no object or collection types, so the generator never creates shadow types in your database, and a config has noEXTRA_SQL.
Bringing Oracle code across
MariaDB’s Oracle mode (sql_mode=ORACLE) runs a good deal of PL/SQL, and MCPDBWizard reads its
packages. These are the differences that compile and then surprise you:
timestampis MariaDB’s TIMESTAMP: no fractions, and 1970 to 2038. Writedatetime(6).date + 1adds one second; write+ INTERVAL 1 DAY.- A double-quoted alias is a string. Write
AS `alias`.DELETEneedsFROM. - A foreign key between decimals of different precision accepts no rows at all.
- A routine using
RAISE_APPLICATION_ERROR,EMPTY_CLOB()orTO_TIMESTAMPcompiles, then fails when called. UseSIGNAL. - A name Oracle finds through a synonym must carry its database here.
- A bare
numberis adouble. Give it a precision where exact values matter.
Not supported
- Types: MariaDB has no object, collection,
INTERVALor time-zone types, so none of Oracle’s handling of them applies. - Routines: a cursor as an input (no MCP client can supply one), and a cursor output wider than 64 columns, which fails the call with a message naming it.
- Tables: a table or view without a primary key gets row classes but no MCP tools, as on Oracle.
- SQL statements: a
CALL(select the procedure as a routine instead, which returns its result sets and OUT parameters), and a statement with a?inside a string literal or comment. Both are refused when the server is generated, and the log says why. - The SOAP service layer and the JSON / JSON-RPC external connectors are Oracle-only. The MCP server is how a MariaDB schema is reached.
See also Known issues on MariaDB.