database-mcp-server: Safe MySQL MCP Server for AI Assistants by Muhammad Husnain Alidatabase-mcp-server: Safe MySQL MCP Server for AI Assistants by Muhammad Husnain Ali

database-mcp-server: Safe MySQL MCP Server for AI Assistants

Portfolio project
Muhammad Husnain Ali
Model Context Protocol server that lets Claude and other AI assistants explore and query a MySQL database safely. Read-only by default: schema introspection, sample rows, SELECT-only queries, cached schema. Write and DDL tools sit behind two independent switches and require a WHERE clause, a confirm token and an affected-row cap, with automatic rollback. API-key protected. Ships with Docker Compose. MIT licence.

The problem

Giving an AI assistant database access is useful and dangerous.

What I built

Read-only by default: introspection, sample rows, SELECT-only.
Writes and DDL behind two independent switches.
Every write needs a WHERE clause, confirm token and row cap, with automatic rollback.

How it works

Assistant: Claude or any MCP client
MCP server: API-key check, Schema introspection, SELECT-only queries
Write gate: 2 switches, WHERE + confirm token, Row cap
MySQL: Query, Rollback if over cap
Built-in controls: Read-only default, Cached schema, Docker Compose · MIT.

Result

Safe database exploration for Claude and other MCP clients.
My role: Creator

0 likes · 0 views · Nov 13, 2026

Giving an AI assistant database access is useful and dangerous. Result: Safe database exploration for Claude and other MCP clients.

Tags