database-mcp-mariadb
MCP server by arifulislamat Community
Gives AI assistants structured access to MariaDB through the execute_sql and search_objects tools. Read-only mode, row caps and statement timeouts are on by default, and secrets are kept out of logs. Aimed at AI clients that need safe database access.
Install database-mcp-mariadb
Built from the published package, never by AI.
claude mcp add database-mcp-mariadb -e MARIADB_HOST=YOUR_MARIADB_HOST -e MARIADB_USER=YOUR_MARIADB_USER -e MARIADB_DATABASE=YOUR_MARIADB_DATABASE -- npx -y @database-mcp/mariadbRun in your terminal. Add --scope user to use it in every project.
{
"mcpServers": {
"database-mcp-mariadb": {
"env": {
"MARIADB_HOST": "YOUR_MARIADB_HOST",
"MARIADB_USER": "YOUR_MARIADB_USER",
"MARIADB_DATABASE": "YOUR_MARIADB_DATABASE"
},
"args": [
"-y",
"@database-mcp/mariadb"
],
"command": "npx"
}
}
}Settings, Developer, Edit config. Paste into claude_desktop_config.json and restart.
Step-by-step: install database-mcp-mariadb in Claude Desktop
{
"mcpServers": {
"database-mcp-mariadb": {
"env": {
"MARIADB_HOST": "YOUR_MARIADB_HOST",
"MARIADB_USER": "YOUR_MARIADB_USER",
"MARIADB_DATABASE": "YOUR_MARIADB_DATABASE"
},
"args": [
"-y",
"@database-mcp/mariadb"
],
"command": "npx"
}
}
}Add to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (this project).
{
"servers": {
"database-mcp-mariadb": {
"env": {
"MARIADB_HOST": "YOUR_MARIADB_HOST",
"MARIADB_USER": "YOUR_MARIADB_USER",
"MARIADB_DATABASE": "YOUR_MARIADB_DATABASE"
},
"args": [
"-y",
"@database-mcp/mariadb"
],
"command": "npx"
}
}
}Add to .vscode/mcp.json. VS Code uses "servers", not "mcpServers".
codex mcp add database-mcp-mariadb --env MARIADB_HOST=YOUR_MARIADB_HOST --env MARIADB_USER=YOUR_MARIADB_USER --env MARIADB_DATABASE=YOUR_MARIADB_DATABASE -- npx -y @database-mcp/mariadb{
"mcpServers": {
"database-mcp-mariadb": {
"env": {
"MARIADB_HOST": "YOUR_MARIADB_HOST",
"MARIADB_USER": "YOUR_MARIADB_USER",
"MARIADB_DATABASE": "YOUR_MARIADB_DATABASE"
},
"args": [
"-y",
"@database-mcp/mariadb"
],
"command": "npx"
}
}
}Add to ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project).
Step-by-step: install database-mcp-mariadb in Antigravity CLI
gemini mcp add database-mcp-mariadb npx -y @database-mcp/mariadbGemini CLI was replaced by Antigravity CLI in June 2026 and remains only for enterprise licences and paid API keys.
MCP servers run with your permissions and can read what you give them access to. Some need an API key: check the README and add it under env in the database-mcp-mariadb block.
About
database-mcp-mariadb is an MCP server that gives AI clients safe, structured access to a MariaDB database. It is one package in the database-mcp project, which also covers SQLite, libSQL, MySQL and Postgres. Every package exposes the same two tools, execute_sql and search_objects.
Guardrails are on by default: read-only mode enforced by a SQL guard and a session-level setting, row caps of 1000 rows, and statement timeouts of 30 seconds. Connection details come from flags, a YAML file or environment variables, not chat, and passwords are kept out of logs. It is aimed at AI clients that need structured MariaDB access without write access by default.
Written from the project's README and checked against it.
Tools it gives your assistant
execute_sqlRuns SQL against the database with read-only mode, row caps and timeouts on by default.search_objectsLists tables when called with no arguments, or returns columns, indexes and foreign keys for a named table.
What you need
- Node.js for the npm package run with npx
- Python with uvx for the PyPI package
- Rust and cargo for the native binary
- A MariaDB database and connection details set through environment variables, flags or YAML
| Setting | Needed | What it is |
|---|---|---|
MARIADB_Environment variable | Required | Database host |
MARIADB_Environment variable | Required | Database user (a read-only user is recommended) |
MARIADB_Environment variable | Required | Database name |
MARIADB_Environment variable, secret | Optional | Database password (or use MARIADB_PASSWORD_FILE) |
From the publisher's entry in the official MCP Registry. Required settings are already in the install config below as placeholders.
Try asking
- List all the tables in my MariaDB database.
- Show the columns, indexes and foreign keys for the orders table.
- Run a read-only SQL query that counts rows in each table.
Good to know
- Rows are capped at 1000 by default.
- Statements time out after 30 seconds by default.
- Credentials cannot be passed through a tool call.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: README.md, package.json. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to database-mcp-mariadb
All alternatives →Connects Supabase projects to AI assistants such as Cursor, Claude and Windsurf over the Model Context Protocol. It lets assistants manage tables, fetch config and query data in a Supabase project.
ArcadeDB MCP Server is the built-in Model Context Protocol server of the ArcadeDB multi-model database. It lets AI assistants and LLMs work with ArcadeDB's graph, document, time-series, vector and other data models. It suits people who already run ArcadeDB and want assistant access to it.
Connects MCP clients such as Claude Desktop, Cursor and VS Code to PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, ClickHouse and SQLite. It exposes two tools by default, with read-only mode and query timeouts available as guardrails.
MCP Toolbox for Databases is an open source MCP server that connects AI agents, IDEs and applications to enterprise databases. It provides prebuilt tools for exploring schemas and running queries, plus a framework for custom tools. It is aimed at developers building agents that need database access.
Connects AI agents, IDEs and applications to enterprise databases through the Model Context Protocol. Offers prebuilt database tools for MCP clients and a framework for building custom tools for production agents.
MongoDB MCP Server lets AI assistants interact with MongoDB databases and MongoDB Atlas. It is an official server from mongodb-js, run locally with npx or Docker. It works with self-managed deployments and Atlas clusters.
Compare with Supabase, ArcadeDB MCP Server or DBHub
database-mcp-mariadb: common questions
What tools does database-mcp-mariadb expose?
It exposes two tools, execute_sql and search_objects. Called with no arguments, search_objects lists tables, and called with a table name it returns that table's columns, indexes and foreign keys.
Is database-mcp-mariadb read-only?
Read-only mode is on by default. The source says it is enforced by a conservative SQL guard plus a session-level read-only setting in the database.
How does database-mcp-mariadb handle passwords?
Passwords are stored in non-printable secret types, DSNs are sanitized before logging, and a redaction filter guards the log boundary. Credentials come from the environment, mounted secret files or a YAML file, never from a chat prompt.
How do I install database-mcp-mariadb?
In Claude Code run claude mcp add database-mcp-mariadb -e MARIADB_HOST=YOUR_MARIADB_HOST -e MARIADB_USER=YOUR_MARIADB_USER -e MARIADB_DATABASE=YOUR_MARIADB_DATABASE -- npx -y @database-mcp/mariadb. For Claude Desktop, Cursor and VS Code, paste the config shown above and restart. See the install guides.
Is database-mcp-mariadb the official server?
database-mcp-mariadb is a community project by arifulislamat, not verified by a company domain.
Is database-mcp-mariadb free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is database-mcp-mariadb safe to use?
It scores 73 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to database-mcp-mariadb?
Similar MCP servers: Supabase, ArcadeDB MCP Server, DBHub, MCP Toolbox for Databases.
Does database-mcp-mariadb work with ChatGPT?
Not directly. It runs locally, and ChatGPT only connects to remote servers with a URL. Use it in Claude Code, Claude Desktop, Cursor, VS Code or Codex.
