@dexical30/mcp-server-mysql 0.0.0-stage → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +126 -2
  3. package/dist/index.js +82849 -0
  4. package/package.json +91 -4
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2024 Ben Borla
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,127 @@
1
- # Temporary Holding Version
1
+ # MCP Server for MySQL
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > **This is a fork of [benborla/mcp-server-mysql](https://github.com/benborla/mcp-server-mysql)**, published as `@dexical30/mcp-server-mysql`.
4
+ > It adds [1Password secret reference support](#1password-secret-references) for `MYSQL_PASS`.
5
+ > All credit for the original project goes to Ben Borla and its contributors.
6
+
7
+ [![MCP Toplist](https://mcptoplist.com/badge/glama%2Fbenborla%2Fmcp-server-mysql.svg)](https://mcptoplist.com/server/glama%2Fbenborla%2Fmcp-server-mysql)
8
+
9
+ [![Trust Score](https://archestra.ai/mcp-catalog/api/badge/quality/benborla/mcp-server-mysql)](https://archestra.ai/mcp-catalog/benborla__mcp-server-mysql)
10
+
11
+ ## Sponsor — Bloome
12
+
13
+ [![Bloome](assets/bloome.png)](https://bloome.im/login?ref=2x7GfeSw)
14
+
15
+ Using mcp-server-mysql to let your AI query MySQL? [**Bloome**](https://bloome.im/login?ref=2x7GfeSw) brings that to your whole team — an AI-agent IM platform where AI agents are members of the chat. Connect your MCP tools and have agents inspect schemas, run queries, and answer data questions for everyone in one thread. Zero local setup, runs in the cloud, on web and mobile.
16
+
17
+ ---
18
+
19
+ MCP server that gives Claude and other LLMs access to MySQL — inspect schemas, run queries, and optionally write data, all through the Model Context Protocol.
20
+
21
+ ## Key Features
22
+
23
+ - **Read-only by default** — write operations opt-in via env flags
24
+ - **Claude Code integration** — optimized for Anthropic's Claude Code CLI
25
+ - **SSH tunnel support** — built-in support for remote databases
26
+ - **Multi-DB mode** — query across multiple databases without reconnecting
27
+ - **Schema-specific permissions** — per-database read/write control
28
+ - **PII redaction** — automatic masking of sensitive data in results
29
+ - **Remote mode** — HTTP transport with bearer token auth
30
+ - **SSL/TLS support** — encrypted connections with mTLS option
31
+
32
+ ## Requirements
33
+
34
+ - Node.js v20+
35
+ - MySQL 5.7+ (8.0+ recommended)
36
+ - MySQL user with appropriate privileges
37
+
38
+ ## Quick Install
39
+
40
+ **Claude Code (simplest):**
41
+
42
+ ```bash
43
+ claude mcp add mcp_server_mysql \
44
+ -e MYSQL_HOST="127.0.0.1" \
45
+ -e MYSQL_PORT="3306" \
46
+ -e MYSQL_USER="root" \
47
+ -e MYSQL_PASS="your_password" \
48
+ -e MYSQL_DB="your_database" \
49
+ -- npx @dexical30/mcp-server-mysql
50
+ ```
51
+
52
+ **Claude Desktop / other clients:**
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "mcp_server_mysql": {
58
+ "command": "npx",
59
+ "args": ["-y", "@dexical30/mcp-server-mysql"],
60
+ "env": {
61
+ "MYSQL_HOST": "127.0.0.1",
62
+ "MYSQL_PORT": "3306",
63
+ "MYSQL_USER": "root",
64
+ "MYSQL_PASS": "your_password",
65
+ "MYSQL_DB": "your_database"
66
+ }
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ All write operations are disabled by default. Enable with `ALLOW_INSERT_OPERATION=true`, `ALLOW_UPDATE_OPERATION=true`, `ALLOW_DELETE_OPERATION=true`.
73
+
74
+ ## 1Password Secret References
75
+
76
+ Set `MYSQL_PASS` to a [1Password secret reference](https://developer.1password.com/docs/cli/secret-reference-syntax/) instead of a plaintext password:
77
+
78
+ ```json
79
+ "env": {
80
+ "MYSQL_PASS": "op://Private/MySQL Dev/password"
81
+ }
82
+ ```
83
+
84
+ When `MYSQL_PASS` starts with `op://`, the server runs `op read` itself at startup and keeps the password only in memory. The plaintext never enters the process environment, so it does not show up in `ps eww` or in your MCP client config.
85
+
86
+ Requirements:
87
+
88
+ - [1Password CLI](https://developer.1password.com/docs/cli/get-started/) (`op`) installed
89
+ - 1Password desktop app → **Settings → Developer → Integrate with 1Password CLI** enabled (approve with Touch ID on startup)
90
+ - If your MCP client can't find `op` on its `PATH` (common for GUI apps), set `MYSQL_OP_PATH`, e.g. `/opt/homebrew/bin/op`
91
+
92
+ Do **not** wrap the server in `op run`: it would inject the plaintext password into the environment, which is exactly what this avoids.
93
+
94
+ ## Documentation
95
+
96
+ - [Installation Guide](docs/INSTALLATION.md) — Smithery, Cursor, Codex, Claude Code, local repo, remote mode
97
+ - [Configuration & Environment Variables](docs/CONFIGURATION.md) — all env vars, advanced config
98
+ - [Multi-DB Mode](README-MULTI-DB.md) — querying multiple databases
99
+ - [PII Redaction](docs/PII-REDACTION.md) — automatic data masking
100
+ - [Testing](docs/TESTING.md) — test setup and running
101
+ - [Troubleshooting](docs/TROUBLESHOOTING.md) — common issues and fixes
102
+ - [Changelog](CHANGELOG.md)
103
+
104
+ ## Tools & Resources
105
+
106
+ **Tool: `mysql_query`**
107
+ Execute SQL queries. Read-only by default. Write operations enabled per flag.
108
+
109
+ **Resources: `mysql://tables`**
110
+ Lists all tables and column metadata for the connected database.
111
+
112
+ ## Contributing
113
+
114
+ PRs welcome at [github.com/benborla/mcp-server-mysql](https://github.com/benborla/mcp-server-mysql).
115
+
116
+ ```bash
117
+ git clone https://github.com/benborla/mcp-server-mysql.git
118
+ pnpm install
119
+ pnpm run build
120
+ pnpm test
121
+ ```
122
+
123
+ [![Contributors](https://contrib.rocks/image?repo=benborla/mcp-server-mysql)](https://github.com/benborla/mcp-server-mysql/graphs/contributors)
124
+
125
+ ## License
126
+
127
+ MIT — see [LICENSE](LICENSE) for details.