Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 21 additions & 23 deletions PROJECT_SETUP_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ Each project requires three main components for database access through Claude C
2. **MCP Configuration** - Configure database access through MCP server
3. **Hooks** - Automatically start/stop tunnels with Claude

### Current Project Configurations
### Example Project Configurations

| Project | Port | SSH Server | Database | Location |
|---------|------|------------|----------|----------|
| NIMA | 3307 | gold.superhosting.bg:1022 | izdavamc_nima | `/Users/dimitarklaturov/Dropbox/nima` |
| IZDAVAM | 3308 | gold.superhosting.bg:1022 | izdavamc_izdavam | `/Users/dimitarklaturov/Dropbox/izdavam` |
| NUFC | 3309 | nufc.bg:1022 | pwr0iwww_nufc | `/Users/dimitarklaturov/Dropbox/nufc` |
| STUDIA | 3310 | gold.superhosting.bg:1022 | izdavamc_studia | `/Users/dimitarklaturov/Dropbox/flutter/studia` |
| project-a | 3307 | server1.example.com:1022 | db_project_a | `/path/to/project-a` |
| project-b | 3308 | server1.example.com:1022 | db_project_b | `/path/to/project-b` |
| project-c | 3309 | server2.example.com:1022 | db_project_c | `/path/to/project-c` |
| project-d | 3310 | server1.example.com:1022 | db_project_d | `/path/to/project-d` |

## Prerequisites

1. **MCP MySQL Server** installed at: `/Users/dimitarklaturov/Dropbox/github/mcp-server-mysql`
1. **MCP MySQL Server** installed at: `/path/to/mcp-server-mysql`
- Must have `MYSQL_DISABLE_READ_ONLY_TRANSACTIONS` support for CREATE TABLE operations
- Built with `npm run build` or `pnpm build`

Expand Down Expand Up @@ -144,7 +144,7 @@ Create `.mcp.json` in your project directory:
"[project]-mysql-server": {
"type": "stdio",
"command": "bash",
"args": ["-c", "cd /Users/dimitarklaturov/Dropbox/github/mcp-server-mysql && node dist/index.js"],
"args": ["-c", "cd /path/to/mcp-server-mysql && node dist/index.js"],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "33XX",
Expand Down Expand Up @@ -188,29 +188,29 @@ Your project should have this structure:

## Configuration Examples

### Example 1: Project on gold.superhosting.bg
### Example 1: Project on example.com

For projects hosted on gold.superhosting.bg (like NIMA, IZDAVAM, STUDIA):
For projects hosted on example.com (like project-a, project-b, project-d):

```json
{
"hooks": {
"claude_start": {
"command": "./start-tunnel-myproject.sh",
"background": true,
"description": "Start SSH tunnel for MYPROJECT database"
"description": "Start SSH tunnel for myproject database"
},
"claude_stop": {
"command": "./stop-tunnel-myproject.sh",
"background": false,
"description": "Stop SSH tunnel for MYPROJECT database"
"description": "Stop SSH tunnel for myproject database"
}
},
"inputs": [
{
"type": "promptString",
"id": "mysql-password-myproject",
"description": "MySQL Password for MYPROJECT Database",
"description": "MySQL Password for myproject Database",
"password": true,
"default": "my_secure_password"
}
Expand All @@ -219,13 +219,13 @@ For projects hosted on gold.superhosting.bg (like NIMA, IZDAVAM, STUDIA):
"myproject-mysql-server": {
"type": "stdio",
"command": "bash",
"args": ["-c", "cd /Users/dimitarklaturov/Dropbox/github/mcp-server-mysql && node dist/index.js"],
"args": ["-c", "cd /path/to/mcp-server-mysql && node dist/index.js"],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3311",
"MYSQL_USER": "izdavamc_myproject",
"MYSQL_USER": "db_myproject",
"MYSQL_PASS": "${input:mysql-password-myproject}",
"MYSQL_DB": "izdavamc_myproject",
"MYSQL_DB": "db_myproject",
"ALLOW_INSERT_OPERATION": "true",
"ALLOW_UPDATE_OPERATION": "true",
"ALLOW_DELETE_OPERATION": "true",
Expand All @@ -239,12 +239,12 @@ For projects hosted on gold.superhosting.bg (like NIMA, IZDAVAM, STUDIA):

### Example 2: Project on Different Server

For projects on different servers (like NUFC on nufc.bg):
For projects on different servers (like project-c on server2.example.com):

```bash
# start-tunnel-myproject.sh
LOCAL_PORT=3312
REMOTE_SERVER="myserver.com"
REMOTE_SERVER="server2.example.com"
SSH_PORT=22 # Standard SSH port
SSH_USER="myuser"
```
Expand Down Expand Up @@ -322,8 +322,7 @@ DROP TABLE test_table;
- **Verify database exists**: `SHOW DATABASES;`

#### 3. MCP Server Fails to Connect

- **Check MCP server is built**: `ls /Users/dimitarklaturov/Dropbox/github/mcp-server-mysql/dist/`
- **Check MCP server is built**: `ls /path/to/mcp-server-mysql/dist/`
- **Verify Node.js version**: `node --version` (should be 18+ or 20+)
- **Check logs**: `claude --debug`

Expand All @@ -348,7 +347,7 @@ ps aux | grep ssh | grep -E "3307|3308|3309|3310"
lsof -i -P | grep LISTEN | grep -E "3307|3308|3309|3310"

# Test MCP server directly
cd /Users/dimitarklaturov/Dropbox/github/mcp-server-mysql
cd /path/to/mcp-server-mysql
MYSQL_HOST=127.0.0.1 MYSQL_PORT=33XX MYSQL_USER=user MYSQL_PASS=pass MYSQL_DB=db node dist/index.js

# View Claude logs
Expand Down Expand Up @@ -389,7 +388,6 @@ For each new project:
## Support

For issues with:

- **MCP Server**: Check `/Users/dimitarklaturov/Dropbox/github/mcp-server-mysql`
- **Claude Code**: Run `claude --help` or visit [https://docs.anthropic.com/en/docs/claude-code](https://docs.anthropic.com/en/docs/claude-code)
- **MCP Server**: Check `/path/to/mcp-server-mysql`
- **Claude Code**: Run `claude --help` or visit https://docs.anthropic.com/en/docs/claude-code
- **SSH Tunnels**: Check server connectivity and SSH key configuration
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ If you want to clone and run this MCP server directly from the source code, foll
"ALLOW_INSERT_OPERATION": "false",
"ALLOW_UPDATE_OPERATION": "false",
"ALLOW_DELETE_OPERATION": "false",
"PATH": "/Users/atlasborla/Library/Application Support/Herd/config/nvm/versions/node/v22.9.0/bin:/usr/bin:/bin", // <--- Important to add the following, run in your terminal `echo "$(which node)/../"` to get the path
"NODE_PATH": "/Users/atlasborla/Library/Application Support/Herd/config/nvm/versions/node/v22.9.0/lib/node_modules" // <--- Important to add the following, run in your terminal `echo "$(which node)/../../lib/node_modules"`
"PATH": "/path/to/node/bin:/usr/bin:/bin", // <--- Important to add the following, run in your terminal `echo "$(which node)/../"` to get the path
"NODE_PATH": "/path/to/node/lib/node_modules" // <--- Important to add the following, run in your terminal `echo "$(which node)/../../lib/node_modules"`
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@benborla29/mcp-server-mysql",
"version": "2.0.6",
"description": "MCP server for interacting with MySQL databases based on Node",
"description": "MCP server for interacting with MySQL databases with write operations support",
"license": "MIT",
"author": "Ben Borla (https://github.com/benborla)",
"type": "module",
Expand Down
Loading