Basic information
About MCP Server for MySQL based on NodeJS
A Model Context Protocol server that provides read-only access to MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.
MCP Server for MySQL based on NodeJS is a MCP server in the Databases category listed in the AddMCP.net directory, published by benborla. Supported transport: stdio. Runtime: node. License: MIT. The repository has 1,917 GitHub stars. Source code is hosted on github.com. Related topics: mcp-server-mysql, mysql, nodejs.
Setup
{
"mcpServers": {
"mcp_server_mysql": {
"command": "npx",
"args": [
"-y",
"@benborla29/mcp-server-mysql"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "password",
"MYSQL_DB": "your_db",
"ALLOW_INSERT_OPERATION": "true",
"ALLOW_UPDATE_OPERATION": "true",
"ALLOW_DELETE_OPERATION": "true"
}
}
}
}
{
"mcpServers": {
"mcp_server_mysql": {
"command": "npx",
"args": [
"-y",
"@benborla29/mcp-server-mysql"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "password",
"MYSQL_DB": "your_db",
"ALLOW_INSERT_OPERATION": "true",
"ALLOW_UPDATE_OPERATION": "true",
"ALLOW_DELETE_OPERATION": "true"
}
}
}
}
{
"servers": {
"mcp_server_mysql": {
"command": "npx",
"args": [
"-y",
"@benborla29/mcp-server-mysql"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "password",
"MYSQL_DB": "your_db",
"ALLOW_INSERT_OPERATION": "true",
"ALLOW_UPDATE_OPERATION": "true",
"ALLOW_DELETE_OPERATION": "true"
}
}
}
}
MCP Server for MySQL based on NodeJS (benborla/mcp-server-mysql) config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp_server_mysql": {
"command": "npx",
"args": [
"-y",
"@benborla29/mcp-server-mysql"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "password",
"MYSQL_DB": "your_db",
"ALLOW_INSERT_OPERATION": "true",
"ALLOW_UPDATE_OPERATION": "true",
"ALLOW_DELETE_OPERATION": "true"
}
}
}
}
MCP Server for MySQL based on NodeJS (benborla/mcp-server-mysql) tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MCP Server for MySQL based on NodeJS?
This server enables LLMs like Claude to interact with MySQL databases through the Model Context Protocol, allowing inspection of schemas, query execution, and optional write operations. It is designed for developers who want AI agents to query MySQL databases securely, with read-only access by default.
How to use MCP Server for MySQL based on NodeJS?
Install via npx @benborla29/mcp-server-mysql with environment variables for host, port, user, password, and database. For Claude Code, use claude mcp add; for other clients, configure a JSON entry in mcpServers. Write operations are opt-in using ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, and ALLOW_DELETE_OPERATION environment flags.
Key features of MCP Server for MySQL based on NodeJS
- Read-only by default, write operations opt-in
- Built-in SSH tunnel for remote databases
- Multi-database mode without reconnecting
- Automatic PII redaction in results
- Remote mode with HTTP and bearer token auth
- SSL/TLS support with mTLS option
Use cases of MCP Server for MySQL based on NodeJS
- AI assistant executing read-only SQL queries for data analysis
- Schema inspection and metadata retrieval via
mysql://tablesresource - Secure cross-database queries from a single connection
- Remote database access through SSH tunnels
Frequently asked questions
1 Is write support enabled by default?
No, all write operations (INSERT, UPDATE, DELETE) are disabled by default. They must be enabled individually via environment flags.
2 What are the runtime requirements?
Node.js v20+ and MySQL 5.7+ (8.0+ recommended). The MySQL user must have appropriate privileges.
3 How can I connect to a remote database?
The server includes built-in SSH tunnel support for securely accessing remote MySQL instances.
4 How do I enable write operations?
Set the environment variables ALLOW_INSERT_OPERATION=true, ALLOW_UPDATE_OPERATION=true, and ALLOW_DELETE_OPERATION=true as needed.
5 What data can the server access?
By default, it queries the configured database and exposes table metadata via the mysql://tables resource. Schema-specific permissions can be set per database.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In