Official MariaDB MCP server
## MariaDB MCP Server: Enterprise MySQL Alternative The **MariaDB MCP Server** integrates MariaDB into Google Antigravity, enabling MySQL-compatible database operations with enhanced features, plugins, and storage engines directly from your development environment. ### Why MariaDB MCP? - **MySQL Compatible**: Drop-in replacement for MySQL - **Enhanced Features**: Additional storage engines and functions - **Open Source**: Fully open source with active community - **Performance**: Optimized query execution - **Enterprise Ready**: Clustering and high availability options ### Key Features #### 1. SQL Queries ```python # Execute query result = await mcp.query(""" SELECT u.id, u.name, COUNT(o.id) as order_count FROM users u LEFT JOIN orders o ON u.id = o.user_id WHERE u.status = ? GROUP BY u.id HAVING order_count > ? ORDER BY order_count DESC LIMIT 20 """, params=["active", 5]) for row in result: print(f"User: {row['name']} - Orders: {row['order_count']}") ``` #### 2. Data Operations ```python # Insert data result = await mcp.execute( """INSERT INTO users (name, email, status) VALUES (?, ?, ?)""", params=["John Doe", "john@example.com", "active"] ) print(f"Inserted ID: {result['lastInsertId']}") # Update data await mcp.execute( """UPDATE users SET status = ? WHERE id = ?""", params=["premium", 123] ) # Delete data await mcp.execute( """DELETE FROM users WHERE last_login < DATE_SUB(NOW(), INTERVAL 1 YEAR)""" ) ``` #### 3. Transaction Operations ```python # Execute transaction await mcp.transaction([ { "query": "UPDATE accounts SET balance = balance - ? WHERE id = ?", "params": [100, 1] }, { "query": "UPDATE accounts SET balance = balance + ? WHERE id = ?", "params": [100, 2] }, { "query": "INSERT INTO transfers (from_id, to_id, amount) VALUES (?, ?, ?)", "params": [1, 2, 100] } ]) ``` #### 4. Schema Operations ```python # Get tables tables = await mcp.get_tables(database="myapp") for table in tables: print(f"Table: {table}") # Describe table schema = await mcp.describe_table(table="users") for column in schema: print(f"Column: {column['Field']} ({column['Type']})") ``` ### Configuration ```json { "mcpServers": { "mariadb": { "command": "npx", "args": ["-y", "@anthropic/mcp-mariadb"], "env": { "MARIADB_HOST": "localhost", "MARIADB_PORT": "3306", "MARIADB_USER": "root", "MARIADB_PASSWORD": "your-password", "MARIADB_DATABASE": "myapp" } } } } ``` ### Use Cases **Web Applications**: Backend database for web apps. **E-commerce**: Product catalogs and order management. **Content Management**: CMS and blog databases. **Enterprise Apps**: Business application backends. The MariaDB MCP enables MySQL-compatible operations within your development environment.
{
"mcpServers": {
"mariadb": {
"mcpServers": {
"mariadb": {
"env": {
"MARIADB_HOST": "localhost",
"MARIADB_PORT": "3306",
"MARIADB_USER": "root",
"MARIADB_DATABASE": "your_database",
"MARIADB_PASSWORD": "YOUR_PASSWORD"
},
"args": [
"mariadb-mcp-server"
],
"command": "uvx"
}
}
}
}
}