Key takeaways
- Connect AI applications to MariaDB through MCP, a standardized way to work with database tools and data.
- Combine SQL operations with vector search to build RAG systems, semantic search and recommendation applications.
- Use configurable embedding providers and AI-native IDEs to develop and test MariaDB-powered AI workflows.
MariaDB’s AI capabilities now support both vector search and AI framework integrations. Vector Embedded Search lets developers store and query embeddings alongside transactional data, while AI Framework integrations connect MariaDB data with popular tools and models for applications such as semantic search, recommendations and retrieval-augmented generation (RAG).
The MariaDB MCP Server extends these capabilities by giving AI assistants and applications a standardized way to interact with MariaDB through the Model Context Protocol (MCP). It supports traditional SQL operations and vector-based semantic search.
This guide explains what MCP is, how the server works, what tools and embedding capabilities it provides, and how to configure it for AI application development.
What is the Model Context Protocol (MCP)?

The Model Context Protocol (MCP) is an open standard that lets AI assistants and applications connect to external tools and data sources in a consistent way. Instead of creating a separate integration for every AI model and data source, developers can use MCP to define how an AI system requests information and performs configured operations.
The MariaDB MCP Server implements this protocol for MariaDB databases. It gives AI assistants and applications a defined way to work with MariaDB through database tools, SQL queries, vector store management and semantic search.
Why MariaDB developed an MCP server
The MariaDB MCP Server grew from community work. A project developed during a MariaDB Foundation hackathon demonstrated how vector operations could be integrated into an MCP server. This built on MariaDB’s existing MCP development for traditional database operations.
MariaDB expanded the server to include vector operations alongside its existing database capabilities, allowing developers to use MCP for workflows that combine relational data, embeddings and semantic search.
Core capabilities: beyond standard SQL
The MariaDB MCP Server offers a comprehensive suite of tools, categorized into standard database operations and advanced vector functionalities.
Standard database operations
These tools provide fundamental control and insight into your MariaDB environment:
- list_databases: Discovers all accessible databases on the connected MariaDB instance.
- list_tables: Enumerates all tables within a specified database.
- get_table_schema: Retrieves the detailed schema for a specific table, including column names, data types, nullability, keys, and default values.
- execute_sql: Allows for the execution of read-only SQL queries such as SELECT, SHOW, and DESCRIBE. It supports parameterized queries for enhanced security and can be configured to enforce read-only mode.
- create_database: Enables the creation of new databases within the MariaDB server if they do not already exist.
Please note that by default read-only mode is enabled, can turn it off by changing MCP_READ_ONLY = false
Harnessing the power of vectors: advanced AI functionality
The server also supports vector store and embedding operations, allowing applications to perform semantic searches over documents stored in MariaDB. These tools are available when an embedding provider is configured.
- Vector store management:
- create_vector_store: Facilitates the creation of new tables specifically designed as vector stores. These tables are optimized for storing and searching embedding vectors, with a predefined schema including id, document, embedding (VECTOR type), and metadata (JSON) columns. Users can specify the embedding model and distance function (e.g., cosine, euclidean) during creation.
- list_vector_stores: Lists all tables within a given database that are identified as vector stores, based on their specific schema structure.
- delete_vector_store: Securely removes a vector store table from the database.
- Embedding and search operations:
- insert_docs_vector_store: Allows for the insertion of documents along with their corresponding metadata into a designated vector store. The server handles the generation of embeddings for these documents using a configured embedding service.
- search_vector_store: Performs semantic similarity searches. Given a user query, this tool generates an embedding for the query and searches the specified vector store to find the ‘k’ most similar documents based on vector distance.
The engine behind intelligence: embeddings
Embeddings are numerical representations of text (or other data types) that capture semantic meaning. The MariaDB MCP Server integrates an Embedding Service to generate these vectors.
- Supported Providers: The server is designed to work with multiple embedding providers, currently offering robust support for OpenAI, Google Gemini, and open models from HuggingFace.
- Flexible Model Selection: Users can configure a default embedding model or specify a particular model at the time of a request, choosing from a list of allowed models for each provider. This ensures flexibility in balancing cost, performance, and embedding quality.
- Embedding Dimensionality: The system can determine the correct embedding dimensions based on the selected model.
Connect MariaDB to AI-native IDEs
Connecting the MariaDB MCP Server with AI-native IDEs like Cursor and Windsurf streamlines the development process by making the database a native component of your coding environment. This integration allows developers to interact with MariaDB using natural language directly within the editor—whether to run a standard SQL query or perform a complex vector search.
This removes the need to switch to separate database clients, reducing friction and keeping the developer focused. For those building AI applications like RAG systems, the ability to query a vector store from the IDE simplifies testing and iteration. By bringing database operations into the core development loop, the MCP Server makes building data-driven features more efficient.
Empowering technical professionals
The MariaDB MCP Server offers distinct advantages for:
- Developers: Offers a streamlined path to building AI-powered features into applications as well as integrating w/ AI based code editing workflows like Cursor and Windsurf. The standardized MCP interface and clear toolset reduce the complexity of interacting with both relational data and vector embeddings.
- AI/ML Engineers: Simplifies the integration of MariaDB data into AI/ML pipelines. The native vector search capabilities allow for building sophisticated applications like RAG (Retrieval Augmented Generation) systems, semantic search engines, and recommendation systems directly on top of existing databases.
- Database Administrators: Offers a streamlined path to building AI-powered features into applications. The MCP interface and clear toolset reduce the complexity of interacting with both relational data and vector embeddings.
Get started with MariaDB MCP server
Integrating the MariaDB MCP Server into your environment is straightforward.
- Prerequisites: Ensure you have Python 3.11, uv (the dependency manager), and access to a MariaDB server (accessing through Docker is recommended).
- Configuration: Key settings are managed via environment variables, typically defined in a .env file. This includes database connection parameters (host, user, password, port, database name) and embedding provider details (API keys, default models).
- Installation: After cloning the repository, dependencies can be installed using uv pip sync.
Ready to bring AI capabilities to your MariaDB database?
Get started by visiting our GitHub repo for the MariaDB MCP Server
Frequently asked questions
Yes. Developers can insert documents and their embeddings into a vector store, then use semantic search to retrieve relevant content for a retrieval-augmented generation (RAG) application.
Yes. Read-only SQL mode is enabled by default through the MCP_READ_ONLY setting, helping limit SQL operations to approved read-only queries.
No. You can use the server for standard MariaDB operations without an embedding provider; vector store and semantic search tools require an embedding provider to be configured.
The server currently supports OpenAI, Google Gemini and open models from Hugging Face, although available providers and configuration requirements should be confirmed in the repository before implementation.
Yes. The server can connect MariaDB with AI-native IDEs such as Cursor and Windsurf, allowing developers to use natural language to run configured SQL queries and perform vector searches from their development environment.