MariaDB / MySQL Database Access MCP Server logo

MariaDB / MySQL Database Access MCP Server

by rjsalgado

This MCP server provides access to MariaDB / MySQL databases, allowing you to list databases, tables, schemas, and execute SQL queries. It prioritizes security with read-only access, query validation, timeout, and row limits.

View on GitHub

Last updated: N/A

What is MariaDB / MySQL Database Access MCP Server?

The MariaDB / MySQL Database Access MCP Server is a tool that enables controlled and secure access to MariaDB and MySQL databases. It acts as a mediator, providing a set of tools to interact with the database while enforcing security policies.

How to use MariaDB / MySQL Database Access MCP Server?

  1. Install the server via NPM or by building from source.
  2. Configure environment variables for database connection (host, port, user, password, database).
  3. Add the server configuration to your MCP settings file, specifying the command, arguments, and environment variables.
  4. Use the available tools (list_databases, list_tables, describe_table, execute_query) with the appropriate JSON format to interact with the database.

Key features of MariaDB / MySQL Database Access MCP Server

  • Read-only access by default

  • SQL injection prevention

  • Query timeout

  • Row limit

  • Lists available databases

  • Lists tables in a database

  • Describes table schemas

  • Executes SQL queries

Use cases of MariaDB / MySQL Database Access MCP Server

  • Providing read-only access to database information for reporting purposes.

  • Allowing controlled data exploration without the risk of data modification.

  • Integrating database queries into automated workflows with security constraints.

  • Enabling database schema discovery for application development.

  • Creating a secure interface for querying databases from external applications.

FAQ from MariaDB / MySQL Database Access MCP Server

What databases are supported?

MariaDB and MySQL are supported.

What type of access is allowed by default?

Read-only access is enabled by default, allowing SELECT, SHOW, DESCRIBE, and EXPLAIN queries.

How can I prevent SQL injection?

The server includes query validation to prevent SQL injection attacks.

Can I limit the execution time of queries?

Yes, you can configure a query timeout to prevent long-running queries from consuming resources.

Can I limit the number of rows returned by a query?

Yes, you can set a row limit to prevent excessive data return.