list_databasesLABSCO SUMMARY
Relational and vector search live behind one connection.
The SQL side is deliberately narrow — schema reads and read-only queries — while the vector side is where the writes are: create a store, insert documents, search it. That makes it a reasonable single dependency for a retrieval workflow whose source data already sits in MariaDB. On the read-only flag, take the project's own advice: it is a whitelist of allowed statements, so the guarantee you actually want comes from connecting as a database user that has no write privileges.
What it is
MariaDB's own server, covering both halves of the database: standard SQL against tables, and vector stores for embedding-based search, created and queried through the same tool set.
What you get
- Every accessible database, and the tables in one you name
- A table's schema, or the same schema with its foreign-key relations
- Read-only SQL — SELECT, SHOW and DESCRIBE — with parameters passed separately from the statement
- A database created if it does not exist yet
- Vector stores created, listed and deleted, each a table of document, embedding and JSON metadata
- Documents inserted in batches with optional metadata, and similarity search across a store with the number of neighbours you ask for
- Sensitive SHOW commands blocked by default — PROCESSLIST, GRANTS, VARIABLES, replication status — independently of the read-only switch
Requirements
Python 3.11, uv, and a reachable MariaDB. Connection settings come from the environment or a .env file: DB_HOST, DB_USER and DB_PASSWORD are required, with DB_PORT, DB_NAME and a full set of DB_SSL options for TLS and client certificates. MCP_READ_ONLY is on by default. The vector tools appear only when EMBEDDING_PROVIDER is set to openai, gemini or huggingface, each with its own key or model name. Over SSE or HTTP the server ships no authentication of its own — that is yours to add before anything outside localhost can reach it. MIT.
Setup effort
Build from source — git clone https://github.com/MariaDB/mcp.git
USE CASES
Getting oriented in a MariaDB instance
List the databases the connection can see, the tables inside one, and the columns, types and keys of the table in question.
Understanding how tables join before writing SQL
Read the schema with its foreign-key relations, then run the query that follows from it with parameters passed separately from the statement.
Answering a data question inline
Run the SELECT in the conversation rather than switching to a client, with read-only mode keeping it to reads.
Standing up semantic search over your own documents
Create the vector store with a distance function, insert the documents and their metadata in batches, then search it with a natural-language query.
Keeping the vector stores tidy
See which stores exist in a database and drop the ones left over from an experiment.
Starting a fresh database for a project
Create the database if it is not there yet and confirm it against the list.
11 tools
Listed in project docs. Your client may show a different list.
list_tablesget_table_schemaget_table_schema_with_relationsexecute_sqlcreate_databasecreate_vector_storedelete_vector_storelist_vector_storesinsert_docs_vector_storesearch_vector_storeBEFORE YOU INSTALL
What to know first
Tools you get
11 tools named in the project's documentation.
Requires
- uv on PATH
- Python 3.11 or later
- A MariaDB server (local or remote)
- DB_HOST in your environment
- DB_USER in your environment
- DB_PASSWORD in your environment
INSTALLATION
Connect your client
Server setup
git clone https://github.com/MariaDB/mcp.git
cd mcpInstall uv if you do not have it yet:
pip install uv
uv lock
uv syncCreate a .env file in the project root with DB_HOST, DB_USER and DB_PASSWORD (DB_PORT and DB_NAME are optional) — see the README's Configuration section
MCP Clients
Claude Desktop, Cursor, Windsurf
{
"mcpServers": {
"MariaDB_Server": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_MCP>",
"run",
"src/server.py"
],
"envFile": "<YOUR_PATH_TO_MCP>/.env"
}
}
}Both paths point at the mcp folder git clone created; server.py sits in its src/ folder.
VS Code
From the mcp folder, start the server over streamable HTTP:
uv run src/server.py --transport http --host 127.0.0.1 --port 9001 --path /mcp{
"servers": {
"mariadb-mcp-server": {
"url": "http://127.0.0.1:9001/mcp",
"type": "http"
}
}
}