Registry / database / mariadb-mcp-server

mariadb-mcp-server

JSON →
library0.0.1jsnpmunverified

An MCP (Model Context Protocol) server providing read-only access to MariaDB and MySQL databases for AI agents. Version 0.0.1, initial release. Allows listing databases, tables, describing schemas, and executing SELECT queries with built-in security: read-only by default, SQL injection prevention, query timeout, and row limits. Supports both MariaDB and MySQL via environment variable configuration. No known breaking changes yet.

npm install mariadb-mcp-server
INSTALL
IMPORT
SIG · MARIADB-MCP-SERVER
M
mariadb-mcp-server
databasejavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mariadb-mcp-server
Install globally with 'npm install -g mariadb-mcp-server' and use as a CLI command.
Trying to require('mariadb-mcp-server') in a Node.js script.
This package is an MCP server binary, not a library. It should be invoked as a CLI tool via npx or node.

Add the server configuration to your MCP client to enable AI agents to query MariaDB/MySQL databases.

{ "mcpServers": { "mariadb": { "command": "npx", "args": ["mariadb-mcp-server"], "env": { "MARIADB_HOST": "localhost", "MARIADB_PORT": "3306", "MARIADB_USER": "user", "MARIADB_PASSWORD": "password", "MARIADB_DATABASE": "mydb", "MARIADB_ALLOW_INSERT": "false", "MARIADB_ALLOW_UPDATE": "false", "MARIADB_ALLOW_DELETE": "false", "MARIADB_TIMEOUT_MS": "10000", "MARIADB_ROW_LIMIT": "1000" }, "disabled": false, "autoApprove": [] } } }
Debug
Known issues
gotchaRead-only by default: INSERT, UPDATE, DELETE are blocked unless explicitly allowed via MARIADB_ALLOW_* environment variables.
fix
Set MARIADB_ALLOW_INSERT=true, MARIADB_ALLOW_UPDATE=true, MARIADB_ALLOW_DELETE=true to enable write operations (not recommended for security).
affects: >=0.0.1
gotchaUsing the wrong server_name in tool calls: tools require server_name 'mariadb' or 'mysql'.
fix
Ensure JSON argument includes 'server_name': 'mariadb' or 'mysql'.
affects: >=0.0.1
breakingPackage is not importable as a Node.js module; it's a CLI tool only.
fix
Use as CLI: 'npx mariadb-mcp-server' or configure in MCP settings.
affects: >=0.0.1
deprecatedNo deprecation warnings yet as it's initial release.
fix
N/A
affects: >=0.0.1
Errors
Common errors & fixes
Error: Cannot find module 'mariadb-mcp-server'
Trying to require the package as a library instead of using it as a CLI.
fix
Install globally with 'npm install -g mariadb-mcp-server' and use via command line or MCP settings.
Error: ER_ACCESS_DENIED_ERROR: Access denied for user '...'
Incorrect database credentials or insufficient privileges.
fix
Verify MARIADB_USER, MARIADB_PASSWORD, and ensure the user has SELECT privileges on target databases.
Query times out after 10 seconds
Default timeout is 10 seconds; long-running queries exceed this.
fix
Set MARIADB_TIMEOUT_MS to a higher value, or optimize the query.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
@modelcontextprotocol/sdkrequiredRequired to implement MCP server protocol
mysql2requiredDatabase driver for MariaDB/MySQL connections
Agent activity
11 hits · last 30 days
node
10
Resources
mariadb-mcp-server — npm install mariadb-mcp-server · libregistry