MariaDB / MySQL Database Access MCP Server logo

MariaDB / MySQL Database Access MCP Server

Community
rjsalgado

An MCP server that provides access to MariaDB ou MySQL databases.

Publisherrjsalgado
Repositorymariadb-mcp-server
LanguageJavaScript
Forks
8
Stars
14
Available tools
4
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MariaDB / MySQL Database Access MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 4 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    14 stars and 8 forks from the linked repository.

MariaDB / MySQL MCP Server

This MCP server exposes MariaDB and MySQL databases to MCP clients such as Claude Desktop, VS Code, and other compatible tools.

It provides tools to:

  • list available databases
  • list tables in a database
  • describe table schemas
  • execute SQL queries

Features

  • Safe-by-default behavior: read-only access is enabled by default
  • Query validation to block disallowed statements and reduce injection risk
  • Configurable write permissions through environment variables
  • Timeout and row-limit protection
  • Numeric safety for insert IDs and BIGINT values returned by the MariaDB driver

Installation

Option 1: Install from npm

bash
npm install -g mariadb-mcp-server

Option 2: Install locally

bash
npm install mariadb-mcp-server

Option 3: Build from source

bash
git clone https://github.com/rjsalgado/mariadb-mcp-server.git
cd mariadb-mcp-server
npm install
npm run build

Configuration

Set the following environment variables before starting the server:

  • MARIADB_HOST: Database host
  • MARIADB_PORT: Database port (default: 3306)
  • MARIADB_USER: Database username
  • MARIADB_PASSWORD: Database password
  • MARIADB_DATABASE: Default database name (optional)
  • MARIADB_ALLOW_INSERT: Enable INSERT statements (true/false)
  • MARIADB_ALLOW_UPDATE: Enable UPDATE statements (true/false)
  • MARIADB_ALLOW_DELETE: Enable DELETE statements (true/false)
  • MARIADB_TIMEOUT_MS: Query timeout in milliseconds (default: 10000)
  • MARIADB_ROW_LIMIT: Maximum number of rows returned (default: 1000)

Example:

bash
export MARIADB_HOST=localhost
export MARIADB_PORT=3306
export MARIADB_USER=myuser
export MARIADB_PASSWORD=mypassword
export MARIADB_DATABASE=mydb
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

MCP configuration

Using npm package

json
{
  "mcpServers": {
    "mariadb": {
      "command": "npx",
      "args": ["mariadb-mcp-server"],
      "env": {
        "MARIADB_HOST": "your-host",
        "MARIADB_PORT": "3306",
        "MARIADB_USER": "your-user",
        "MARIADB_PASSWORD": "your-password",
        "MARIADB_DATABASE": "your-database",
        "MARIADB_ALLOW_INSERT": "false",
        "MARIADB_ALLOW_UPDATE": "false",
        "MARIADB_ALLOW_DELETE": "false",
        "MARIADB_TIMEOUT_MS": "10000",
        "MARIADB_ROW_LIMIT": "1000"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Using a built local server

json
{
  "mcpServers": {
    "mariadb": {
      "command": "node",
      "args": ["/absolute/path/to/mariadb-mcp-server/dist/index.js"],
      "env": {
        "MARIADB_HOST": "your-host",
        "MARIADB_PORT": "3306",
        "MARIADB_USER": "your-user",
        "MARIADB_PASSWORD": "your-password",
        "MARIADB_DATABASE": "your-database",
        "MARIADB_ALLOW_INSERT": "false",
        "MARIADB_ALLOW_UPDATE": "false",
        "MARIADB_ALLOW_DELETE": "false",
        "MARIADB_TIMEOUT_MS": "10000",
        "MARIADB_ROW_LIMIT": "1000"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Available tools

The server registers the following MCP tools:

list_databases

Lists all databases accessible to the configured user.

list_tables

Lists tables from a specific database.

Parameters:

  • database (optional): database name to inspect

describe_table

Returns the schema of a specific table.

Parameters:

  • database (optional): database name
  • table (required): table name

execute_query

Executes a SQL query.

Parameters:

  • database (optional): database name
  • query (required): SQL statement to run

Testing

The repository includes scripts to validate the server against a MariaDB or MySQL instance.

bash
npm run test:setup
npm run test:tools

Or run everything together:

bash
npm test

Notes

  • The server is safe-by-default and only allows read-only operations unless the write flags are explicitly enabled.
  • Write operations are still subject to query validation and runtime limits.

Troubleshooting

If you encounter issues:

  1. Check the server logs for error messages
  2. Verify your MariaDB/MySQL credentials and connection details
  3. Ensure your MariaDB/MySQL user has appropriate permissions
  4. Check that your query is read-only and properly formatted

Inspiration https://github.com/dpflucas/mysql-mcp-server

License

This project is licensed under the MIT License - see the LICENSE file for details.

Installation

TypingMind
{
  "mcpServers": {
    "mariadb-mcp-server": {
      "command": "npx",
      "args": [
        "mariadb-mcp-server"
      ],
      "env": {
        "MARIADB_HOST": "<MARIADB_HOST>",
        "MARIADB_PORT": "<MARIADB_PORT>",
        "MARIADB_USER": "<MARIADB_USER>",
        "MARIADB_PASSWORD": "<MARIADB_PASSWORD>"
      }
    }
  }
}

Available Tools

  • 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

Use MariaDB / MySQL Database Access MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MariaDB / MySQL Database Access MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MariaDB / MySQL Database Access MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MariaDB / MySQL Database Access MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mariadb-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "mariadb-mcp-server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MariaDB / MySQL Database Access MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MariaDB / MySQL Database Access MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MariaDB / MySQL Database Access MCP Server to help me with this task?
MariaDB / MySQL Database Access MCP Server
Sure. I read it.
Here is what I found using MariaDB / MySQL Database Access MCP Server.

Frequently asked questions

What is the MariaDB / MySQL Database Access MCP Server MCP server used for?

MariaDB / MySQL Database Access MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MariaDB / MySQL Database Access MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MariaDB / MySQL Database Access MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MariaDB / MySQL Database Access MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MariaDB / MySQL Database Access MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MariaDB / MySQL Database Access MCP Server MCP to TypingMind?

MariaDB / MySQL Database Access MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MariaDB / MySQL Database Access MCP Server MCP provide in TypingMind?

MariaDB / MySQL Database Access MCP Server exposes 4 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MariaDB / MySQL Database Access MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MariaDB / MySQL Database Access MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇