.cursor — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited .cursor (MCP Server) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
AI-to-DB Secure Gateway — 不只是一个 MCP Server,而是 AI 与数据库之间的安全执行网关。
基于 NestJS + TypeScript 构建,通过 MCP 协议为 Claude Code 等 AI 助手提供对 MySQL 数据库的受控访问能力。核心目标是在 AI 的灵活性与数据库的安全性之间建立可信边界。
传统数据库工具直接暴露执行能力,对 AI 调用者而言风险极高。本项目的核心设计原则:
npm install
cp .env.example .env
# 编辑 .env 填入 MySQL 连接信息
npm run start:dev # 开发模式
npm run build # 构建
npm run start:prod # 生产运行先构建项目:
npm run build使用 claude mcp add 命令注册(推荐,写入用户级全局配置):
claude mcp add mysql node /path/to/mysql-mcp-nest/dist/main.js \
--scope user \
-e DB_HOST=127.0.0.1 \
-e DB_PORT=3306 \
-e DB_USER=root \
-e DB_PASSWORD=your_password \
-e DB_DATABASE=your_database \
-e PERMISSION_MODE=read_write \
-e AUDIT_LOG_ENABLED=true \
-e AUDIT_LOG_DIR=/path/to/mysql-mcp-nest/logs--scope user:写入 ~/.claude.json,所有项目均可使用--scope project:写入当前项目的 .claude.json,仅当前项目可用注册后重启 claude,执行 /mcp 验证连接状态:
❯ /mcp
mysql connected先构建项目:
npm run build使用 codex mcp add 命令注册到 Codex:
codex mcp add mysql \
--env DB_HOST=127.0.0.1 \
--env DB_PORT=3306 \
--env DB_USER=root \
--env DB_PASSWORD=your_password \
--env DB_DATABASE=your_database \
--env PERMISSION_MODE=read_write \
--env AUDIT_LOG_ENABLED=true \
--env AUDIT_LOG_DIR=/path/to/mysql-mcp-nest/logs \
-- node /path/to/mysql-mcp-nest/dist/main.js验证配置是否写入成功:
codex mcp list
codex mcp get mysql注册后重启 Codex,或重新开启一个 Codex 会话,让 MCP 配置生效。
连接成功后即可直接使用:
列出 your_database 中的所有表项目已包含 .cursor/mcp.json,Cursor 打开本仓库后会注册 mysql MCP Server:
{
"mcpServers": {
"mysql": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/dist/main.js"],
"envFile": "${workspaceFolder}/.env",
"env": {
"AUDIT_LOG_DIR": "${workspaceFolder}/logs"
}
}
}
}使用前先构建项目,并确认 .env 里已填好 MySQL 连接信息:
npm run build然后重启 Cursor,或在 Cursor Settings → MCP 中刷新/启用 mysql。
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.