Borrowing it
Nothing to install: this file belongs to CobaltBlue3699/mysql-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/CobaltBlue3699/mysql-mcp-server/main/GEMINI.mdgit clone --depth 1 https://github.com/CobaltBlue3699/mysql-mcp-serverWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/cobaltblue3699/mysql-mcp-server/gemini-md)<a href="https://agentmods.dev/instructions/cobaltblue3699/mysql-mcp-server/gemini-md"><img src="https://agentmods.dev/badge/instructions/cobaltblue3699/mysql-mcp-server/gemini-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/cobaltblue3699/mysql-mcp-server/gemini-md"><img src="https://agentmods.dev/badge/instructions/cobaltblue3699/mysql-mcp-server/gemini-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01125 | $0.01125 |
| Opus 5 | $0.00562 | $0.00562 |
| Sonnet 5 | $0.00225 | $0.00225 |
| Haiku 4.5 | $0.00112 | $0.00112 |
Grade A, and why
mysql-mcp-server GEMINI.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MySQL MCP Server 專案規範與指引
本文件為 Gemini CLI 提供關於 @johnson.lee/mysql-mcp-server 專案的背景資訊、開發規範與操作指令。
專案概述
本專案是一個基於 NestJS 與 MCP-Nest 開發的 Model Context Protocol (MCP) 伺服器,旨在讓 AI 助理(如 Claude、Cursor)能夠透過標準化協議安全地與 MySQL 資料庫進行互動。
核心技術棧
- 框架: NestJS (v11+)
- MCP 整合:
@rekog/mcp-nest,@modelcontextprotocol/sdk - 資料庫驅動:
mysql2/promise - 驗證:
zod(用於工具參數驗證) - 環境配置:
@nestjs/config
主要功能
- 連接池管理: 高效處理 MySQL 連接。
- 權限控管: 細粒度控制 SQL 操作(SELECT, INSERT, UPDATE, DELETE, DDL, VIEW)。
- DRY_RUN 模式: 驗證 SQL 語法而不回傳實際數據,確保安全性。
- 優雅停機 (Graceful Shutdown): 確保在進程結束前關閉資料庫連接並完成待處理查詢。
建置與運行指令
開發與建置
- 安裝依賴:
pnpm install - 建置專案:
pnpm run build - 開發模式啟動:
pnpm run start:dev - 生產模式啟動:
pnpm run start:prod - 程式碼格式化:
pnpm run format - 程式碼檢查 (Lint):
pnpm run lint
測試指令
- 單元測試:
pnpm run test - E2E 測試:
pnpm run test:e2e - 測試覆蓋率:
pnpm run test:cov
開發規範與慣例
1. 模組化架構 (NestJS)
- 遵循 NestJS 的模組化架構。核心邏輯應封裝在
src/mysql/模組中。 - Service: 處理資料庫連接與底層查詢(如
MySqlService)。 - Guard: 處理安全與權限驗證(如
PermissionGuardService)。 - Tools: 使用
@Tool裝飾器定義 MCP 工具,並放置於src/mysql/tools/。
2. MCP 工具定義
- 每個工具必須使用
zod定義參數結構。 - 工具內部應調用
PermissionGuardService進行權限檢查。 - 範例:
@Tool({ name: 'tool_name', description: '功能描述', parameters: z.object({ ... }) })
3. 安全與權限
- 禁止硬編碼憑證: 必須使用環境變數(透過
ConfigModule)進行配置。 - 權限檢查: 所有的 SQL 執行工具都必須通過
PermissionGuardService.checkPermission()。 - SQL 注入防護: 儘量使用參數化查詢(Prepared Statements)。
4. 錯誤處理
- 使用 NestJS 內建的
HttpException或其子類(如ForbiddenException)來處理工具內部的錯誤。 - 所有的資料庫操作應有適當的
try-catch區塊並記錄日誌。
5. 日誌規範
- 使用 NestJS 的
Logger類別進行日誌記錄。 - 敏感資訊(如密碼、私密內容)嚴禁記錄於日誌中。
檔案結構概覽
src/main.ts: 應用程式進入點,初始化 Nest 應用與 MCP 傳輸層。src/mysql/: 核心資料庫模組。mysql.service.ts: 資料庫連接池與查詢執行邏輯。permission.guard.ts: SQL 操作類別偵測與權限驗證。tools/: 定義所有 MCP 工具(如execute_query,describe_table等)。
openspec/: 存放 OpenSpec 相關的變更提案與設計文件。test/: 存放整合測試與 E2E 測試。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 85 lines · 1,125 tokens per session scan A 27b80fafbbdd
mysql-mcp-server GEMINI.md is an instructions file published in the GitHub repository CobaltBlue3699/mysql-mcp-server (0 stars, last pushed 1mo ago), licensed MIT. It adds 1,125 tokens to every session, about $0.0056 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.