Provides access to MariaDB databases, allowing users to list databases, explore table schemas, and execute read-only SQL queries with security features like query validation and resource limits.
Enables interaction with MySQL databases through capabilities to list available databases, browse tables, describe table structures, and run SQL queries with built-in security controls.
MariaDB / MySQL Database Access 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: Build from Source
2. Configure environment variables
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
3. Add to MCP settings
Add the following configuration to your MCP settings file:
If you built from source:
Available Tools
list_databases
Lists all accessible databases on the MariaDB / MySQL server. Parameters: None
Example:
list_tables
Lists all tables in a specified database.
Parameters:
database
(optional): Database name (uses default if not specified)
Example:
describe_table
Shows the schema for a specific table.
Parameters:
database
(optional): Database name (uses default if not specified)table
(required): Table name
Example:
execute_query
Executes a SQL query.
Parameters:
query
(required): SQL querydatabase
(optional): Database name (uses default if not specified)
Example:
Testing
The server automatically tests MariaDB to verify functionality with your MariaDB setup:
Troubleshooting
If you encounter issues:
- Check the server logs for error messages
- Verify your MariaDB credentials and connection details
- Ensure your MariaDB user has appropriate permissions
- Check that your query is read-only and properly formatted
Inspiration https://github.com/rjsalgado/mariadb-mcp-server
License
This project is licensed under the MIT License - see the LICENSE file for details.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Provides secure, read-only access to MariaDB/MySQL databases, allowing users to list databases, explore table schemas, and execute SQL queries with built-in security measures.
Related MCP Servers
- -securityAlicense-qualityEnables LLMs to interact with MySQL databases by inspecting schemas and executing safe, read-only queries within transactions.Last updated -18JavaScriptMIT License
- AsecurityAlicenseAqualityConnect and interact with MySQL databases seamlessly. Execute SQL queries, manage database connections, and retrieve data directly through AI assistants. Enhance your AI capabilities with structured access to your MySQL data.Last updated -9114TypeScriptMIT License
- -securityFlicense-qualityEnables secure interaction with MySQL databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.Last updated -Python
- AsecurityFlicenseAqualityProvides tools for AI assistants to explore and interact with MariaDB databases, allowing them to list databases, view tables, inspect schema definitions, and query data.Last updated -42JavaScript