Package Exports
- mcp-mysql-proxy
- mcp-mysql-proxy/dist/bin.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mcp-mysql-proxy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mcp-mysql-proxy
mcp-mysql-proxy is a high-performance MCP (Model Context Protocol) server for MySQL, written in TypeScript. It allows AI tools like Cursor, Claude, OpenAI Codex, and others to safely access and query MySQL databases.
Features
- ✅ Secure access to MySQL databases via MCP
- ✅ Supports SELECT, INSERT, UPDATE, DELETE (permissions configurable)
- ✅ Query execution metrics (duration, row count)
- ✅ Fully typed and production-ready (TypeScript + Node.js)
- ✅ Zero-config support via
npx - ✅ Integration-ready with Cursor IDE, Claude Desktop, Codex, Visual Studio Code (experimental)
- ✅ Automatic port selection: If the configured port (default 3000) is in use, the proxy will automatically try the next available port up to 3010.
Requirements
- Node.js v18+
- MySQL 5.7+ (8.0+ recommended)
- pnpm (recommended) or npm
Installation
# Clone the repository
git clone git@github.com:osvfelices/mcp-mysql-proxy.git
cd mcp-mysql-proxy
# Install dependencies
pnpm install
# Build the project
pnpm run buildUsage with npx
PORT=3001 npx -y mcp-mysql-proxyIf the specified port is already in use, the proxy will automatically try the next available port up to 3010 and log the port it is running on.
To use custom environment settings, create a .env file or pass variables inline.
.env Configuration
# ┌──────────────────────────────┐
# │ MySQL Connection │
# └──────────────────────────────┘
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASS=your_password
MYSQL_DB=your_database # optional, leave empty for multi-DB mode
# ┌──────────────────────────────┐
# │ Allowed SQL Operations │
# └──────────────────────────────┘
ALLOW_INSERT_OPERATION=false
ALLOW_UPDATE_OPERATION=false
ALLOW_DELETE_OPERATION=false
# ┌──────────────────────────────┐
# │ Server Settings │
# └──────────────────────────────┘
PORT=3001
NODE_ENV=developmentIntegration
Cursor IDE
{
"mcpServers": {
"MySQLProxy": {
"command": "npx",
"args": ["-y", "mcp-mysql-proxy"],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "your_password",
"MYSQL_DB": "your_database",
"ALLOW_INSERT_OPERATION": "false",
"ALLOW_UPDATE_OPERATION": "false",
"ALLOW_DELETE_OPERATION": "false",
"PORT": "3001"
}
}
}
}Claude Desktop
Edit your claude_desktop_config.json:
{
"mcpServers": {
"MySQLProxy": {
"command": "npx",
"args": ["-y", "mcp-mysql-proxy"],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "your_password",
"MYSQL_DB": "your_database",
"ALLOW_INSERT_OPERATION": "false",
"ALLOW_UPDATE_OPERATION": "false",
"ALLOW_DELETE_OPERATION": "false",
"PORT": "3001"
}
}
}
}License
MIT