mysql-mcp-server: Instructions file for Gemini CLI

GEMINI.md

mysql-mcp-server GEMINI.md is an instructions file for Gemini CLI from CobaltBlue3699/mysql-mcp-server. It costs 1,125 tokens per session, scanned A, original, MIT.

Project instructions for developing a MySQL MCP server with NestJS, a Node.js framework, and MCP, a standard way for AI tools to use external services.

In plain words
What is it for?
Use them when building, testing, formatting, linting, or changing the MySQL server project.
Why use it?
They give an AI coding tool the project’s structure, commands, database permissions, and testing rules so its changes fit the repository.

Instructions file for Gemini CLI

Written for Gemini CLI: the file is GEMINI.md. Also seen: mentions Gemini CLI.

This is CobaltBlue3699/mysql-mcp-server's own configuration. It tells Gemini CLI how to work on mysql-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mysql-mcp-server configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/CobaltBlue3699/mysql-mcp-server/main/GEMINI.md
Clone the repo
git clone --depth 1 https://github.com/CobaltBlue3699/mysql-mcp-server

Made for: Gemini CLI.

Wrote 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.

agentmods badge for mysql-mcp-server GEMINI.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/cobaltblue3699/mysql-mcp-server/gemini-md/github.svg)](https://agentmods.dev/instructions/cobaltblue3699/mysql-mcp-server/gemini-md)
Your own site
<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.

agentmods 80×15 button for mysql-mcp-server GEMINI.md

Your own site · 80×15
<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>
Per session 1,125 This file is loaded in full into every session.
When invoked 1,125 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 8d ago against content hash 27b80fafbbdd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

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.

GEMINI.md · 85 lines

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 專案的背景資訊、開發規範與操作指令。

專案概述

本專案是一個基於 NestJSMCP-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 測試。

Read the full file on GitHub · 85 lines

Changes

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.

  1. 8d ago First seen · 85 lines · 1,125 tokens per session scan A 27b80fafbbdd

Subscribe to this mod's changes

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.

Related

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.

vercel/next.js · 7,296 tokens

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.

openai/codex · 5,153 tokens

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).

microsoft/vscode · 6,785 tokens

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).

microsoft/vscode · 5,001 tokens

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.

langchain-ai/langchain · 4,469 tokens

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.

deepseek-ai/deepseek-harness · 3,735 tokens