A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/mariadb/mcp below:

MariaDB/mcp: MariaDB MCP (Model Context Protocol) server implementation

The MCP MariaDB Server provides a Model Context Protocol (MCP) interface for managing and querying MariaDB databases, supporting both standard SQL operations and advanced vector/embedding-based search. Designed for use with AI assistants, it enables seamless integration of AI-driven data workflows with relational and vector databases.

The MCP MariaDB Server exposes a set of tools for interacting with MariaDB databases and vector stores via a standardized protocol. It supports:

Vector Store & Embedding Tools (optional)

Note: These tools are only available when EMBEDDING_PROVIDER is configured. If no embedding provider is set, these tools will be disabled.

Embeddings & Vector Store

The MCP MariaDB Server provides optional embedding and vector store capabilities. These features can be enabled by configuring an embedding provider, or completely disabled if you only need standard database operations.

A vector store table has the following columns:

Configuration & Environment Variables

All configuration is via environment variables (typically set in a .env file):

Variable Description Required Default DB_HOST MariaDB host address Yes localhost DB_PORT MariaDB port No 3306 DB_USER MariaDB username Yes DB_PASSWORD MariaDB password Yes DB_NAME Default database (optional; can be set per query) No MCP_READ_ONLY Enforce read-only SQL mode (true/false) No true MCP_MAX_POOL_SIZE Max DB connection pool size No 10 EMBEDDING_PROVIDER Embedding provider (openai/gemini/huggingface) No None(Disabled) OPENAI_API_KEY API key for OpenAI embeddings Yes (if EMBEDDING_PROVIDER=openai) GEMINI_API_KEY API key for Gemini embeddings Yes (if EMBEDDING_PROVIDER=gemini) HF_MODEL Open models from Huggingface Yes (if EMBEDDING_PROVIDER=huggingface)

With Embedding Support (OpenAI):

DB_HOST=localhost
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_PORT=3306
DB_NAME=your_default_database

MCP_READ_ONLY=true
MCP_MAX_POOL_SIZE=10

EMBEDDING_PROVIDER=openai
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=AI...
HF_MODEL="BAAI/bge-m3"

Without Embedding Support:

DB_HOST=localhost
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_PORT=3306
DB_NAME=your_default_database
MCP_READ_ONLY=true
MCP_MAX_POOL_SIZE=10
  1. Clone the repository
  2. Install uv (if not already):
  3. Install dependencies
    uv pip compile pyproject.toml -o uv.lock
  4. Create .env in the project root (see Configuration)
  5. Run the server Adjust entry point if needed (e.g., main.py)
{
  "tool": "execute_sql",
  "parameters": {
    "database_name": "test_db",
    "sql_query": "SELECT * FROM users WHERE id = %s",
    "parameters": [123]
  }
}
{
  "tool": "create_vector_store",
  "parameters": {
    "database_name": "test_db",
    "vector_store_name": "my_vectors",
    "model_name": "text-embedding-3-small",
    "distance_function": "cosine"
  }
}
Insert Documents into Vector Store
{
  "tool": "insert_docs_vector_store",
  "parameters": {
    "database_name": "test_db",
    "vector_store_name": "my_vectors",
    "documents": ["Sample text 1", "Sample text 2"],
    "metadata": [{"source": "doc1"}, {"source": "doc2"}]
  }
}
{
  "tool": "search_vector_store",
  "parameters": {
    "database_name": "test_db",
    "vector_store_name": "my_vectors",
    "user_query": "What is the capital of France?",
    "k": 5
  }
}
Integration - Claude desktop/Cursor/Windsurf/VSCode
{
  "mcpServers": {
    "MariaDB_Server": {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/mariadb-mcp-server/",
        "run",
        "server.py"
        ],
        "envFile": "path/to/mcp-server-mariadb-vector/.env"      
    }
  }
}

or If already running MCP server

{
  "servers": {
    "mariadb-mcp-server": {
      "url": "http://{host}:9001/sse",
      "type": "sse"
    }
  }
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4