mariadb-mcp-server
This MCP server provides access to MariaDB / MySQL databases, allowing users to list databases, tables, describe table schemas, and execute SQL queries with security features.
The MariaDB / MySQL Database Access MCP Server is designed to facilitate secure and efficient access to MariaDB and MySQL databases. It offers functionalities such as listing available databases, listing tables within a database, describing table schemas, and executing SQL queries. The server emphasizes security by providing read-only access by default, implementing query validation to prevent SQL injection, enforcing query timeouts to manage resource consumption, and setting row limits to control data return volumes. Installation can be done via NPM or by building from source, and the server requires specific environment variables for configuration. The server is integrated into MCP settings, allowing for seamless operation within the MCP framework.
Features
- Read-only access by default: Ensures only SELECT, SHOW, DESCRIBE, and EXPLAIN commands are allowed.
- Query validation: Protects against SQL injection and blocks data modification attempts.
- Query timeout: Limits the duration of queries to prevent excessive resource usage.
- Row limit: Controls the amount of data returned to prevent overload.
- Easy installation: Available via NPM or build from source options.
Tools
list_databases
List all accessible databases on MariaDB/MySQL servers
list_tables
List all tables in the specified database
describe_table
Display the structure of a specific table
execute_query
Execute SQL query