MokoMySQL is a Model Context Protocol (MCP) server that lets AI assistants and MCP-capable clients work directly with your MySQL or MariaDB databases. It exposes safe, structured tools for running queries, inspecting and modifying schema, managing users and privileges, performing routine maintenance, and handling common Joomla CMS database tasks. Connect it to Claude Code or any MCP host and manage your databases through natural-language requests instead of hand-written SQL.
What it is
@mokoconsulting/mcp-mokomysql is a Model Context Protocol server for MySQL and MariaDB database management. Rather than exposing a raw SQL prompt, it publishes a curated set of MCP tools that an AI assistant can call to query data, inspect and change schema, manage database users and grants, run maintenance operations, and use Joomla-aware helpers for common CMS tasks. It runs alongside your MCP client and connects to any reachable MySQL or MariaDB server using credentials you supply through configuration.
Because every operation is a defined tool with typed inputs, actions stay explicit and auditable — the assistant asks for exactly the operation it needs, and you control the connection and privileges behind it.
Install (npm)
MokoMySQL is published to public npm under the @mokoconsulting scope. Install it globally:
npm install -g @mokoconsulting/mcp-mokomysql
Prefer not to install globally? Run it on demand with npx:
npx -y @mokoconsulting/mcp-mokomysql
Requires Node.js 20 or newer. Optionally, you can pull the package from the MokoGIT registry mirror by adding this scope-to-registry mapping to your .npmrc:
@mokoconsulting:registry=https://git.mokoconsulting.tech/api/packages/MokoConsulting/npm/
Configure
Register the server with your MCP client. A typical mcpServers configuration entry looks like this:
{
"mcpServers": {
"mokomysql": {
"command": "mcp-mokomysql",
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_DATABASE": "joomla",
"MYSQL_USER": "dbuser",
"MYSQL_PASSWORD": "secret"
}
}
}
}
Supply the database host, port, database, user, and password through the environment (or your client's configuration) — never commit credentials to source control. Grant the connecting database user only the privileges required for the operations you intend to run.
Once connected, your MCP client can call the server's tools to query data, inspect schema, manage users, run maintenance, and invoke the Joomla helpers.
Tooling
MokoMySQL exposes roughly 40 tools, organized into the following categories:
- Querying — run parameterized
SELECTreads, execute arbitrary statements, and analyze a query's execution plan (mysql_query_select,mysql_query_execute,mysql_query_explain). - Schema inspection — dump full schema, list tables, describe a table, and review indexes, foreign keys, and
SHOW CREATE TABLEoutput (mysql_schema_full,mysql_tables_list,mysql_table_describe,mysql_schema_indexes,mysql_schema_foreign_keys,mysql_schema_show_create_table). - Database & table management — list, create, drop, and size databases; create, drop, rename, and truncate tables (
mysql_databases_list,mysql_database_create,mysql_database_drop,mysql_database_size,mysql_table_create,mysql_table_drop,mysql_table_rename,mysql_table_truncate). - Users & privileges — list users, create and drop accounts, grant and revoke privileges, and review a user's grants (
mysql_users_list,mysql_user_create,mysql_user_drop,mysql_user_grant,mysql_user_revoke,mysql_user_grants). - Maintenance — analyze, optimize, and check tables (
mysql_maintenance_analyze,mysql_maintenance_optimize,mysql_maintenance_check). - Server status & monitoring — read server status, variables, and version; view the process list, kill a runaway process, and list active connections (
mysql_server_status,mysql_server_variables,mysql_server_version,mysql_processlist,mysql_process_kill,mysql_connections_list). - Export — export a query result to CSV or export a table as SQL (
mysql_export_query_csv,mysql_export_table_sql). - Joomla helpers — CMS-aware shortcuts for common Joomla tables: articles, global configuration, installed extensions, active sessions, and users (
mysql_joomla_articles,mysql_joomla_config,mysql_joomla_extensions,mysql_joomla_sessions,mysql_joomla_users).
Get help
Need a hand getting MokoMySQL connected, or have a question about a specific tool? Open a support ticket with Moko Consulting, or call us at (931) 279-6313. We're happy to help you get set up and running.