npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cemalturkcann/mariadb-mcp-server

v1.1.1

Published

MCP server for MariaDB/MySQL with per-connection read/write access control

Downloads

304

Readme

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

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

Claude Code

Add to ~/.claude.json:

{
  "mcpServers": {
    "mariadb": {
      "command": "npx",
      "args": ["-y", "@cemalturkcann/mariadb-mcp-server"],
      "env": {
        "DB_MCP_CONFIG_PATH": "/path/to/config.json"
      }
    }
  }
}

OpenCode

Add to your opencode.json:

{
  "mcp": {
    "mariadb": {
      "type": "local",
      "command": ["npx", "-y", "@cemalturkcann/mariadb-mcp-server"],
      "environment": {
        "DB_MCP_CONFIG_PATH": "/path/to/config.json"
      }
    }
  }
}

Other MCP Clients

Any MCP-compatible client can use this server. The binary name is mariadb-mcp-server and it communicates over stdio. Point DB_MCP_CONFIG_PATH to your config file.

License

MIT