Back to Home
ahmad5599 icon

mysql-mcp-server

by ahmad5599

Overview

Enables AI assistants to interact with SQL databases (MySQL, MariaDB, PostgreSQL, SQLite) through natural language queries, integrating with the Model Context Protocol (MCP) and providing a VS Code extension for setup.

Installation

Run Command
npx @ahmad3244/sql-mcp-server

Environment Variables

  • MYSQL_MCP_CONNECTION_STRING
  • MYSQL_MCP_READ_ONLY
  • MYSQL_MCP_TRANSPORT
  • MYSQL_MCP_HTTP_HOST
  • MYSQL_MCP_HTTP_PORT
  • MYSQL_MCP_LOGGERS
  • MYSQL_MCP_LOG_PATH
  • MYSQL_MCP_MAX_ROWS_PER_QUERY
  • MYSQL_MCP_TELEMETRY
  • DO_NOT_TRACK

Security Notes

The `query` tool, intended for AI-driven SQL SELECT statements, directly executes the user-provided query string via `knex().raw()` without proper parameterization for values within the query. This makes the server vulnerable to SQL injection attacks, contradicting the 'Prepared statements' security claim in the documentation. While `read-only` mode is a good default, it does not prevent malicious read operations through injection. Other operations like `insert` and `describeTable` use parameterized queries or identifier sanitization correctly.

Similar Servers

Stats

Interest Score0
Security Score3
Cost ClassLow
Stars0
Forks0
Last Update2025-11-23

Tags

MCPSQLDatabaseAI AssistantNode.jsVS Code Extension