sql-mcp-server: Instructions file for Claude Code

CLAUDE.md

sql-mcp-server CLAUDE.md is an instructions file for Claude Code from nethinwei/sql-mcp-server. It costs 2,957 tokens per session, scanned A, original, MIT.

A project instruction file for a controlled SQL gateway, a service that lets an AI agent access PostgreSQL, MySQL, or OceanBase databases through approved operations rather than arbitrary SQL. It documents architecture, configuration, tests, builds, and continuous integration checks.

In plain words
What is it for?
Use it when changing the Go service, administration web interface, database access rules, documentation, tests, or CI. It also lists commands for local, integration, and end-to-end testing.
Why use it?
It helps contributors understand the gateway's safety limits and use the repository's required checks instead of sending unrestricted database commands.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is nethinwei/sql-mcp-server's own configuration. It tells Claude Code how to work on sql-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 sql-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nethinwei/sql-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/nethinwei/sql-mcp-server/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/nethinwei/sql-mcp-server

Made for: Claude Code.

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 sql-mcp-server CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nethinwei/sql-mcp-server/claude-md/github.svg)](https://agentmods.dev/instructions/nethinwei/sql-mcp-server/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/nethinwei/sql-mcp-server/claude-md"><img src="https://agentmods.dev/badge/instructions/nethinwei/sql-mcp-server/claude-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 sql-mcp-server CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/nethinwei/sql-mcp-server/claude-md"><img src="https://agentmods.dev/badge/instructions/nethinwei/sql-mcp-server/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,957 This file is loaded in full into every session.
When invoked 2,957 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.02957 $0.02957
Opus 5.5 $0.01183 $0.01183
Sonnet 5.5 $0.00591 $0.00591
Haiku 4.5 $0.00296 $0.00296

Measured 4d ago against content hash 698ac73101ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sql-mcp-server CLAUDE.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 4d 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.

CLAUDE.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

面向不可信 AI Agent 的受控 SQL 网关:Agent 只能通过显式 Entity + 关系代数 IR + 参数化 codegen 访问 PostgreSQL/MySQL/OceanBase,不接受任意 SQL/DDL,能力无法证明时 fail closed。仓库文档是各自主题的唯一事实源,本文件只做索引与易踩坑提示: 编码规范与门禁见 CONTRIBUTING.md,测试与 CI 见 docs/testing.md,数据面架构见 docs/architecture.md,配置见 docs/configuration.md,管理面设计见 docs/design/{config-store,admin-api,authorization-model}.md,术语见 docs/glossary.md(pending/draft/role/database 的用法以它为准)。

常用命令

make build                  # 只编 Go;控制台需先 make web
make fmt / make fmt-check   # internal/fmtcheck:gofmt、120 字节行宽、800 行文件、50 行函数
make ci                     # fmt-check vet lint docs-check build test coverage-check govulncheck
make ci-full                # ci + 三库 integration + MCP e2e(需要 Docker)
make test-integration-postgres   # 单个 provider:postgres|mysql|oceanbase(OceanBase 容器约 3.5 分钟)
make test-e2e
make web                    # web/admin:pnpm install、vitest、vue-tsc、vite build → x/admin/ui/dist/app
make docs-check

go test -race ./x/admin/graph -run TestDraftRoundTrip        # 单个测试
go test -race -tags=integration ./x/configstore -run Postgres  # 集成测试带 build tag
cd web/admin && npx vitest run src/lib/jsonSchema.test.ts      # 单个前端测试
go generate ./core/config    # 重新生成 schema.json 与 docs/configuration.md 字段参考
go generate ./x/providers/all  # 重新生成 docs/provider-compatibility.md 的 Provider 能力表
go generate ./x/admin/graph  # gqlgen(schema.graphqls → generated.go/models_gen.go)
cd web/admin && pnpm codegen # GraphQL 客户端类型(src/gql,已 gitignore)

注意:

  • make lint 要求 golangci-lint v2.12.2,版本不符直接失败;
  • make fmt(golines)会改写与当前改动无关的文件并对齐 struct tag,可能反而超宽; 修改后只保留自己改动的文件,其余用 git checkout 还原;行宽按字节计,中文更占宽度;
  • 前端 TypeScript 固定 ~5.9(vue-tsc 不兼容 TS 7);
  • 控制台未构建时二进制只提供占位页;GoReleaser、Dockerfile、CI 都会先 make web。

依赖方向

core/ 只能依赖标准库与 core/(.golangci.yml depguard 强制);外部依赖、驱动、 MCP SDK、YAML、gqlgen 都在 x/ 或 cmd/。新增数据库只改 x/providers/<driver>、 注册到 x/providerregistry 并在 x/providers/all blank import,不改 core/ 与 x/bootstrap(见 CONTRIBUTING.md)。

Read the full file on GitHub · 139 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. 4d ago Changed · +1 lines · +23 tokens per session 698ac73101ac
  2. 8d ago Changed · +41 lines · +1,173 tokens per session 540d4451fc49
  3. 9d ago First seen · 97 lines · 1,761 tokens per session scan A dfd16020a513

Subscribe to this mod's changes

sql-mcp-server CLAUDE.md is an instructions file published in the GitHub repository nethinwei/sql-mcp-server (0 stars, last pushed 2d ago), licensed MIT. It adds 2,957 tokens to every session, about $0.0118 per session on Opus 5.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-10-09.

Related

Other instructions, from other repositories

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 · 9,649 tokens

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,257 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 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 · 4,159 tokens