MariaDB / MySQL Database Access MCP Server

by rjsalgado

14 308 downloads Not rated yet MIT license

About

Provides access to MariaDB and MySQL databases for querying and data manipulation.

Details

License
MIT license

Explore

- Read-only access Default: SELECT, SHOW, DESCRIBE, and EXPLAIN
- Query validation: Prevents SQL injection and blocks any data modification attempts
- Query timeout: Prevents long-running queries from consuming resources
- Row limit: Prevents excessive data return

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MariaDB / MySQL Database Access MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository


npm install -g mariadb-mcp-server

npm install mariadb-mcp-server

npm install
npm run build


The server requires the following environment variables:

- MARIADB_HOST: Database server hostname
- MARIADB_PORT: Database server port (default: 3306)
- MARIADB_USER: Database username
- MARIADB_PASSWORD: Database password
- MARIADB_DATABASE: Default database name (optional)
- MARIADB_ALLOW_INSERT: false
- MARIADB_ALLOW_UPDATE: false
- MARIADB_ALLOW_DELETE: false
- MARIADB_TIMEOUT_MS: 10000
- MARIADB_ROW_LIMIT: 1000

This script creates a test database, table, and sample data:

bash

export MARIADB_HOST=localhost
export MARIADB_PORT=3306
export MARIADB_USER=your_username
export MARIADB_PASSWORD=your_password
export MARIADB_ALLOW_INSERT: false
export MARIADB_ALLOW_UPDATE: false
export MARIADB_ALLOW_DELETE: false
export MARIADB_TIMEOUT_MS=10000
export MARIADB_ROW_LIMIT=1000

npm run test:setup
```

list_databases

List all accessible databases on the MariaDB server

list_tables

List all tables in a specified database

describe_table

Show the schema for a specific table

execute_query

Execute a SQL query

"server_name": "mariadb" or "server_name": "mysql"

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mariadb / mysql database access mcp server": {
            "mariadb": {
                "command": "npx",
                "args": [
                    "mariadb-mcp-server"
                ],
                "env": {
                    "MARIADB_HOST": "",
                    "MARIADB_PORT": "",
                    "MARIADB_USER": "",
                    "MARIADB_PASSWORD": "",
                    "MARIADB_DATABASE": "",
                    "MARIADB_ALLOW_INSERT": "",
                    "MARIADB_ALLOW_UPDATE": "",
                    "MARIADB_ALLOW_DELETE": "",
                    "MARIADB_TIMEOUT_MS": "",
                    "MARIADB_ROW_LIMIT": ""
                }
            }
        }
    }
}

McpServers

{
    "mariadb": {
        "command": "npx",
        "args": [
            "mariadb-mcp-server"
        ],
        "env": {
            "MARIADB_HOST": "",
            "MARIADB_PORT": "",
            "MARIADB_USER": "",
            "MARIADB_PASSWORD": "",
            "MARIADB_DATABASE": "",
            "MARIADB_ALLOW_INSERT": "",
            "MARIADB_ALLOW_UPDATE": "",
            "MARIADB_ALLOW_DELETE": "",
            "MARIADB_TIMEOUT_MS": "",
            "MARIADB_ROW_LIMIT": ""
        }
    }
}

MCP is certified by MCP Review
https://mcpreview.com/mcp-servers/rjsalgado/mariadb-mcp-server

This MCP server provides access to MariaDB / MySQL databases.

It allows you to:
- List available databases
- List tables in a database
- Describe table schemas
- Execute SQL queries

Security Features

- Read-only access Default: SELECT, SHOW, DESCRIBE, and EXPLAIN - Query validation: Prevents SQL injection and blocks any data modification attempts - Query timeout: Prevents long-running queries from consuming resources - Row limit: Prevents excessive data return

Installation

Option 1: Install from NPM (Recommended)

```bash
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.