db-query
Query project databases with automatic SSH tunnel management. Use when you need to execute SQL queries against configured databases, especially those accessible only via SSH tunnels. Automatically manages SSH connection lifecycle (establishes tunnel before query, closes after). Supports multiple databases distinguished by description/name from config file.
Install
mkdir -p .claude/skills/db-query && curl -L -o skill.zip "https://mcp.directory/api/skills/download/5051" && unzip -o skill.zip -d .claude/skills/db-query && rm skill.zipInstalls to .claude/skills/db-query
About this skill
Database Query
Overview
Query databases through a centralized configuration file with automatic SSH tunnel management. Handles connection details, SSH tunnel setup/teardown, and query execution.
Security
Passwords are never exposed in process lists. The skill uses environment variables for credentials:
MYSQL_PWDfor database passwords (passed to mysql client)SSHPASSfor SSH tunnel passwords (passed to sshpass)
Recommended: Store credentials in environment variables instead of the config file for better security.
Configuration
Setup
-
Create config file at
~/.config/clawdbot/db-config.json:mkdir -p ~/.config/clawdbot # Copy example config and edit cp /usr/lib/node_modules/clawdbot/skills/db-query/scripts/config.example.json ~/.config/clawdbot/db-config.json -
Add database entries with these fields:
name: Description used to find the database (required)host: Database host (required)port: Database port (default: 3306)database: Database name (required)user: Database user (required)password: Database password (optional, can use env var)ssh_tunnel: Optional SSH tunnel configuration
-
SSH tunnel configuration (if needed):
enabled: true/falsessh_host: Remote SSH hostssh_user: SSH usernamessh_port: SSH port (default: 22)local_port: Local port to forward (e.g., 3307)remote_host: Remote database host behind SSH (default: localhost)remote_port: Remote database port (default: 3306)
Environment Variables (Recommended)
Instead of storing passwords in the config file, use environment variables:
# Format: DB_PASSWORD_<DATABASE_NAME> (spaces replaced with underscores, uppercase)
export DB_PASSWORD_PRODUCTION_USER_DB="your_db_password"
# Format: SSH_PASSWORD_<DATABASE_NAME> for SSH tunnel password
export SSH_PASSWORD_PRODUCTION_USER_DB="your_ssh_password"
Example Config
{
"databases": [
{
"name": "Production User DB",
"host": "localhost",
"port": 3306,
"database": "user_db",
"user": "db_user",
"password": "",
"ssh_tunnel": {
"enabled": true,
"ssh_host": "prod.example.com",
"ssh_user": "deploy",
"local_port": 3307
}
}
]
}
Set environment variables (recommended):
export DB_PASSWORD_PRODUCTION_USER_DB="your_db_password"
export SSH_PASSWORD_PRODUCTION_USER_DB="your_ssh_password"
Usage
List Databases
python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py --list
Query a Database
python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py \
--database "Production User DB" \
--query "SELECT * FROM users LIMIT 10"
The script will:
- Find database by matching description in config
- Start SSH tunnel (if configured)
- Execute query
- Automatically close SSH tunnel (important for cleanup)
With Custom Config Path
python3 /usr/lib/node_modules/clawdbot/skills/db-query/scripts/db_query.py \
--config /path/to/custom-config.json \
--database "test" \
--query "SHOW TABLES"
Requirements
- MySQL client:
apt install mysql-clientor equivalent - SSH client: usually pre-installed on Linux/Mac
- Python 3.6+
Notes
- SSH tunnels are automatically closed after query execution
- Use
--listto see all configured databases and their descriptions - Database search is case-insensitive partial match on
namefield - Local ports for SSH tunnels should be unique per database
More by openclaw
View all skills by openclaw →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversSecure read-only MySQL access with automatic DB inference, parameterized queries, whitelisting and rate limiting — a saf
Connect Supabase projects to AI with Supabase MCP Server. Standardize LLM communication for secure, efficient developmen
Unlock powerful OLAP database analytics on ClickHouse MCP Server. Manage OLAP data with seamless online analytical proce
KuzuDB delivers robust database management with direct access to graph databases, Cypher query execution, and multi-agen
Trackio auto-exposes experiment tracking from Gradio apps—query ML projects, runs, metrics and stats without changing ex
MCP Toolbox for Databases by Google. An open-source server that lets AI agents query Cloud SQL, Spanner, AlloyDB, and ot
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.