Skip to main content
Glama
cemalturkcan

MariaDB MCP Server

by cemalturkcan

mariadb-mcp-server

MCP (Model Context Protocol) server for MariaDB/MySQL databases. Provides AI assistants with safe, controlled database access through per-connection read/write permissions.

Features

  • Multi-connection — manage multiple MariaDB/MySQL databases from a single server

  • Per-connection access controlread and write flags per connection

  • Optional limitsstatement_timeout_ms, default_row_limit, max_row_limit (all optional, unlimited by default)

  • SQL guard — validates queries to prevent accidental writes through read tools

  • Transaction support — atomic multi-query execution on writable connections

Related MCP server: MySQL MCP Server

Installation

npm install -g @cemalturkcann/mariadb-mcp-server

Or use directly with npx:

npx @cemalturkcann/mariadb-mcp-server

Configuration

The server looks for config.json in this order:

  1. DB_MCP_CONFIG_PATH environment variable

  2. Next to the package (../config.json relative to src/)

  3. Current working directory

  4. ~/.config/mariadb-mcp/config.json

If no config is found, a default one is created automatically at ~/.config/mariadb-mcp/config.json with a local read-only connection.

Example config:

{
  "connections": {
    "local": {
      "host": "localhost",
      "port": 3306,
      "user": "root",
      "password": "",
      "description": "Local MariaDB",
      "read": true,
      "write": true
    },
    "production": {
      "host": "db.example.com",
      "port": 3306,
      "user": "readonly_user",
      "password": "secret",
      "database": "mydb",
      "description": "Production (read-only)",
      "read": true,
      "write": false,
      "statement_timeout_ms": 5000,
      "default_row_limit": 50,
      "max_row_limit": 500
    }
  }
}

Connection options

Field

Type

Default

Description

host

string

localhost

Database host

port

number

3306

Database port

user

string

root

Database user

password

string

""

Database password

database

string

""

Default database

description

string

""

Human-readable label

read

boolean

true

Allow read queries

write

boolean

false

Allow write queries

ssl

boolean/object

false

SSL configuration

statement_timeout_ms

number

none

Connection timeout (0 or omit = unlimited)

default_row_limit

number

none

Default LIMIT for SELECT (0 or omit = unlimited)

max_row_limit

number

none

Max allowed LIMIT (0 or omit = unlimited)

MCP Tools

Tool

Description

Requires

list_connections

List all configured connections

list_databases

Show databases on a connection

read

list_tables

Show tables (optionally in a specific database)

read

describe_table

Show column definitions

read

execute_select

Run SELECT / SHOW / DESCRIBE / EXPLAIN queries

read

execute_write

Run INSERT / UPDATE / DELETE / DDL queries

write

execute_transaction

Run multiple write queries atomically

write

suggest_query

Suggest a query for manual review

MCP Client Setup

On first run, a default config is created automatically at ~/.config/mariadb-mcp/config.json (Linux/macOS) or %APPDATA%\mariadb-mcp\config.json (Windows). Edit it to add your connections.

Claude Code

Add to ~/.claude.json:

{
  "mcpServers": {
    "mariadb": {
      "command": "npx",
      "args": ["-y", "@cemalturkcann/mariadb-mcp-server"]
    }
  }
}

OpenCode

Add to your opencode.json:

{
  "mcp": {
    "mariadb": {
      "type": "local",
      "command": ["npx", "-y", "@cemalturkcann/mariadb-mcp-server"]
    }
  }
}

Other MCP Clients

Any MCP-compatible client can use this server. The binary name is mariadb-mcp-server and it communicates over stdio. To use a custom config path, set DB_MCP_CONFIG_PATH.

License

MIT

Available Tools

6 tools
describe_tableC

Returns column information for a table.

ParametersJSON Schema
NameRequiredDescriptionDefault
connectionYes
tableYes
databaseNo

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description bears full responsibility for disclosing behavior. It only states the output is 'column information' without mentioning read-only nature, error handling, permissions, or side effects. This is insufficient for an agent to predict behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise and front-loaded. However, it is too minimal given the tool's complexity (3 parameters, no output schema). Brevity is not always conciseness; here it sacrifices clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 3 parameters, no output schema, and sibling tools, the description is incomplete. It fails to specify the output format, parameter constraints (e.g., which connections are valid), or how to handle missing parameters like database. An agent would have to guess or infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description adds no meaning to parameters. It doesn't explain what 'connection', 'table', or 'database' represent or how they interact, leaving the agent with only the raw schema (names and types) which is insufficient.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns column information for a table, which is specific and distinguishes it from siblings like list_tables (which lists table names) and execute_select (which runs queries). The verb 'returns' and resource 'column information' are appropriate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as list_tables or suggest_query. It does not mention prerequisites, typical use cases, or which sibling tools might be more appropriate for different scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

execute_selectB

Executes a read-only SELECT/SHOW/DESCRIBE/EXPLAIN query. Row limit is enforced.

ParametersJSON Schema
NameRequiredDescriptionDefault
connectionYes
queryYes
databaseNo
row_limitNo

TDQS

B3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description declares the tool as read-only and mentions a row limit, which are important behavioral traits. However, with no annotations, it lacks disclosure of other behaviors like error handling, result format, or query length limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description consists of two concise sentences with the action verb upfront. No extraneous information is included, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters and no annotations or output schema, the description is too minimal. It fails to explain return values, parameter dependencies, or error scenarios, which are critical for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description only adds meaning for row_limit. It does not explain the connection enum, the purpose of the optional database parameter, or expected query format, leaving three parameters undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool executes read-only SQL-type queries (SELECT/SHOW/DESCRIBE/EXPLAIN) and enforces a row limit. It distinguishes itself from sibling tools that focus on metadata or suggestions, though it could explicitly state that it returns query results.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus siblings such as describe_table or suggest_query. The description does not specify context, prerequisites, or alternatives, leaving the agent to infer usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_connectionsB

Lists configured MariaDB connections.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden but only repeats the tool name. It does not disclose any behavioral traits (e.g., read-only, returned format).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no unnecessary words, earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list operation with no parameters or output schema, the description is adequate but lacks context about connections or how to interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so the schema coverage is 100%. The description adds no value beyond the empty schema, meeting baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (list) and resource (configured MariaDB connections), making it distinct from sibling tools like describe_table or list_tables.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, nor are there any prerequisites or context for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_databasesB

Lists databases for the selected connection.

ParametersJSON Schema
NameRequiredDescriptionDefault
connectionYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description only states 'lists databases' without behavioral details such as read-only nature, authentication requirements, or output format. It adds no value beyond the obvious.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no wasted words. Properly front-loaded and appropriately sized for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description is incomplete. It does not explain return format, scope (all databases?), or any side effects. For a list tool, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description mentions 'selected connection' but does not clarify the connection parameter's meaning or relationship to list_connections. Minimal value added over the schema's enum.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists databases for a selected connection. It uses a specific verb (Lists) and resource (databases), and distinguishes from sibling tools like list_tables and list_connections.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives. It does not mention when-not-to-use or provide context for selecting between siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tablesC

Lists tables for the selected connection.

ParametersJSON Schema
NameRequiredDescriptionDefault
connectionYes
databaseNo

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only states the basic function with no details on output format, pagination, permissions, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise (one sentence) but lacks essential details. It is not sufficiently informative for an agent to use correctly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description fails to specify what the tool returns (e.g., table names) or how to use the optional database parameter. It is incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not explain the 'database' parameter or clarify that 'connection' is limited to 'local'. More detail on parameters is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (listing) and the resource (tables) with context (for selected connection). It is distinct from sibling tools like list_databases and list_connections.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as describe_table or execute_select. No context on prerequisites or limitations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

suggest_queryC

Suggests a query that should be executed manually.

ParametersJSON Schema
NameRequiredDescriptionDefault
connectionYes
queryYes
reasonNo

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must cover behavioral traits. It only states the tool suggests a query for manual execution, leaving out details like side effects, permissions, or what happens when invoked. This is minimal disclosure for a tool with no annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is concise but under-specifies the tool. It does not earn its place due to lack of substance; it is too sparse to be helpful beyond stating the basic action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has three parameters and no output schema, the description should provide more context. It fails to explain the role of each parameter, the outcome of the suggestion, or any prerequisites. The description is incomplete for effective tool selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, and the tool description adds no meaning to the parameters (connection, query, reason). With no compensation from the description, the agent has no insight into parameter semantics beyond their names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool suggests a query for manual execution, distinguishing it from sibling tools like execute_select. The verb 'suggests' and resource 'query' are specific, and the manual execution note differentiates its purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for suggesting queries rather than executing them, especially given the sibling execute_select. However, there is no explicit guidance on when to use it or when not to, nor any mention of alternatives beyond the implied distinction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 6 tool updatesv1.0.0
    • First observeddescribe_table
    • First observedexecute_select
    • First observedlist_connections
    • First observedlist_databases
    • First observedlist_tables
    • First observedsuggest_query

TDQS

B3.3/5.0
Disambiguation5/5

Each tool has a distinct purpose: describing tables, executing SELECT queries, listing connections, databases, tables, and suggesting queries. No overlap.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern (e.g., describe_table, list_databases).

Tool Count5/5

6 tools is well-scoped for a MariaDB server, covering metadata listing, query execution, and query suggestion without being excessive or thin.

Completeness4/5

Covers read-only operations (SELECT, DESCRIBE, metadata listing) and query suggestion, but lacks write operations (INSERT/UPDATE/DELETE) and DDL commands. This gap appears intentional but limits the surface.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with MariaDB databases through SQL operations and vector-based semantic search. Supports standard database queries, schema inspection, and optional embedding-powered document storage and retrieval.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to securely connect to and manage MySQL databases with support for multiple database connections, complete CRUD operations, schema inspection, and dynamic connection management through natural language.
    35
    80
    MIT
  • A
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables AI assistants to securely interact with MySQL databases through tools for query execution, schema inspection, and transaction management. It features built-in safety controls like row limits and query validation to ensure safe and standardized database access.
    454
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to safely interact with MySQL/MariaDB databases, supporting read-only queries by default with optional write operations and access control.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cemalturkcan/mariadb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server