Skip to content

Conversation

@askdba
Copy link
Owner

@askdba askdba commented Dec 12, 2025

This PR adds command-line help functionality to mysql-mcp-server.

Changes

  • Added -h, --help, and help flags to display comprehensive help information
  • Help is shown before configuration loading, so it works even without MySQL connections configured
  • Unknown flags now show an error message with help
  • Comprehensive help includes:
    • Usage instructions
    • All environment variables with descriptions
    • Multi-DSN configuration examples
    • Usage examples
    • Feature list
    • Security recommendations

Testing

  • mysql-mcp-server -h shows help
  • mysql-mcp-server --help shows help
  • mysql-mcp-server -v shows version
  • ✅ Unknown flags show error + help
  • ✅ Code compiles successfully

Fixes the issue where -h flag was trying to load configuration instead of showing help.


Note

Adds CLI help (-h/--help/help), processes flags before config load, and shows error+usage on unknown flags.

  • CLI/Startup (cmd/mysql-mcp-server/main.go):
    • Add pre-configuration flag handling via switch for --version, -v, --help, -h, and help.
    • Unknown flags now print an error followed by usage and exit with non-zero status.
    • Introduce printHelp() providing concise usage, env var configuration (including multi-DSN), examples, features, tools list, security notes, and docs link.
    • Remove previous inline version-only handling in favor of centralized flag parsing.

Written by Cursor Bugbot for commit 1aa9892. This will update automatically on new commits. Configure here.

@askdba askdba merged commit 9631664 into main Dec 13, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants