@neverinfamous/mysql-mcp 2.3.0 → 3.0.0
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.
- package/.dockerignore +1 -0
- package/.gitattributes +18 -0
- package/.github/workflows/codeql.yml +2 -10
- package/.github/workflows/docker-publish.yml +15 -13
- package/CHANGELOG.md +287 -1
- package/DOCKER_README.md +100 -265
- package/Dockerfile +5 -0
- package/README.md +124 -59
- package/VERSION +1 -1
- package/dist/__tests__/mocks/adapter.d.ts.map +1 -1
- package/dist/__tests__/mocks/adapter.js +2 -0
- package/dist/__tests__/mocks/adapter.js.map +1 -1
- package/dist/adapters/DatabaseAdapter.d.ts.map +1 -1
- package/dist/adapters/DatabaseAdapter.js +50 -9
- package/dist/adapters/DatabaseAdapter.js.map +1 -1
- package/dist/adapters/mysql/MySQLAdapter.d.ts +6 -0
- package/dist/adapters/mysql/MySQLAdapter.d.ts.map +1 -1
- package/dist/adapters/mysql/MySQLAdapter.js +8 -0
- package/dist/adapters/mysql/MySQLAdapter.js.map +1 -1
- package/dist/adapters/mysql/SchemaManager.js +16 -15
- package/dist/adapters/mysql/SchemaManager.js.map +1 -1
- package/dist/adapters/mysql/prompts/index.js +10 -20
- package/dist/adapters/mysql/prompts/index.js.map +1 -1
- package/dist/adapters/mysql/prompts/proxysqlSetup.js +1 -1
- package/dist/adapters/mysql/resources/docstore.d.ts.map +1 -1
- package/dist/adapters/mysql/resources/docstore.js +10 -7
- package/dist/adapters/mysql/resources/docstore.js.map +1 -1
- package/dist/adapters/mysql/resources/events.js +11 -8
- package/dist/adapters/mysql/resources/events.js.map +1 -1
- package/dist/adapters/mysql/resources/indexes.d.ts.map +1 -1
- package/dist/adapters/mysql/resources/indexes.js +12 -15
- package/dist/adapters/mysql/resources/indexes.js.map +1 -1
- package/dist/adapters/mysql/resources/innodb.d.ts.map +1 -1
- package/dist/adapters/mysql/resources/innodb.js +20 -17
- package/dist/adapters/mysql/resources/innodb.js.map +1 -1
- package/dist/adapters/mysql/resources/locks.d.ts.map +1 -1
- package/dist/adapters/mysql/resources/locks.js +9 -6
- package/dist/adapters/mysql/resources/locks.js.map +1 -1
- package/dist/adapters/mysql/resources/performance.d.ts.map +1 -1
- package/dist/adapters/mysql/resources/performance.js +15 -15
- package/dist/adapters/mysql/resources/performance.js.map +1 -1
- package/dist/adapters/mysql/resources/spatial.d.ts.map +1 -1
- package/dist/adapters/mysql/resources/spatial.js +9 -6
- package/dist/adapters/mysql/resources/spatial.js.map +1 -1
- package/dist/adapters/mysql/resources/sysschema.d.ts.map +1 -1
- package/dist/adapters/mysql/resources/sysschema.js +12 -9
- package/dist/adapters/mysql/resources/sysschema.js.map +1 -1
- package/dist/adapters/mysql/tools/admin/backup.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/admin/backup.js +170 -121
- package/dist/adapters/mysql/tools/admin/backup.js.map +1 -1
- package/dist/adapters/mysql/tools/admin/maintenance.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/admin/maintenance.js +106 -57
- package/dist/adapters/mysql/tools/admin/maintenance.js.map +1 -1
- package/dist/adapters/mysql/tools/admin/monitoring.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/admin/monitoring.js +183 -101
- package/dist/adapters/mysql/tools/admin/monitoring.js.map +1 -1
- package/dist/adapters/mysql/tools/cluster/group-replication.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/cluster/group-replication.js +164 -120
- package/dist/adapters/mysql/tools/cluster/group-replication.js.map +1 -1
- package/dist/adapters/mysql/tools/cluster/innodb-cluster.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/cluster/innodb-cluster.js +212 -145
- package/dist/adapters/mysql/tools/cluster/innodb-cluster.js.map +1 -1
- package/dist/adapters/mysql/tools/codemode/index.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/codemode/index.js +6 -4
- package/dist/adapters/mysql/tools/codemode/index.js.map +1 -1
- package/dist/adapters/mysql/tools/core.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/core.js +152 -29
- package/dist/adapters/mysql/tools/core.js.map +1 -1
- package/dist/adapters/mysql/tools/docstore.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/docstore.js +340 -163
- package/dist/adapters/mysql/tools/docstore.js.map +1 -1
- package/dist/adapters/mysql/tools/events.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/events.js +284 -198
- package/dist/adapters/mysql/tools/events.js.map +1 -1
- package/dist/adapters/mysql/tools/json/core.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/json/core.js +11 -39
- package/dist/adapters/mysql/tools/json/core.js.map +1 -1
- package/dist/adapters/mysql/tools/json/enhanced.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/json/enhanced.js +15 -33
- package/dist/adapters/mysql/tools/json/enhanced.js.map +1 -1
- package/dist/adapters/mysql/tools/json/helpers.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/json/helpers.js +13 -24
- package/dist/adapters/mysql/tools/json/helpers.js.map +1 -1
- package/dist/adapters/mysql/tools/partitioning.js +3 -0
- package/dist/adapters/mysql/tools/partitioning.js.map +1 -1
- package/dist/adapters/mysql/tools/performance/analysis.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/performance/analysis.js +89 -60
- package/dist/adapters/mysql/tools/performance/analysis.js.map +1 -1
- package/dist/adapters/mysql/tools/performance/optimization.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/performance/optimization.js +151 -127
- package/dist/adapters/mysql/tools/performance/optimization.js.map +1 -1
- package/dist/adapters/mysql/tools/proxysql.d.ts +1 -1
- package/dist/adapters/mysql/tools/proxysql.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/proxysql.js +289 -176
- package/dist/adapters/mysql/tools/proxysql.js.map +1 -1
- package/dist/adapters/mysql/tools/replication.js +75 -49
- package/dist/adapters/mysql/tools/replication.js.map +1 -1
- package/dist/adapters/mysql/tools/roles.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/roles.js +224 -182
- package/dist/adapters/mysql/tools/roles.js.map +1 -1
- package/dist/adapters/mysql/tools/router.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/router.js +168 -67
- package/dist/adapters/mysql/tools/router.js.map +1 -1
- package/dist/adapters/mysql/tools/schema/constraints.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/schema/constraints.js +21 -3
- package/dist/adapters/mysql/tools/schema/constraints.js.map +1 -1
- package/dist/adapters/mysql/tools/schema/management.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/schema/management.js +61 -14
- package/dist/adapters/mysql/tools/schema/management.js.map +1 -1
- package/dist/adapters/mysql/tools/schema/routines.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/schema/routines.js +27 -4
- package/dist/adapters/mysql/tools/schema/routines.js.map +1 -1
- package/dist/adapters/mysql/tools/schema/scheduled_events.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/schema/scheduled_events.js +24 -3
- package/dist/adapters/mysql/tools/schema/scheduled_events.js.map +1 -1
- package/dist/adapters/mysql/tools/schema/triggers.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/schema/triggers.js +23 -2
- package/dist/adapters/mysql/tools/schema/triggers.js.map +1 -1
- package/dist/adapters/mysql/tools/schema/views.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/schema/views.js +47 -7
- package/dist/adapters/mysql/tools/schema/views.js.map +1 -1
- package/dist/adapters/mysql/tools/security/audit.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/security/audit.js +102 -34
- package/dist/adapters/mysql/tools/security/audit.js.map +1 -1
- package/dist/adapters/mysql/tools/security/data-protection.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/security/data-protection.js +264 -205
- package/dist/adapters/mysql/tools/security/data-protection.js.map +1 -1
- package/dist/adapters/mysql/tools/security/encryption.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/security/encryption.js +137 -104
- package/dist/adapters/mysql/tools/security/encryption.js.map +1 -1
- package/dist/adapters/mysql/tools/shell/backup.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/shell/backup.js +71 -59
- package/dist/adapters/mysql/tools/shell/backup.js.map +1 -1
- package/dist/adapters/mysql/tools/shell/restore.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/shell/restore.js +61 -47
- package/dist/adapters/mysql/tools/shell/restore.js.map +1 -1
- package/dist/adapters/mysql/tools/spatial/geometry.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/spatial/geometry.js +19 -5
- package/dist/adapters/mysql/tools/spatial/geometry.js.map +1 -1
- package/dist/adapters/mysql/tools/spatial/operations.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/spatial/operations.js +42 -17
- package/dist/adapters/mysql/tools/spatial/operations.js.map +1 -1
- package/dist/adapters/mysql/tools/spatial/queries.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/spatial/queries.js +109 -57
- package/dist/adapters/mysql/tools/spatial/queries.js.map +1 -1
- package/dist/adapters/mysql/tools/spatial/setup.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/spatial/setup.js +103 -50
- package/dist/adapters/mysql/tools/spatial/setup.js.map +1 -1
- package/dist/adapters/mysql/tools/stats/comparative.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/stats/comparative.js +128 -79
- package/dist/adapters/mysql/tools/stats/comparative.js.map +1 -1
- package/dist/adapters/mysql/tools/stats/descriptive.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/stats/descriptive.js +174 -102
- package/dist/adapters/mysql/tools/stats/descriptive.js.map +1 -1
- package/dist/adapters/mysql/tools/sysschema/activity.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/sysschema/activity.js +50 -25
- package/dist/adapters/mysql/tools/sysschema/activity.js.map +1 -1
- package/dist/adapters/mysql/tools/sysschema/performance.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/sysschema/performance.js +121 -66
- package/dist/adapters/mysql/tools/sysschema/performance.js.map +1 -1
- package/dist/adapters/mysql/tools/sysschema/resources.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/sysschema/resources.js +101 -64
- package/dist/adapters/mysql/tools/sysschema/resources.js.map +1 -1
- package/dist/adapters/mysql/tools/text/fulltext.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/text/fulltext.js +18 -32
- package/dist/adapters/mysql/tools/text/fulltext.js.map +1 -1
- package/dist/adapters/mysql/tools/transactions.d.ts.map +1 -1
- package/dist/adapters/mysql/tools/transactions.js +48 -23
- package/dist/adapters/mysql/tools/transactions.js.map +1 -1
- package/dist/adapters/mysql/types/proxysql-types.d.ts +15 -0
- package/dist/adapters/mysql/types/proxysql-types.d.ts.map +1 -1
- package/dist/adapters/mysql/types/proxysql-types.js +33 -1
- package/dist/adapters/mysql/types/proxysql-types.js.map +1 -1
- package/dist/adapters/mysql/types/router-types.d.ts +1 -1
- package/dist/adapters/mysql/types/router-types.js +1 -1
- package/dist/adapters/mysql/types/router-types.js.map +1 -1
- package/dist/adapters/mysql/types/shell-types.js +2 -2
- package/dist/adapters/mysql/types/shell-types.js.map +1 -1
- package/dist/adapters/mysql/types.d.ts +485 -21
- package/dist/adapters/mysql/types.d.ts.map +1 -1
- package/dist/adapters/mysql/types.js +546 -19
- package/dist/adapters/mysql/types.js.map +1 -1
- package/dist/auth/scopes.js +1 -1
- package/dist/auth/scopes.js.map +1 -1
- package/dist/codemode/api.d.ts +3 -2
- package/dist/codemode/api.d.ts.map +1 -1
- package/dist/codemode/api.js +80 -5
- package/dist/codemode/api.js.map +1 -1
- package/dist/codemode/sandbox-factory.js +1 -1
- package/dist/codemode/sandbox-factory.js.map +1 -1
- package/dist/codemode/types.d.ts +26 -0
- package/dist/codemode/types.d.ts.map +1 -1
- package/dist/codemode/types.js +2 -0
- package/dist/codemode/types.js.map +1 -1
- package/dist/codemode/worker-sandbox.d.ts +4 -2
- package/dist/codemode/worker-sandbox.d.ts.map +1 -1
- package/dist/codemode/worker-sandbox.js +66 -7
- package/dist/codemode/worker-sandbox.js.map +1 -1
- package/dist/codemode/worker-script.d.ts +3 -0
- package/dist/codemode/worker-script.d.ts.map +1 -1
- package/dist/codemode/worker-script.js +128 -75
- package/dist/codemode/worker-script.js.map +1 -1
- package/dist/constants/ServerInstructions.d.ts +1 -1
- package/dist/constants/ServerInstructions.d.ts.map +1 -1
- package/dist/constants/ServerInstructions.js +37 -31
- package/dist/constants/ServerInstructions.js.map +1 -1
- package/dist/filtering/ToolConstants.d.ts +1 -1
- package/dist/filtering/ToolConstants.d.ts.map +1 -1
- package/dist/filtering/ToolConstants.js +1 -2
- package/dist/filtering/ToolConstants.js.map +1 -1
- package/dist/pool/ConnectionPool.d.ts.map +1 -1
- package/dist/pool/ConnectionPool.js.map +1 -1
- package/dist/transports/http.d.ts.map +1 -1
- package/dist/transports/http.js +6 -0
- package/dist/transports/http.js.map +1 -1
- package/dist/utils/validators.d.ts +1 -1
- package/dist/utils/validators.d.ts.map +1 -1
- package/dist/utils/validators.js.map +1 -1
- package/package.json +4 -4
- package/releases/v2.3.0-release-notes.md +20 -20
- package/releases/v2.3.1-release-notes.md +34 -0
- package/releases/v3.0.0-release-notes.md +81 -0
- package/src/__tests__/mocks/adapter.ts +3 -0
- package/src/__tests__/perf.test.ts +6 -6
- package/src/adapters/DatabaseAdapter.ts +58 -9
- package/src/adapters/__tests__/DatabaseAdapter.test.ts +89 -8
- package/src/adapters/mysql/MySQLAdapter.ts +17 -2
- package/src/adapters/mysql/SchemaManager.ts +21 -21
- package/src/adapters/mysql/__tests__/MySQLAdapter.test.ts +1 -1
- package/src/adapters/mysql/prompts/index.ts +12 -22
- package/src/adapters/mysql/prompts/proxysqlSetup.ts +1 -1
- package/src/adapters/mysql/resources/docstore.ts +13 -10
- package/src/adapters/mysql/resources/events.ts +12 -12
- package/src/adapters/mysql/resources/indexes.ts +17 -19
- package/src/adapters/mysql/resources/innodb.ts +23 -22
- package/src/adapters/mysql/resources/locks.ts +9 -7
- package/src/adapters/mysql/resources/performance.ts +23 -18
- package/src/adapters/mysql/resources/spatial.ts +9 -7
- package/src/adapters/mysql/resources/sysschema.ts +12 -11
- package/src/adapters/mysql/tools/__tests__/core.test.ts +126 -55
- package/src/adapters/mysql/tools/__tests__/docstore.test.ts +459 -88
- package/src/adapters/mysql/tools/__tests__/events.test.ts +281 -103
- package/src/adapters/mysql/tools/__tests__/proxysql.test.ts +128 -28
- package/src/adapters/mysql/tools/__tests__/replication.test.ts +48 -2
- package/src/adapters/mysql/tools/__tests__/roles.test.ts +15 -18
- package/src/adapters/mysql/tools/__tests__/router.test.ts +32 -5
- package/src/adapters/mysql/tools/__tests__/security.test.ts +126 -2
- package/src/adapters/mysql/tools/__tests__/security_injection.test.ts +84 -76
- package/src/adapters/mysql/tools/__tests__/security_integration.test.ts +47 -50
- package/src/adapters/mysql/tools/__tests__/spatial.test.ts +11 -10
- package/src/adapters/mysql/tools/__tests__/spatial_handler.test.ts +54 -38
- package/src/adapters/mysql/tools/__tests__/stats.test.ts +285 -152
- package/src/adapters/mysql/tools/__tests__/transactions.test.ts +13 -13
- package/src/adapters/mysql/tools/admin/__tests__/backup.test.ts +171 -25
- package/src/adapters/mysql/tools/admin/__tests__/maintenance.test.ts +240 -4
- package/src/adapters/mysql/tools/admin/__tests__/monitoring-summary.test.ts +274 -0
- package/src/adapters/mysql/tools/admin/__tests__/monitoring.test.ts +94 -5
- package/src/adapters/mysql/tools/admin/backup.ts +193 -143
- package/src/adapters/mysql/tools/admin/maintenance.ts +118 -69
- package/src/adapters/mysql/tools/admin/monitoring.ts +201 -125
- package/src/adapters/mysql/tools/cluster/__tests__/group-replication.test.ts +69 -0
- package/src/adapters/mysql/tools/cluster/__tests__/innodb-cluster.test.ts +141 -0
- package/src/adapters/mysql/tools/cluster/group-replication.ts +172 -132
- package/src/adapters/mysql/tools/cluster/innodb-cluster.ts +231 -157
- package/src/adapters/mysql/tools/codemode/__tests__/codemode-tool.test.ts +227 -0
- package/src/adapters/mysql/tools/codemode/index.ts +5 -3
- package/src/adapters/mysql/tools/core.ts +152 -38
- package/src/adapters/mysql/tools/docstore.ts +422 -205
- package/src/adapters/mysql/tools/events.ts +334 -233
- package/src/adapters/mysql/tools/json/__tests__/core.test.ts +20 -0
- package/src/adapters/mysql/tools/json/__tests__/enhanced.test.ts +82 -50
- package/src/adapters/mysql/tools/json/__tests__/helpers.test.ts +42 -3
- package/src/adapters/mysql/tools/json/core.ts +21 -42
- package/src/adapters/mysql/tools/json/enhanced.ts +22 -37
- package/src/adapters/mysql/tools/json/helpers.ts +21 -25
- package/src/adapters/mysql/tools/partitioning.ts +3 -0
- package/src/adapters/mysql/tools/performance/__tests__/analysis.test.ts +98 -5
- package/src/adapters/mysql/tools/performance/__tests__/optimization-coverage.test.ts +515 -0
- package/src/adapters/mysql/tools/performance/__tests__/optimization.test.ts +187 -0
- package/src/adapters/mysql/tools/performance/analysis.ts +95 -69
- package/src/adapters/mysql/tools/performance/optimization.ts +182 -153
- package/src/adapters/mysql/tools/proxysql.ts +314 -209
- package/src/adapters/mysql/tools/replication.ts +84 -57
- package/src/adapters/mysql/tools/roles.ts +274 -226
- package/src/adapters/mysql/tools/router.ts +181 -85
- package/src/adapters/mysql/tools/schema/__tests__/constraints.test.ts +13 -0
- package/src/adapters/mysql/tools/schema/__tests__/management.test.ts +60 -25
- package/src/adapters/mysql/tools/schema/__tests__/scheduled_events.test.ts +11 -0
- package/src/adapters/mysql/tools/schema/__tests__/triggers.test.ts +25 -4
- package/src/adapters/mysql/tools/schema/__tests__/views.test.ts +46 -14
- package/src/adapters/mysql/tools/schema/constraints.ts +22 -3
- package/src/adapters/mysql/tools/schema/management.ts +60 -15
- package/src/adapters/mysql/tools/schema/routines.ts +26 -4
- package/src/adapters/mysql/tools/schema/scheduled_events.ts +25 -3
- package/src/adapters/mysql/tools/schema/triggers.ts +27 -2
- package/src/adapters/mysql/tools/schema/views.ts +46 -8
- package/src/adapters/mysql/tools/security/__tests__/audit.test.ts +90 -4
- package/src/adapters/mysql/tools/security/audit.ts +113 -39
- package/src/adapters/mysql/tools/security/data-protection.ts +293 -233
- package/src/adapters/mysql/tools/security/encryption.ts +172 -139
- package/src/adapters/mysql/tools/shell/__tests__/backup.test.ts +29 -0
- package/src/adapters/mysql/tools/shell/backup.ts +90 -73
- package/src/adapters/mysql/tools/shell/restore.ts +62 -48
- package/src/adapters/mysql/tools/spatial/__tests__/operations.test.ts +22 -14
- package/src/adapters/mysql/tools/spatial/__tests__/queries.test.ts +65 -51
- package/src/adapters/mysql/tools/spatial/geometry.ts +23 -7
- package/src/adapters/mysql/tools/spatial/operations.ts +60 -31
- package/src/adapters/mysql/tools/spatial/queries.ts +142 -65
- package/src/adapters/mysql/tools/spatial/setup.ts +121 -55
- package/src/adapters/mysql/tools/stats/__tests__/comparative.test.ts +12 -10
- package/src/adapters/mysql/tools/stats/comparative.ts +150 -98
- package/src/adapters/mysql/tools/stats/descriptive.ts +204 -127
- package/src/adapters/mysql/tools/sysschema/__tests__/error-paths.test.ts +222 -0
- package/src/adapters/mysql/tools/sysschema/__tests__/performance.test.ts +45 -0
- package/src/adapters/mysql/tools/sysschema/__tests__/resources.test.ts +6 -3
- package/src/adapters/mysql/tools/sysschema/activity.ts +52 -27
- package/src/adapters/mysql/tools/sysschema/performance.ts +132 -68
- package/src/adapters/mysql/tools/sysschema/resources.ts +105 -67
- package/src/adapters/mysql/tools/text/__tests__/fulltext.test.ts +45 -17
- package/src/adapters/mysql/tools/text/fulltext.ts +27 -38
- package/src/adapters/mysql/tools/transactions.ts +49 -24
- package/src/adapters/mysql/types/proxysql-types.ts +38 -1
- package/src/adapters/mysql/types/router-types.ts +1 -1
- package/src/adapters/mysql/types/shell-types.ts +2 -2
- package/src/adapters/mysql/types.ts +632 -19
- package/src/auth/__tests__/scopes.test.ts +2 -2
- package/src/auth/scopes.ts +1 -1
- package/src/codemode/__tests__/api.test.ts +417 -0
- package/src/codemode/__tests__/sandbox-factory.test.ts +158 -0
- package/src/codemode/__tests__/sandbox.test.ts +301 -0
- package/src/codemode/__tests__/security.test.ts +368 -0
- package/src/codemode/__tests__/worker-sandbox.test.ts +179 -0
- package/src/codemode/__tests__/worker-script.test.ts +226 -0
- package/src/codemode/api.ts +89 -5
- package/src/codemode/sandbox-factory.ts +1 -1
- package/src/codemode/types.ts +34 -0
- package/src/codemode/worker-sandbox.ts +74 -7
- package/src/codemode/worker-script.ts +157 -86
- package/src/constants/ServerInstructions.ts +37 -31
- package/src/filtering/ToolConstants.ts +1 -2
- package/src/filtering/__tests__/ToolFilter.test.ts +9 -9
- package/src/pool/ConnectionPool.ts +4 -1
- package/src/transports/__tests__/http.test.ts +15 -3
- package/src/transports/http.ts +12 -0
- package/src/utils/validators.ts +2 -1
- package/vitest.config.ts +3 -1
- package/CODE_MODE.md +0 -245
package/DOCKER_README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MySQL MCP Server
|
|
2
2
|
|
|
3
|
-
**Last Updated February
|
|
3
|
+
**Last Updated February 26, 2026**
|
|
4
4
|
|
|
5
5
|
[](https://github.com/neverinfamous/mysql-mcp)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -9,31 +9,33 @@
|
|
|
9
9
|
[](https://hub.docker.com/r/writenotenow/mysql-mcp)
|
|
10
10
|
[](SECURITY.md)
|
|
11
11
|

|
|
12
|
-

|
|
13
|
+

|
|
14
14
|
|
|
15
|
-
**[📚 Full Documentation (Wiki)](https://github.com/neverinfamous/mysql-mcp/wiki)** • **[Changelog](https://github.com/neverinfamous/mysql-mcp/blob/
|
|
15
|
+
**[📚 Full Documentation (Wiki)](https://github.com/neverinfamous/mysql-mcp/wiki)** • **[Changelog](https://github.com/neverinfamous/mysql-mcp/blob/main/CHANGELOG.md)** • **[Security](https://github.com/neverinfamous/mysql-mcp/blob/main/SECURITY.md)** • **[Release Article](https://adamic.tech/articles/mysql-mcp-server)**
|
|
16
16
|
|
|
17
17
|
## The Most Comprehensive MySQL MCP Server Available
|
|
18
18
|
|
|
19
|
-
**mysql-mcp** is the definitive **Model Context Protocol server for MySQL** — empowering AI assistants like AntiGravity, Claude, Cursor, and other MCP clients with **unparalleled database capabilities**. Built for developers who demand enterprise-grade features without sacrificing ease of use.
|
|
19
|
+
**mysql-mcp** is the definitive **Model Context Protocol server for MySQL** — empowering AI assistants like AntiGravity, Claude, Cursor, and other MCP clients with **unparalleled database capabilities**, **deterministic error handling**, and **process-isolated sandboxed code execution**. Built for developers who demand enterprise-grade features without sacrificing ease of use.
|
|
20
20
|
|
|
21
21
|
### 🎯 What Sets Us Apart
|
|
22
22
|
|
|
23
|
-
| Feature
|
|
24
|
-
|
|
|
25
|
-
| **
|
|
26
|
-
| **18 Observability Resources**
|
|
27
|
-
| **19 AI-Powered Prompts**
|
|
28
|
-
| **OAuth 2.1 + Access Control**
|
|
29
|
-
| **Smart Tool Filtering**
|
|
30
|
-
| **HTTP Streaming Transport**
|
|
31
|
-
| **High-Performance Pooling**
|
|
32
|
-
| **Ecosystem Integrations**
|
|
33
|
-
| **Advanced Encryption**
|
|
34
|
-
| **
|
|
35
|
-
| **
|
|
36
|
-
| **
|
|
23
|
+
| Feature | Description |
|
|
24
|
+
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| **192 Specialized Tools** | The largest MySQL tool collection for MCP — from core CRUD and native JSON functions (MySQL 5.7+) to advanced spatial/GIS, document store, and cluster management |
|
|
26
|
+
| **18 Observability Resources** | Real-time schema, performance metrics, process lists, status variables, replication status, and InnoDB diagnostics |
|
|
27
|
+
| **19 AI-Powered Prompts** | Guided workflows for query building, schema design, performance tuning, and infrastructure setup |
|
|
28
|
+
| **OAuth 2.1 + Access Control** | Enterprise-ready security with RFC 9728/8414 compliance, granular scopes (`read`, `write`, `admin`, `full`, `db:*`, `table:*:*`), and Keycloak integration |
|
|
29
|
+
| **Smart Tool Filtering** | 25 tool groups + 11 shortcuts let you stay within IDE limits while exposing exactly what you need |
|
|
30
|
+
| **HTTP Streaming Transport** | SSE-based streaming with `/sse`, `/messages`, and `/health` endpoints for remote deployments |
|
|
31
|
+
| **High-Performance Pooling** | Built-in connection pooling for efficient, concurrent database access |
|
|
32
|
+
| **Ecosystem Integrations** | First-class support for **MySQL Router**, **ProxySQL**, and **MySQL Shell** utilities |
|
|
33
|
+
| **Advanced Encryption** | Full TLS/SSL support for secure connections, plus tools for managing data masking, encryption monitoring, and compliance |
|
|
34
|
+
| **Deterministic Error Handling** | Every tool returns structured `{success, error}` responses — no raw exceptions, no silent failures, no misleading messages. Agents get actionable context instead of cryptic MySQL error codes |
|
|
35
|
+
| **Production-Ready Security** | SQL injection protection, parameterized queries, input validation, and audit capabilities |
|
|
36
|
+
| **Worker Sandbox Isolation** | Code Mode executes in a separate V8 isolate via `worker_threads` with a `MessagePort` RPC bridge, enforced memory limits, readonly mode, and hard timeouts |
|
|
37
|
+
| **Strict TypeScript** | 100% type-safe codebase with 2169 tests and 90% coverage |
|
|
38
|
+
| **MCP 2025-11-25 Compliant** | Full protocol support with tool safety hints, resource priorities, and progress notifications |
|
|
37
39
|
|
|
38
40
|
---
|
|
39
41
|
|
|
@@ -50,13 +52,18 @@
|
|
|
50
52
|
#### NPM (Recommended)
|
|
51
53
|
|
|
52
54
|
```bash
|
|
53
|
-
# Install globally
|
|
54
55
|
npm install -g @neverinfamous/mysql-mcp
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Run the server:
|
|
55
59
|
|
|
56
|
-
|
|
60
|
+
```bash
|
|
57
61
|
mysql-mcp --transport stdio --mysql mysql://user:password@localhost:3306/database
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or use npx without installing:
|
|
58
65
|
|
|
59
|
-
|
|
66
|
+
```bash
|
|
60
67
|
npx @neverinfamous/mysql-mcp --transport stdio --mysql mysql://user:password@localhost:3306/database
|
|
61
68
|
```
|
|
62
69
|
|
|
@@ -80,6 +87,61 @@ node dist/cli.js --transport stdio --mysql mysql://user:password@localhost:3306/
|
|
|
80
87
|
|
|
81
88
|
---
|
|
82
89
|
|
|
90
|
+
## Code Mode: Maximum Efficiency
|
|
91
|
+
|
|
92
|
+
Code Mode (`mysql_execute_code`) dramatically reduces token usage (70–90%) and is included by default in all presets.
|
|
93
|
+
|
|
94
|
+
Code executes in a **worker-thread sandbox** — a separate V8 isolate with its own memory space. All `mysql.*` API calls are forwarded to the main thread via a `MessagePort`-based RPC bridge, where the actual database operations execute. This provides:
|
|
95
|
+
|
|
96
|
+
- **Process-level isolation** — user code runs in a separate V8 instance with enforced heap limits
|
|
97
|
+
- **Readonly enforcement** — when `readonly: true`, write methods return structured errors instead of executing
|
|
98
|
+
- **Hard timeouts** — worker termination if execution exceeds the configured limit
|
|
99
|
+
- **Full API access** — all 24 tool groups are available via `mysql.*` (e.g., `mysql.core.readQuery()`, `mysql.json.extract()`)
|
|
100
|
+
|
|
101
|
+
Set `CODEMODE_ISOLATION=vm` to fall back to the in-process `vm` module sandbox if needed.
|
|
102
|
+
|
|
103
|
+
### ⚡ Code Mode Only (Maximum Token Savings)
|
|
104
|
+
|
|
105
|
+
If you control your own setup, you can run with **only Code Mode enabled** — a single tool that provides access to all 192 tools' worth of capability through the `mysql.*` API:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"mcpServers": {
|
|
110
|
+
"mysql-mcp": {
|
|
111
|
+
"command": "node",
|
|
112
|
+
"args": [
|
|
113
|
+
"/path/to/mysql-mcp/dist/cli.js",
|
|
114
|
+
"--transport",
|
|
115
|
+
"stdio",
|
|
116
|
+
"--tool-filter",
|
|
117
|
+
"codemode"
|
|
118
|
+
],
|
|
119
|
+
"env": {
|
|
120
|
+
"MYSQL_HOST": "localhost",
|
|
121
|
+
"MYSQL_PORT": "3306",
|
|
122
|
+
"MYSQL_USER": "your_user",
|
|
123
|
+
"MYSQL_PASSWORD": "your_password",
|
|
124
|
+
"MYSQL_DATABASE": "your_database"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
This exposes just `mysql_execute_code`. The agent writes JavaScript against the typed `mysql.*` SDK — composing queries, chaining operations across all 24 tool groups, and returning exactly the data it needs — in one execution. This mirrors the [Code Mode pattern](https://blog.cloudflare.com/code-mode-mcp/) pioneered by Cloudflare for their entire API: fixed token cost regardless of how many capabilities exist.
|
|
132
|
+
|
|
133
|
+
> [!TIP]
|
|
134
|
+
> **Maximize Token Savings:** Instruct your AI agent to prefer Code Mode over individual tool calls:
|
|
135
|
+
>
|
|
136
|
+
> _"When using mysql-mcp, prefer `mysql_execute_code` (Code Mode) for multi-step database operations to minimize token usage."_
|
|
137
|
+
>
|
|
138
|
+
> For maximum savings, use `--tool-filter codemode` to run with Code Mode as your only tool. See the [Code Mode wiki](https://github.com/neverinfamous/mysql-mcp/wiki/Code-Mode) for full API documentation.
|
|
139
|
+
|
|
140
|
+
> [!NOTE]
|
|
141
|
+
> **AntiGravity Users:** Server instructions are automatically sent to MCP clients during initialization. However, AntiGravity does not currently support MCP server instructions. For optimal Code Mode usage in AntiGravity, manually provide the contents of [`src/constants/ServerInstructions.ts`](https://github.com/neverinfamous/mysql-mcp/blob/main/src/constants/ServerInstructions.ts) to the agent in your prompt or user rules.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
83
145
|
## ⚡ MCP Client Configuration
|
|
84
146
|
|
|
85
147
|
### HTTP/SSE Server Usage (Advanced)
|
|
@@ -116,11 +178,15 @@ mysql-mcp --mysql mysql://root:pass@localhost/db \
|
|
|
116
178
|
|
|
117
179
|
**Start the HTTP server:**
|
|
118
180
|
|
|
181
|
+
Local installation:
|
|
182
|
+
|
|
119
183
|
```bash
|
|
120
|
-
# Local installation
|
|
121
184
|
node dist/cli.js --transport http --port 3000 --server-host 0.0.0.0 --mysql mysql://user:password@localhost:3306/database
|
|
185
|
+
```
|
|
122
186
|
|
|
123
|
-
|
|
187
|
+
Docker (expose port 3000):
|
|
188
|
+
|
|
189
|
+
```bash
|
|
124
190
|
docker run -p 3000:3000 writenotenow/mysql-mcp \
|
|
125
191
|
--transport http \
|
|
126
192
|
--port 3000 \
|
|
@@ -191,67 +257,14 @@ docker run -p 3000:3000 writenotenow/mysql-mcp \
|
|
|
191
257
|
| **MySQL in Docker** | Container name or network | `mysql://user:pass@mysql-container:3306/db` |
|
|
192
258
|
| **Remote/Cloud MySQL** | Hostname or IP | `mysql://user:pass@db.example.com:3306/db` |
|
|
193
259
|
|
|
194
|
-
### MySQL on Host Machine
|
|
195
|
-
|
|
196
|
-
If MySQL is installed directly on your computer (via installer, Homebrew, etc.):
|
|
197
|
-
|
|
198
|
-
```json
|
|
199
|
-
"--mysql", "mysql://user:password@host.docker.internal:3306/database"
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### MySQL in Another Docker Container
|
|
203
|
-
|
|
204
|
-
Add both containers to the same Docker network, then use the container name:
|
|
205
|
-
|
|
206
|
-
```bash
|
|
207
|
-
# Create network and run MySQL
|
|
208
|
-
docker network create mynet
|
|
209
|
-
docker run -d --name mysql-db --network mynet -e MYSQL_ROOT_PASSWORD=pass mysql:8
|
|
210
|
-
# Run MCP server on same network
|
|
211
|
-
docker run -i --rm --network mynet writenotenow/mysql-mcp:latest \
|
|
212
|
-
--transport stdio --mysql mysql://root:pass@mysql-db:3306/mysql
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Remote/Cloud MySQL (RDS, Cloud SQL, etc.)
|
|
216
|
-
|
|
217
|
-
Use the remote hostname directly:
|
|
218
|
-
|
|
219
|
-
```json
|
|
220
|
-
"--mysql", "mysql://user:password@your-instance.region.rds.amazonaws.com:3306/database"
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
| Provider | Example Hostname |
|
|
224
|
-
| ---------------- | ------------------------------------------------ |
|
|
225
|
-
| AWS RDS | `your-instance.xxxx.us-east-1.rds.amazonaws.com` |
|
|
226
|
-
| Google Cloud SQL | `project:region:instance` (via Cloud SQL Proxy) |
|
|
227
|
-
| Azure MySQL | `your-server.mysql.database.azure.com` |
|
|
228
|
-
| PlanetScale | `aws.connect.psdb.cloud` (SSL required) |
|
|
229
|
-
| DigitalOcean | `your-cluster-do-user-xxx.db.ondigitalocean.com` |
|
|
230
|
-
|
|
231
260
|
> **Tip:** For remote connections, ensure your MySQL server allows connections from Docker's IP range and that firewalls/security groups permit port 3306.
|
|
232
261
|
|
|
233
262
|
---
|
|
234
263
|
|
|
235
|
-
## Code Mode: Maximum Efficiency
|
|
236
|
-
|
|
237
|
-
Code Mode (`mysql_execute_code`) dramatically reduces token usage (70–90%) and is included by default in all presets.
|
|
238
|
-
|
|
239
|
-
> [!TIP]
|
|
240
|
-
> **Maximize Token Savings:** For the best results, instruct your AI agent to prefer Code Mode over individual tool calls. Add a rule like this to your agent's prompt or system configuration:
|
|
241
|
-
>
|
|
242
|
-
> _"When using mysql-mcp, prefer `mysql_execute_code` (Code Mode) for multi-step database operations to minimize token usage."_
|
|
243
|
-
>
|
|
244
|
-
> This ensures the agent batches operations into single calls instead of making many individual tool calls. See the [Code Mode wiki](https://github.com/neverinfamous/mysql-mcp/wiki/Code-Mode) for full API documentation.
|
|
245
|
-
|
|
246
|
-
> [!NOTE]
|
|
247
|
-
> **AntiGravity Users:** Server instructions are automatically sent to MCP clients during initialization. However, AntiGravity does not currently support MCP server instructions. For optimal Code Mode usage in AntiGravity, manually provide the contents of [`src/constants/ServerInstructions.ts`](https://github.com/neverinfamous/mysql-mcp/blob/master/src/constants/ServerInstructions.ts) to the agent in your prompt or user rules.
|
|
248
|
-
|
|
249
|
-
---
|
|
250
|
-
|
|
251
264
|
## 🛠️ Tool Filtering
|
|
252
265
|
|
|
253
266
|
> [!IMPORTANT]
|
|
254
|
-
> **AI IDEs like Cursor have tool limits (typically 40-50 tools).** With
|
|
267
|
+
> **AI IDEs like Cursor have tool limits (typically 40-50 tools).** With 192 tools available, you MUST use tool filtering to stay within your IDE's limits. We recommend `starter` (39 tools) as a starting point. Code Mode is included in all presets by default for 70-90% token savings on multi-step operations.
|
|
255
268
|
|
|
256
269
|
### What Can You Filter?
|
|
257
270
|
|
|
@@ -260,7 +273,7 @@ The `--tool-filter` argument accepts **shortcuts**, **groups**, or **tool names*
|
|
|
260
273
|
| Filter Pattern | Example | Tools | Description |
|
|
261
274
|
| ---------------- | --------------------------- | ----- | ------------------------- |
|
|
262
275
|
| Shortcut only | `starter` | 39 | Use a predefined bundle |
|
|
263
|
-
| Groups only | `core,json,transactions` |
|
|
276
|
+
| Groups only | `core,json,transactions` | 33 | Combine individual groups |
|
|
264
277
|
| Shortcut + Group | `starter,spatial` | 51 | Extend a shortcut |
|
|
265
278
|
| Shortcut - Tool | `starter,-mysql_drop_table` | 38 | Remove specific tools |
|
|
266
279
|
|
|
@@ -278,7 +291,7 @@ The `--tool-filter` argument accepts **shortcuts**, **groups**, or **tool names*
|
|
|
278
291
|
| `dba-secure` | 33 | DBA Security | core, security, roles, transactions, codemode |
|
|
279
292
|
| `base-core` | 49 | Base Ops | core, json, transactions, text, schema, codemode |
|
|
280
293
|
| `base-advanced` | 41 | Advanced Features | docstore, spatial, stats, fulltext, events, codemode |
|
|
281
|
-
| `ecosystem` |
|
|
294
|
+
| `ecosystem` | 41 | External Tools | cluster, proxysql, router, shell, codemode |
|
|
282
295
|
|
|
283
296
|
### Tool Groups (25 Available)
|
|
284
297
|
|
|
@@ -306,134 +319,13 @@ The `--tool-filter` argument accepts **shortcuts**, **groups**, or **tool names*
|
|
|
306
319
|
| `roles` | 8 | MySQL 8.0 role management |
|
|
307
320
|
| `docstore` | 9 | Document Store collections |
|
|
308
321
|
| `cluster` | 10 | Group Replication, InnoDB Cluster |
|
|
309
|
-
| `proxysql` |
|
|
322
|
+
| `proxysql` | 11 | ProxySQL management |
|
|
310
323
|
| `router` | 9 | MySQL Router REST API |
|
|
311
324
|
| `codemode` | 1 | Sandboxed code execution |
|
|
312
325
|
|
|
313
326
|
---
|
|
314
327
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
Add one of these configurations to your IDE's MCP settings file (e.g., `cline_mcp_settings.json`, `.cursorrules`, or equivalent):
|
|
318
|
-
|
|
319
|
-
#### Option 1: Starter (39 Essential Tools)
|
|
320
|
-
|
|
321
|
-
**Best for:** General MySQL database work - CRUD operations, schema management, and monitoring.
|
|
322
|
-
|
|
323
|
-
```json
|
|
324
|
-
{
|
|
325
|
-
"mcpServers": {
|
|
326
|
-
"mysql-mcp": {
|
|
327
|
-
"command": "node",
|
|
328
|
-
"args": [
|
|
329
|
-
"/path/to/mysql-mcp/dist/cli.js",
|
|
330
|
-
"--transport",
|
|
331
|
-
"stdio",
|
|
332
|
-
"--tool-filter",
|
|
333
|
-
"starter"
|
|
334
|
-
],
|
|
335
|
-
"env": {
|
|
336
|
-
"MYSQL_HOST": "localhost",
|
|
337
|
-
"MYSQL_PORT": "3306",
|
|
338
|
-
"MYSQL_USER": "your_username",
|
|
339
|
-
"MYSQL_PASSWORD": "your_password",
|
|
340
|
-
"MYSQL_DATABASE": "your_database"
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
#### Option 2: Cluster (11 Tools for InnoDB Cluster Monitoring)
|
|
348
|
-
|
|
349
|
-
**Best for:** Monitoring InnoDB Cluster, Group Replication status, and cluster topology.
|
|
350
|
-
|
|
351
|
-
> **⚠️ Prerequisites:**
|
|
352
|
-
>
|
|
353
|
-
> - **InnoDB Cluster** must be configured and running with Group Replication enabled
|
|
354
|
-
> - Connect to a cluster node directly (e.g., `localhost:3307`) — NOT a standalone MySQL instance
|
|
355
|
-
> - Use `cluster_admin` or `root` user with appropriate privileges
|
|
356
|
-
> - See [MySQL Ecosystem Setup Guide](https://github.com/neverinfamous/mysql-mcp/wiki/MySQL-Ecosystem-Setup) for cluster setup instructions
|
|
357
|
-
|
|
358
|
-
```json
|
|
359
|
-
{
|
|
360
|
-
"mcpServers": {
|
|
361
|
-
"mysql-mcp-cluster": {
|
|
362
|
-
"command": "node",
|
|
363
|
-
"args": [
|
|
364
|
-
"/path/to/mysql-mcp/dist/cli.js",
|
|
365
|
-
"--transport",
|
|
366
|
-
"stdio",
|
|
367
|
-
"--tool-filter",
|
|
368
|
-
"cluster"
|
|
369
|
-
],
|
|
370
|
-
"env": {
|
|
371
|
-
"MYSQL_HOST": "localhost",
|
|
372
|
-
"MYSQL_PORT": "3307",
|
|
373
|
-
"MYSQL_USER": "cluster_admin",
|
|
374
|
-
"MYSQL_PASSWORD": "cluster_password",
|
|
375
|
-
"MYSQL_DATABASE": "mysql"
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
#### Option 3: Ecosystem (42 Tools for InnoDB Cluster Deployments)
|
|
383
|
-
|
|
384
|
-
**Best for:** MySQL Router, ProxySQL, MySQL Shell, and InnoDB Cluster deployments.
|
|
385
|
-
|
|
386
|
-
> **⚠️ Prerequisites:**
|
|
387
|
-
>
|
|
388
|
-
> - **InnoDB Cluster** with MySQL Router requires the cluster to be running for Router REST API authentication (uses `metadata_cache` backend)
|
|
389
|
-
> - Router REST API uses HTTPS with self-signed certificates by default — set `MYSQL_ROUTER_INSECURE=true` to bypass certificate verification
|
|
390
|
-
> - **X Protocol:** InnoDB Cluster includes the MySQL X Plugin by default. Set `MYSQL_XPORT` to the Router's X Protocol port (e.g., `6448`) for `mysqlsh_import_json` and `docstore` tools
|
|
391
|
-
> - See [MySQL Ecosystem Setup Guide](https://github.com/neverinfamous/mysql-mcp/wiki/MySQL-Ecosystem-Setup) for detailed instructions
|
|
392
|
-
|
|
393
|
-
```json
|
|
394
|
-
{
|
|
395
|
-
"mcpServers": {
|
|
396
|
-
"mysql-mcp-ecosystem": {
|
|
397
|
-
"command": "node",
|
|
398
|
-
"args": [
|
|
399
|
-
"/path/to/mysql-mcp/dist/cli.js",
|
|
400
|
-
"--transport",
|
|
401
|
-
"stdio",
|
|
402
|
-
"--tool-filter",
|
|
403
|
-
"ecosystem"
|
|
404
|
-
],
|
|
405
|
-
"env": {
|
|
406
|
-
"MYSQL_HOST": "localhost",
|
|
407
|
-
"MYSQL_PORT": "3307",
|
|
408
|
-
"MYSQL_XPORT": "6448",
|
|
409
|
-
"MYSQL_USER": "cluster_admin",
|
|
410
|
-
"MYSQL_PASSWORD": "cluster_password",
|
|
411
|
-
"MYSQL_DATABASE": "testdb",
|
|
412
|
-
"MYSQL_ROUTER_URL": "https://localhost:8443",
|
|
413
|
-
"MYSQL_ROUTER_USER": "rest_api",
|
|
414
|
-
"MYSQL_ROUTER_PASSWORD": "router_password",
|
|
415
|
-
"MYSQL_ROUTER_INSECURE": "true",
|
|
416
|
-
"PROXYSQL_HOST": "localhost",
|
|
417
|
-
"PROXYSQL_PORT": "6032",
|
|
418
|
-
"PROXYSQL_USER": "radmin",
|
|
419
|
-
"PROXYSQL_PASSWORD": "radmin",
|
|
420
|
-
"MYSQLSH_PATH": "/usr/local/bin/mysqlsh"
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
```
|
|
426
|
-
|
|
427
|
-
**Customization Notes:**
|
|
428
|
-
|
|
429
|
-
- Replace `/path/to/mysql-mcp/` with your actual installation path
|
|
430
|
-
- Update credentials with your actual values
|
|
431
|
-
- For Windows: Use forward slashes (e.g., `C:/mysql-mcp/dist/cli.js`) or escape backslashes
|
|
432
|
-
- For Windows MySQL Shell: `"MYSQLSH_PATH": "C:\\Program Files\\MySQL\\MySQL Shell 9.5\\bin\\mysqlsh.exe"`
|
|
433
|
-
- **Router Authentication:** Router REST API authenticates against the InnoDB Cluster metadata. The cluster must be running for authentication to work.
|
|
434
|
-
- **Cluster Resource:** The `mysql://cluster` resource is only available when connected to an InnoDB Cluster node
|
|
435
|
-
|
|
436
|
-
> **📖 See the [Tool Filtering Wiki](https://github.com/neverinfamous/mysql-mcp/wiki/Tool-Filtering)** for advanced examples.
|
|
328
|
+
> **📖 See the [Tool Filtering Wiki](https://github.com/neverinfamous/mysql-mcp/wiki/Tool-Filtering)** for IDE configuration examples and advanced usage.
|
|
437
329
|
|
|
438
330
|
---
|
|
439
331
|
|
|
@@ -448,56 +340,13 @@ For debugging or manual reference, see the source: [`src/constants/ServerInstruc
|
|
|
448
340
|
|
|
449
341
|
## 🤖 AI-Powered Prompts
|
|
450
342
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
| Prompt | Description |
|
|
454
|
-
| ----------------------------- | ------------------------------------------------------ |
|
|
455
|
-
| `mysql_query_builder` | Construct SQL queries with security best practices |
|
|
456
|
-
| `mysql_schema_design` | Design table schemas with indexes and relationships |
|
|
457
|
-
| `mysql_performance_analysis` | Analyze slow queries with optimization recommendations |
|
|
458
|
-
| `mysql_migration` | Generate migration scripts with rollback options |
|
|
459
|
-
| `mysql_database_health_check` | Comprehensive database health assessment |
|
|
460
|
-
| `mysql_backup_strategy` | Enterprise backup planning with RTO/RPO |
|
|
461
|
-
| `mysql_index_tuning` | Index analysis and optimization workflow |
|
|
462
|
-
| `mysql_setup_router` | MySQL Router configuration guide |
|
|
463
|
-
| `mysql_setup_proxysql` | ProxySQL configuration guide |
|
|
464
|
-
| `mysql_setup_replication` | Replication setup guide |
|
|
465
|
-
| `mysql_setup_shell` | MySQL Shell usage guide |
|
|
466
|
-
| `mysql_tool_index` | Complete tool index with categories |
|
|
467
|
-
| `mysql_quick_query` | Quick query execution shortcut |
|
|
468
|
-
| `mysql_quick_schema` | Quick schema exploration |
|
|
469
|
-
| **`mysql_setup_events`** | Event Scheduler setup guide |
|
|
470
|
-
| **`mysql_sys_schema_guide`** | sys schema usage and diagnostics |
|
|
471
|
-
| **`mysql_setup_spatial`** | Spatial/GIS data setup guide |
|
|
472
|
-
| **`mysql_setup_cluster`** | InnoDB Cluster/Group Replication guide |
|
|
473
|
-
| **`mysql_setup_docstore`** | Document Store / X DevAPI guide |
|
|
343
|
+
**19 intelligent prompts** for guided workflows including query building, schema design, performance analysis, migration planning, backup strategy, index tuning, and ecosystem setup (Router, ProxySQL, Replication, Shell, Cluster, Spatial, Events, Document Store).
|
|
474
344
|
|
|
475
345
|
---
|
|
476
346
|
|
|
477
347
|
## 📊 Resources
|
|
478
348
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
| Resource | Description |
|
|
482
|
-
| ----------------------- | ------------------------------------------- |
|
|
483
|
-
| `mysql://schema` | Full database schema |
|
|
484
|
-
| `mysql://tables` | Table listing with metadata |
|
|
485
|
-
| `mysql://variables` | Server configuration variables |
|
|
486
|
-
| `mysql://status` | Server status metrics |
|
|
487
|
-
| `mysql://processlist` | Active connections and queries |
|
|
488
|
-
| `mysql://pool` | Connection pool statistics |
|
|
489
|
-
| `mysql://capabilities` | Server version, features, tool categories |
|
|
490
|
-
| `mysql://health` | Comprehensive health status |
|
|
491
|
-
| `mysql://performance` | Query performance metrics |
|
|
492
|
-
| `mysql://indexes` | Index usage and statistics |
|
|
493
|
-
| `mysql://replication` | Replication status and lag |
|
|
494
|
-
| `mysql://innodb` | InnoDB buffer pool and engine metrics |
|
|
495
|
-
| **`mysql://events`** | Event Scheduler status and scheduled events |
|
|
496
|
-
| **`mysql://sysschema`** | sys schema diagnostics summary |
|
|
497
|
-
| **`mysql://locks`** | InnoDB lock contention detection |
|
|
498
|
-
| **`mysql://cluster`** | Group Replication/InnoDB Cluster status |
|
|
499
|
-
| **`mysql://spatial`** | Spatial columns and indexes |
|
|
500
|
-
| **`mysql://docstore`** | Document Store collections |
|
|
349
|
+
**18 real-time resources** for database observability: schema, tables, variables, status, processlist, connection pool, capabilities, health, performance, indexes, replication, InnoDB metrics, events, sys schema, locks, cluster status, spatial metadata, and document store collections.
|
|
501
350
|
|
|
502
351
|
---
|
|
503
352
|
|
|
@@ -524,7 +373,7 @@ Schema metadata is cached to reduce repeated queries during tool/resource invoca
|
|
|
524
373
|
|
|
525
374
|
> **Tip:** Lower `METADATA_CACHE_TTL_MS` for development (e.g., `5000`), or increase it for production with stable schemas (e.g., `300000` = 5 min).
|
|
526
375
|
|
|
527
|
-
> **Built-in payload optimization:** Many tools support optional `summary: true` for condensed responses and `limit` parameters to cap result sizes. These are particularly useful for cluster status, monitoring, and sys schema tools where full responses can be large. See [`ServerInstructions.ts`](https://github.com/neverinfamous/mysql-mcp/blob/
|
|
376
|
+
> **Built-in payload optimization:** Many tools support optional `summary: true` for condensed responses and `limit` parameters to cap result sizes. These are particularly useful for cluster status, monitoring, and sys schema tools where full responses can be large. See [`ServerInstructions.ts`](https://github.com/neverinfamous/mysql-mcp/blob/main/src/constants/ServerInstructions.ts) for per-tool details.
|
|
528
377
|
|
|
529
378
|
---
|
|
530
379
|
|
|
@@ -552,20 +401,6 @@ Schema metadata is cached to reduce repeated queries during tool/resource invoca
|
|
|
552
401
|
|
|
553
402
|
---
|
|
554
403
|
|
|
555
|
-
## Contributing
|
|
556
|
-
|
|
557
|
-
Contributions are welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md) before submitting a pull request.
|
|
558
|
-
|
|
559
|
-
## Security
|
|
560
|
-
|
|
561
|
-
For security concerns, please see our [Security Policy](SECURITY.md).
|
|
562
|
-
|
|
563
|
-
> **⚠️ Never commit credentials** - Store secrets in `.env` (gitignored)
|
|
564
|
-
|
|
565
|
-
## License
|
|
566
|
-
|
|
567
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
568
|
-
|
|
569
|
-
## Code of Conduct
|
|
404
|
+
## Contributing & Security
|
|
570
405
|
|
|
571
|
-
|
|
406
|
+
[Contributing Guidelines](CONTRIBUTING.md) • [Security Policy](SECURITY.md) • [MIT License](LICENSE) • [Code of Conduct](CODE_OF_CONDUCT.md)
|
package/Dockerfile
CHANGED
|
@@ -48,7 +48,12 @@ RUN apk upgrade --no-cache
|
|
|
48
48
|
# - CVE-2024-21538: cross-spawn < 7.0.5
|
|
49
49
|
# - CVE-2025-64756: glob < 10.5.0
|
|
50
50
|
# - CVE-2025-5889: brace-expansion <= 2.0.1
|
|
51
|
+
# - CVE-2026-26960: tar < 7.5.8 (patch npm's bundled copy)
|
|
51
52
|
RUN npm install -g npm@latest && \
|
|
53
|
+
npm install -g tar@latest && \
|
|
54
|
+
rm -rf /usr/local/lib/node_modules/npm/node_modules/tar && \
|
|
55
|
+
cp -r /usr/local/lib/node_modules/tar /usr/local/lib/node_modules/npm/node_modules/tar && \
|
|
56
|
+
npm uninstall -g tar && \
|
|
52
57
|
npm cache clean --force
|
|
53
58
|
|
|
54
59
|
# Create non-root user for security
|