You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Model Context Protocol (MCP) server that provides **read-only** MySQL database queries for AI assistants like Claude in Cursor IDE, Windsurf, or Claude Desktop. Execute queries, explore database structures, and investigate your data directly from your AI-powered tools.
6
+
A Model Context Protocol (MCP) server that provides **read-only** MySQL database queries for AI assistants. Execute queries, explore database structures, and investigate your data directly from your AI-powered tools.
7
+
8
+
## Supported AI Tools
9
+
10
+
This MCP server works with any tool that supports the Model Context Protocol, including:
11
+
12
+
-**Cursor IDE**: Set up in `.cursor/mcp.json`
13
+
-**Anthropic Claude**: Use with a compatible MCP client
14
+
-**Other MCP-compatible AI assistants**: Follow the tool's MCP configuration instructions
7
15
8
16
## Features & Limitations
9
17
@@ -37,9 +45,88 @@ npx mysql-query-mcp-server
37
45
38
46
## Setup Instructions
39
47
40
-
### 1. Configure Your Database Connections
48
+
### 1. Configure Your AI Tool to Use the MCP Server
49
+
50
+
1. Create or edit your MCP configuration file (e.g., `.cursor/mcp.json` for Cursor IDE):
51
+
52
+
```json
53
+
{
54
+
"mysql": {
55
+
"name": "MySQL Query MCP",
56
+
"description": "MySQL read-only query access through MCP",
57
+
"type": "bin",
58
+
"enabled": true,
59
+
"bin": "mysql-query-mcp"
60
+
}
61
+
}
62
+
```
63
+
64
+
For more advanced configuration with environment variables embedded in the MCP config:
65
+
66
+
```json
67
+
{
68
+
"mysql": {
69
+
"command": "npx",
70
+
"args": ["mysql-query-mcp-server@latest"],
71
+
"env": {
72
+
"LOCAL_DB_HOST": "localhost",
73
+
"LOCAL_DB_USER": "root",
74
+
"LOCAL_DB_PASS": "<YOUR_LOCAL_DB_PASSWORD>",
75
+
"LOCAL_DB_NAME": "your_database",
76
+
"LOCAL_DB_PORT": "3306",
77
+
78
+
"DEVELOPMENT_DB_HOST": "dev.example.com",
79
+
"DEVELOPMENT_DB_USER": "<DEV_USER>",
80
+
"DEVELOPMENT_DB_PASS": "<DEV_PASSWORD>",
81
+
"DEVELOPMENT_DB_NAME": "your_database",
82
+
"DEVELOPMENT_DB_PORT": "3306",
83
+
84
+
"STAGING_DB_HOST": "staging.example.com",
85
+
"STAGING_DB_USER": "<STAGING_USER>",
86
+
"STAGING_DB_PASS": "<STAGING_PASSWORD>",
87
+
"STAGING_DB_NAME": "your_database",
88
+
"STAGING_DB_PORT": "3306",
89
+
90
+
"PRODUCTION_DB_HOST": "prod.example.com",
91
+
"PRODUCTION_DB_USER": "<PRODUCTION_USER>",
92
+
"PRODUCTION_DB_PASS": "<PRODUCTION_PASSWORD>",
93
+
"PRODUCTION_DB_NAME": "your_database",
94
+
"PRODUCTION_DB_PORT": "3306",
95
+
96
+
"DEBUG": "false",
97
+
"MCP_MYSQL_SSL": "true",
98
+
"MCP_MYSQL_REJECT_UNAUTHORIZED": "false"
99
+
}
100
+
}
101
+
}
102
+
```
103
+
104
+
#### Choosing the Right Configuration Approach
105
+
106
+
There are two ways to configure the MySQL MCP server:
0 commit comments