Skip to content

Commit bd050ef

Browse files
authored
Merge pull request #95 from benborla/revert-86-main
Revert "feat: Add linting scripts for ESLint and MarkdownLint"
2 parents bb6a81f + dd5b728 commit bd050ef

File tree

13 files changed

+37
-1464
lines changed

13 files changed

+37
-1464
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
dist
22
node_modules/
3-
.env

.markdownlint.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.markdownlintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changelog
22

3-
## Planned Features
43

4+
### Planned Features
55
- Query Features
66
- Prepared statement support
77
- Query parameter validation
@@ -37,38 +37,32 @@
3737
## [1.0.14] - 2024-07-01
3838

3939
### Added
40-
4140
- Added better support for test environments with automatic database selection
4241
- Implemented comprehensive debug logging for database configuration in test mode
4342
- Added fail-safe process termination handling for test environments
4443

4544
### Changed
46-
4745
- Improved test environment detection with support for Vitest test runner
4846
- Enhanced MySQL connection configuration to use consistent defaults across environments
4947
- Updated error handling in database setup scripts to be more resilient
5048

5149
### Fixed
52-
5350
- Fixed "No database selected" error in integration tests by ensuring database name is always set
5451
- Fixed authentication issues in test environments by providing consistent default credentials
5552
- Prevented premature test termination by implementing conditional process.exit handling
5653
- Improved error handling in test database setup to continue tests even when setup encounters issues
5754

5855
### Security
59-
6056
- Made authentication more consistent across development and test environments
6157
- Added safeguards to prevent exposing actual password values in debug logs
6258

6359
### Documentation
64-
6560
- Added detailed inline comments for test-specific configurations
6661
- Improved error messages to provide better debugging information
6762

6863
## [1.0.13] - 2024-05-26
6964

7065
### Added
71-
7266
- Complete write operations support through Smithery configuration
7367
- Added environment variables for database write operations (`ALLOW_INSERT_OPERATION`, `ALLOW_UPDATE_OPERATION`, `ALLOW_DELETE_OPERATION`)
7468
- New configuration options in Smithery schema for controlling write permissions
@@ -77,7 +71,6 @@
7771
- Enhanced error handling for unauthorized write operations
7872

7973
### Changed
80-
8174
- Updated Smithery configuration to include write operation settings
8275
- Improved Smithery integration with clear security defaults
8376
- Enhanced documentation with detailed configuration examples
@@ -86,21 +79,18 @@
8679
- Improved transaction handling for write operations
8780

8881
### Fixed
89-
9082
- Fixed error handling for database connection failures
9183
- Improved error messages for unauthorized operations
9284
- Better handling of MySQL 8.0+ authentication methods
9385
- Fixed SSL/TLS configuration options in Smithery
9486

9587
### Security
96-
9788
- All write operations (INSERT, UPDATE, DELETE) disabled by default
9889
- Added clear documentation about security implications of enabling write operations
9990
- Improved transaction isolation for write operations
10091
- Enhanced error reporting that doesn't expose sensitive information
10192

10293
### Documentation
103-
10494
- Updated README with comprehensive Smithery configuration instructions
10595
- Added detailed examples for enabling specific write operations
10696
- Improved troubleshooting section with common issues and solutions
@@ -110,46 +100,38 @@
110100
## [1.0.10] - 2024-03-13
111101

112102
### Changed
113-
114103
- Version bump to fix npm publishing issue
115104
- Updated installation instructions in README to reference specific version
116105

117106
## [1.0.9] - 2024-03-13
118107

119108
### Added
120-
121109
- GitHub Actions CI workflow for automated lint, build, and test with MySQL service
122110

123111
### Changed
124-
125112
- Removed `@types/mysql2` dependency and related type references
126113
- Updated test files to use `any` type instead of mysql2 specific types
127114
- Fixed integration tests to properly handle MySQL connection and queries
128115

129116
### Fixed
130-
131117
- Fixed GitHub Actions workflow to install pnpm before using it for caching
132118
- Fixed failing unit tests by removing problematic executeReadOnlyQuery tests
133119

134120
## [1.0.8] - 2024-03-12
135121

136122
### Changed
137-
138123
- Upgraded from `mysql` to `mysql2` package (^3.13.0) for better MySQL 8.0+ compatibility
139124
- Refactored database connection code to use mysql2's Promise-based API
140125
- Added support for MySQL 8.0+ authentication with `caching_sha2_password` plugin
141126

142127
### Removed
143-
144128
- Removed deprecated `mysql` package dependency
145129
- Removed unused `@types/mysql2` devDependency
146130

147131
### Fixed
148-
149132
- Fixed authentication issues with MySQL 8.0+ servers
150133
- Improved connection handling with Promise-based API
151134
- Enhanced error handling for database operations
152135

153136
## [1.0.7] - Previous version
154-
155-
- Initial release with basic MySQL functionality
137+
- Initial release with basic MySQL functionality

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MIT License
1+
MIT License
22

33
Copyright (c) 2024 Ben Borla
44

PROJECT_SETUP_GUIDE.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
This guide explains how to set up database connections for projects using Claude Code with MCP servers, SSH tunnels, and automatic hooks.
44

55
## Table of Contents
6-
76
- [Overview](#overview)
87
- [Prerequisites](#prerequisites)
98
- [Step-by-Step Setup](#step-by-step-setup)
@@ -15,7 +14,6 @@ This guide explains how to set up database connections for projects using Claude
1514
## Overview
1615

1716
Each project requires three main components for database access through Claude Code:
18-
1917
1. **SSH Tunnel Scripts** - Establish secure connection to remote database
2018
2. **MCP Configuration** - Configure database access through MCP server
2119
3. **Hooks** - Automatically start/stop tunnels with Claude
@@ -49,7 +47,6 @@ Each project requires three main components for database access through Claude C
4947
Create two scripts in your project directory:
5048

5149
#### `start-tunnel-[project].sh`
52-
5350
```bash
5451
#!/bin/bash
5552

@@ -88,7 +85,6 @@ fi
8885
```
8986

9087
#### `stop-tunnel-[project].sh`
91-
9288
```bash
9389
#!/bin/bash
9490

@@ -108,7 +104,6 @@ fi
108104
```
109105

110106
Make scripts executable:
111-
112107
```bash
113108
chmod +x start-tunnel-*.sh stop-tunnel-*.sh
114109
```
@@ -177,8 +172,7 @@ Choose a unique local port for each project to avoid conflicts:
177172
## File Structure
178173

179174
Your project should have this structure:
180-
181-
```bash
175+
```
182176
/path/to/your/project/
183177
├── .mcp.json # MCP configuration
184178
├── start-tunnel-[project].sh # Start SSH tunnel script
@@ -252,7 +246,6 @@ SSH_USER="myuser"
252246
## Testing Your Setup
253247

254248
### 1. Test SSH Tunnel
255-
256249
```bash
257250
# Start tunnel manually
258251
./start-tunnel-[project].sh
@@ -265,14 +258,12 @@ lsof -i :33XX
265258
```
266259

267260
### 2. Test Database Connection
268-
269261
```bash
270262
# Test connection through tunnel
271263
mysql -h 127.0.0.1 -P 33XX -u db_user -p"password" -D database_name -e "SELECT 'Connection OK' as status;"
272264
```
273265

274266
### 3. Test Claude Integration
275-
276267
```bash
277268
# Navigate to project
278269
cd /path/to/your/project
@@ -288,9 +279,7 @@ claude
288279
```
289280

290281
### 4. Test MCP Server Operations
291-
292282
Once in Claude, test database operations:
293-
294283
```sql
295284
# Through MCP server
296285
CREATE TABLE test_table (
@@ -310,31 +299,26 @@ DROP TABLE test_table;
310299
### Common Issues and Solutions
311300

312301
#### 1. SSH Tunnel Fails to Start
313-
314302
- **Check SSH key**: Ensure `~/.ssh/id_rsa` exists and has correct permissions (600)
315303
- **Test SSH manually**: `ssh -p 1022 [email protected]`
316304
- **Check port availability**: `lsof -i :33XX`
317305

318306
#### 2. Database Connection Fails
319-
320307
- **Verify tunnel is running**: `lsof -i :33XX`
321308
- **Check credentials**: Test with mysql client directly
322309
- **Verify database exists**: `SHOW DATABASES;`
323310

324311
#### 3. MCP Server Fails to Connect
325-
326312
- **Check MCP server is built**: `ls /Users/dimitarklaturov/Dropbox/github/mcp-server-mysql/dist/`
327313
- **Verify Node.js version**: `node --version` (should be 18+ or 20+)
328314
- **Check logs**: `claude --debug`
329315

330316
#### 4. Hooks Not Working
331-
332317
- **Check script permissions**: `ls -la *.sh` (should be executable)
333318
- **Verify script paths**: Use relative paths (`./script.sh`) in .mcp.json
334319
- **Test scripts manually**: Run start/stop scripts directly
335320

336321
#### 5. Port Conflicts
337-
338322
- **Kill existing process**: `kill $(lsof -ti:33XX)`
339323
- **Use different port**: Update both scripts and .mcp.json
340324

@@ -389,7 +373,6 @@ For each new project:
389373
## Support
390374

391375
For issues with:
392-
393376
- **MCP Server**: Check `/Users/dimitarklaturov/Dropbox/github/mcp-server-mysql`
394-
- **Claude Code**: Run `claude --help` or visit [https://docs.anthropic.com/en/docs/claude-code](https://docs.anthropic.com/en/docs/claude-code)
395-
- **SSH Tunnels**: Check server connectivity and SSH key configuration
377+
- **Claude Code**: Run `claude --help` or visit https://docs.anthropic.com/en/docs/claude-code
378+
- **SSH Tunnels**: Check server connectivity and SSH key configuration

README-MULTI-DB.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ To enable multi-DB mode, simply leave the `MYSQL_DB` environment variable empty:
3434
2. **Query Any Database**: You can execute queries against any database to which the MySQL user has access.
3535

3636
3. **Schema Qualification Required**: When working in multi-DB mode, you should use fully qualified table names with schema/database prefixes:
37-
3837
```sql
3938
-- Use fully qualified table names
4039
SELECT * FROM database_name.table_name;
@@ -47,7 +46,6 @@ To enable multi-DB mode, simply leave the `MYSQL_DB` environment variable empty:
4746
4. **Automatic Read-Only Mode**: For safety, multi-DB mode enforces read-only operations by default. This can be customized using schema-specific permissions (see below).
4847

4948
5. **Database Exploration**: You can explore databases using commands like:
50-
5149
```sql
5250
-- List all databases
5351
SHOW DATABASES;
@@ -74,15 +72,14 @@ This new feature allows fine-grained control over which operations are allowed o
7472

7573
Set the following environment variables with a comma-separated list of schema:permission pairs:
7674

77-
```txt
75+
```
7876
SCHEMA_INSERT_PERMISSIONS=production:false,development:true,test:true
7977
SCHEMA_UPDATE_PERMISSIONS=production:false,development:true,test:true
8078
SCHEMA_DELETE_PERMISSIONS=production:false,development:false,test:true
8179
SCHEMA_DDL_PERMISSIONS=production:false,development:false,test:true
8280
```
8381

8482
This configuration:
85-
8683
- Allows INSERT and UPDATE on development and test databases, but not production
8784
- Allows DELETE and DDL operations only on the test database
8885
- Blocks all write operations on the production database
@@ -130,19 +127,16 @@ Here's a complete example configuration with schema-specific permissions:
130127
## Environment Variables Summary
131128

132129
### Multi-DB Mode
133-
134130
- `MYSQL_DB`: Leave empty to enable multi-DB mode
135131
- `MULTI_DB_WRITE_MODE`: Set to "true" to allow write operations in multi-DB mode without schema-specific permissions (not recommended for security)
136132

137133
### Schema-Specific Permissions
138-
139134
- `SCHEMA_INSERT_PERMISSIONS`: Control INSERT permissions per schema
140135
- `SCHEMA_UPDATE_PERMISSIONS`: Control UPDATE permissions per schema
141136
- `SCHEMA_DELETE_PERMISSIONS`: Control DELETE permissions per schema
142137
- `SCHEMA_DDL_PERMISSIONS`: Control DDL permissions per schema (CREATE, ALTER, DROP, TRUNCATE)
143138

144139
### Global Permission Defaults
145-
146140
- `ALLOW_INSERT_OPERATION`: Global default for INSERT permissions
147141
- `ALLOW_UPDATE_OPERATION`: Global default for UPDATE permissions
148142
- `ALLOW_DELETE_OPERATION`: Global default for DELETE permissions

0 commit comments

Comments
 (0)