Configuring the MCP Server
Configure the connections and directories that the mariadb-shell MCP server may access, and optionally install the migration tooling.
After installation, the MCP server has no access to any database or directory. You define the connections and directories it may use with MariaDB Shell. The configuration applies to all harnesses on the machine, so you only need to do it once:
mariadb-shell -- mcp setupFrom an interactive MariaDB Shell session, you can run the setup function instead. MariaDB Shell starts in SQL mode, so switch to Python mode first:
\pyThen run the setup function:
mcp.setup()Locate MariaDB Shell
If mariadb-shell isn't on your PATH, use the copy the plugin's launcher installed:
~/.local/bin/mariadb-shell -- mcp setup%LOCALAPPDATA%\Programs\mariadb-shell\bin\mariadb-shell.cmd -- mcp setupThe installer doesn't add this directory to your PATH; it only prints a hint. Because the launcher installs MariaDB Shell when the MCP server starts for the first time, either start the agent once before you run the setup, or install MariaDB Shell yourself.
What the Setup Configures
Connections
The setup asks for the connection URIs of the databases the agent may connect to. For the format of the URI and its options, see Adding Database Connections. To reach a server through an SSH host, use a mariadb+ssh:// URI, as described in Tunnel Database Connections via SSH. For each connection, it prompts for the password, verifies it, and stores it in the MariaDB Shell secret store, separately from your other MariaDB Shell connections. The agent has no access to the passwords.
Allowed Paths
The setup also asks for the local directories the MCP server may read from and write to, and suggests the current directory as the default. All tools that access files are restricted to these directories.
Migration Tooling
On Linux and macOS, you can optionally install the MySQL-to-MariaDB migration tooling. The setup downloads it and extracts it to ~/.local/share/mariadb-migrator/<version>. The initial setup doesn't offer this option. To install the tooling, run the setup again and select it from the menu, or run:
Then restart the MCP server. The migrator.* tools are available after the restart. See migrator Tools.
Configure from the Command Line
Instead of the walkthrough, you can configure the MCP server with command-line options of mcp setup, for example in a setup script for new developer machines. Every setting of the walkthrough has an option, and you can combine several options in one call:
For all options and their rules, see Command Line Configuration.
Change the Configuration
Run mariadb-shell -- mcp setup again at any time to add or remove connections and paths. To see the current configuration, run:
For the complete option reference, see the MCP server documentation.
Related Topics
Database Accounts for the MCP ServerAdding Database ConnectionsTunnel Database Connections via SSHCommand Line ConfigurationThis page is licensed: GPLv2
Last updated
Was this helpful?

