Install
openclaw skills install @zkeviny/mgc-database-securitySecure database credential management using MGC Blackbox. Supports MySQL, PostgreSQL, SQLite, MariaDB and other databases. Store credentials locally in encrypted form, retrieve at runtime without exposing to AI models.
openclaw skills install @zkeviny/mgc-database-securityDatabase Credential Security is a documentation skill that teaches how to manage database credentials securely using MGC Blackbox. Supports MySQL, PostgreSQL, SQLite, MariaDB and other databases. It enables AI agents to execute database operations without ever exposing database passwords or connection strings to the AI model.
This skill contains no executable code and is safe for automatic approval.
After reading this documentation, an AI agent will understand how to:
Create a JSON file containing your database connection details:
{
"host": "localhost",
"port": 3306,
"database": "my_database",
"user": "db_user",
"password": "your_password"
}
Important: Use MCP tools for AI agents. CLI may have port conflicts in some environments.
Recommended: MCP Interface
mgc_save MCP tool to store credentialsmgc_get MCP tool to retrieve credentialsAlternative: CLI (for local development only)
mgc_save info_type=config info_owner=my_database < credentials.json
A secure database script follows this pattern:
The script must never print or expose database credentials.
function execute_query(sql):
credentials = retrieve_from_mgc("my_database")
connection = connect(credentials)
result = connection.execute(sql)
connection.close()
return result
Endpoint: /api/mgc/sensitive/get Method: POST Headers:
Body fields:
Response fields:
Endpoint: /api/mgc/sensitive/save Method: POST Headers: same as above
Body fields:
Tip: Users can also store credentials manually via MGC WebUI at http://127.0.0.1:57218/skill
import mysql.connector
def get_connection(credentials):
return mysql.connector.connect(
host=credentials["host"],
port=credentials["port"],
database=credentials["database"],
user=credentials["user"],
password=credentials["password"]
)
def execute_query(sql):
creds = retrieve_from_mgc("my_mysql")
conn = get_connection(creds)
cursor = conn.cursor()
cursor.execute(sql)
result = cursor.fetchall()
cursor.close()
conn.close()
return result
MIT