MariaDB MCP Server
Allows managing multiple MariaDB databases, providing tools for schema exploration, SQL query execution (SELECT, INSERT, UPDATE, DELETE, DDL), and atomic transaction support with controlled read/write permissions.
Allows managing multiple MySQL databases, providing tools for schema exploration, SQL query execution (SELECT, INSERT, UPDATE, DELETE, DDL), and atomic transaction support with controlled read/write permissions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MariaDB MCP Server show me the schema for the orders table in the production database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mariadb-mcp-server
MCP (Model Context Protocol) server for MariaDB/MySQL databases. Provides AI assistants with safe, controlled database access through per-connection read/write permissions.
Features
Multi-connection — manage multiple MariaDB/MySQL databases from a single server
Per-connection access control —
readandwriteflags per connectionOptional limits —
statement_timeout_ms,default_row_limit,max_row_limit(all optional, unlimited by default)SQL guard — validates queries to prevent accidental writes through read tools
Transaction support — atomic multi-query execution on writable connections
Related MCP server: MySQL MCP Server
Installation
npm install -g @cemalturkcann/mariadb-mcp-serverOr use directly with npx:
npx @cemalturkcann/mariadb-mcp-serverConfiguration
The server looks for config.json in this order:
DB_MCP_CONFIG_PATHenvironment variableNext to the package (
../config.jsonrelative tosrc/)Current working directory
~/.config/mariadb-mcp/config.json
If no config is found, a default one is created automatically at ~/.config/mariadb-mcp/config.json with a local read-only connection.
Example config:
{
"connections": {
"local": {
"host": "localhost",
"port": 3306,
"user": "root",
"password": "",
"description": "Local MariaDB",
"read": true,
"write": true
},
"production": {
"host": "db.example.com",
"port": 3306,
"user": "readonly_user",
"password": "secret",
"database": "mydb",
"description": "Production (read-only)",
"read": true,
"write": false,
"statement_timeout_ms": 5000,
"default_row_limit": 50,
"max_row_limit": 500
}
}
}Connection options
Field | Type | Default | Description |
| string |
| Database host |
| number |
| Database port |
| string |
| Database user |
| string |
| Database password |
| string |
| Default database |
| string |
| Human-readable label |
| boolean |
| Allow read queries |
| boolean |
| Allow write queries |
| boolean/object |
| SSL configuration |
| number | none | Connection timeout (0 or omit = unlimited) |
| number | none | Default LIMIT for SELECT (0 or omit = unlimited) |
| number | none | Max allowed LIMIT (0 or omit = unlimited) |
MCP Tools
Tool | Description | Requires |
| List all configured connections | — |
| Show databases on a connection |
|
| Show tables (optionally in a specific database) |
|
| Show column definitions |
|
| Run SELECT / SHOW / DESCRIBE / EXPLAIN queries |
|
| Run INSERT / UPDATE / DELETE / DDL queries |
|
| Run multiple write queries atomically |
|
| Suggest a query for manual review | — |
MCP Client Setup
On first run, a default config is created automatically at ~/.config/mariadb-mcp/config.json (Linux/macOS) or %APPDATA%\mariadb-mcp\config.json (Windows). Edit it to add your connections.
Claude Code
Add to ~/.claude.json:
{
"mcpServers": {
"mariadb": {
"command": "npx",
"args": ["-y", "@cemalturkcann/mariadb-mcp-server"]
}
}
}OpenCode
Add to your opencode.json:
{
"mcp": {
"mariadb": {
"type": "local",
"command": ["npx", "-y", "@cemalturkcann/mariadb-mcp-server"]
}
}
}Other MCP Clients
Any MCP-compatible client can use this server. The binary name is mariadb-mcp-server and it communicates over stdio. To use a custom config path, set DB_MCP_CONFIG_PATH.
License
MIT
Available Tools
6 toolsdescribe_tableC
Returns column information for a table.
Inputs: connection (required), table (required), database.
execute_selectB
Executes a read-only SELECT/SHOW/DESCRIBE/EXPLAIN query. Row limit is enforced.
Inputs: connection (required), query (required), database, row_limit.
list_connectionsB
Lists configured MariaDB connections.
Inputs: no named parameters.
list_databasesB
Lists databases for the selected connection.
Inputs: connection (required).
list_tablesC
Lists tables for the selected connection.
Inputs: connection (required), database.
suggest_queryC
Suggests a query that should be executed manually.
Inputs: connection (required), query (required), reason.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a distinct purpose: describing tables, executing SELECT queries, listing connections, databases, tables, and suggesting queries. No overlap.
All tool names follow a consistent verb_noun snake_case pattern (e.g., describe_table, list_databases).
6 tools is well-scoped for a MariaDB server, covering metadata listing, query execution, and query suggestion without being excessive or thin.
Covers read-only operations (SELECT, DESCRIBE, metadata listing) and query suggestion, but lacks write operations (INSERT/UPDATE/DELETE) and DDL commands. This gap appears intentional but limits the surface.
Maintenance
Related MCP Connectors
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
PostgreSQL, MySQL, OpenAPI/Swagger, and shared Agent Memory with scoped access.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with MariaDB databases through SQL operations and vector-based semantic search. Supports standard database queries, schema inspection, and optional embedding-powered document storage and retrieval.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely connect to and manage MySQL databases with support for multiple database connections, complete CRUD operations, schema inspection, and dynamic connection management through natural language.31 npm81MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to securely interact with MySQL databases through tools for query execution, schema inspection, and transaction management. It features built-in safety controls like row limits and query validation to ensure safe and standardized database access.862 npm-
- AlicenseAqualityDmaintenanceEnables AI agents to safely interact with MySQL/MariaDB databases, supporting read-only queries by default with optional write operations and access control.8MIT