sqlmate-mcp: Instructions file for Claude Code

CLAUDE.md

sqlmate-mcp CLAUDE.md is an instructions file for Claude Code from adamrpostjr/sqlmate-mcp. It costs 2,276 tokens per session, scanned A, original, MIT.

Repository instructions for sqlmate-mcp, an MCP server that gives Claude Code database tools and a browser interface for inspecting databases. Claude Code is a coding assistant, and MCP is a standard way for assistants to use external tools.

In plain words
What is it for?
Use them when developing or operating sqlmate-mcp, including its Node.js backend, browser interface, shared GUI process, and automated tests.
Why use it?
They collect the commands and project structure needed to start the server, build its Svelte frontend, run its development server, register it with Claude Code, and test it.

Instructions file for Claude Code

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/adamrpostjr/sqlmate-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/adamrpostjr/sqlmate-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,276 This file is loaded in full into every session.
When invoked 2,276 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.02276 $0.02276
Opus 5.5 $0.00910 $0.00910
Sonnet 5.5 $0.00455 $0.00455
Haiku 4.5 $0.00228 $0.00228

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

Security

Grade A, and why

sqlmate-mcp 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 25d 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 · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 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.

Commands

# Start the MCP server (attach-only; run by Claude Code, not you)
npm start                    # node src/index.js

# Start the standalone GUI daemon (run once, e.g. at login — see Host/Attach below)
node src/index.js gui
node src/index.js gui --install-autostart    # Windows: start it at login
node src/index.js gui --uninstall-autostart

# Build the frontend (Svelte → /public)
npm run build                # installs frontend deps + vite build

# Frontend dev server (proxies /api to localhost:4737)
cd frontend && npm run dev

# Register with Claude Code (one-time)
claude mcp add --transport stdio sqlmate-mcp node /path/to/src/index.js

# Run tests
npm test                     # node --test test/**/*.test.js

No lint command is configured.

Architecture

sqlmate-mcp is a zero-config MCP server that exposes database tools to Claude Code, plus a browser GUI for database inspection that runs as a separate, long-lived daemon process — decoupled from any single editor/MCP session. See "Host/Attach Architecture" below.

Backend (src/)

Pure Node.js ES modules, no TypeScript, no build step.

File Role
src/index.js Dual entry point, dispatched on argv[2]. No args → MCP mode: loads connections, starts the stdio MCP server, and attaches only to a GUI daemon if one is reachable (never binds the GUI port, never opens a browser). gui → GUI daemon mode: binds the GUI port and runs the shared dashboard standalone, independent of any MCP session; also handles gui --install-autostart / --uninstall-autostart (Windows login item)
src/mcp.js 9 MCP tools (list_connections, add_connection, list_tables, describe_table, get_schema, run_query, explain_query, run_write, dump_database). Includes 2-step confirmation for risky write operations via assessRisk()
src/drivers.js Driver implementations for MySQL/MariaDB (mysql2), SQLite (native node:sqlite), MSSQL (mssql), PostgreSQL (pg). Each exposes a uniform interface: listTables, describeTable, runQuery, runWrite, getPaginatedRows, updateRow, deleteRow, close
src/dump.js Backs dump_database: per-dialect DDL reconstruction, value literal formatters (exported for tests), paged row streaming, and output-file helpers (path resolution, .sqlmate/.gitignore, gzip, .partial + rename). Drivers expose openDumpSession() (one dedicated connection in a read-only snapshot)
src/connections.js Reads .env (Laravel-style DB_* vars or DATABASE_URL) and .sqlmaterc (JSON array) from SQLMATE_PROJECT_ROOT (defaults to cwd)
src/gui.js Express REST API on port 4737 (the daemon process only). Serves the built Svelte app from /public, project-scoped connection/table/row CRUD routes, the /api/host/* uplink routes used by attached MCP processes, and the SSE stream (/api/events) for the live agent feed
src/attach.js Client-side uplink used by every MCP process: probes /api/info, registers this project with the GUI daemon, sends heartbeats, and forwards local tool events. onHostGone fires if the daemon disappears (e.g. restarted); index.js retries the probe/attach on an interval rather than racing to become host itself
src/registry.js ProjectRegistry — in-memory store, kept by the GUI daemon, of every attached project it knows about: registration/reconciliation of connections, heartbeat TTL + GC of stale projects, per-project connection lookup, and the snapshot()/projects_changed data sent to the GUI. A daemon with no editor sessions attached simply has zero projects — getSelfProjectId() returns null and the GUI renders an empty sidebar until something attaches
src/protocol.js Shared constants between the daemon and attached MCP processes: APP, PROTOCOL_VERSION (compatibility check), HEARTBEAT_MS, PROJECT_TTL_MS, GC_INTERVAL_MS, and the projectId() hash function
src/events.js EventEmitter singleton — bridges MCP tool call lifecycle (tool_start/tool_end) and connections_changed from mcp.js to attach.js's uplink

Read the full file on GitHub · 93 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. 25d ago Changed · +2 lines · +241 tokens per session 7a1dfac9966a
  2. 1mo ago Changed · +7 lines · +368 tokens per session df85b5718e8a
  3. 2mo ago First seen · 84 lines · 1,667 tokens per session scan A 2afb116e757d

Subscribe to this mod's changes

sqlmate-mcp CLAUDE.md is an instructions file published in the GitHub repository adamrpostjr/sqlmate-mcp (1 stars, last pushed 25d ago), licensed MIT. It adds 2,276 tokens to every session, about $0.0091 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-08-31.

Related

Other instructions, from other repositories

vibetags com-example-indexed-app-DocumentImportJob.instructions.md

Instructions for PIsberg/vibetags, covering copilot instructions for documentimportjob, rules for method importall, strict test isolation, rules for method maplegacycolumn and rules for method usev2pipeline.

PIsberg/vibetags · 436 tokens

vibetags com-example-indexed-core-DocumentIndexEntry.instructions.md

Instructions for PIsberg/vibetags, covering copilot instructions for documentindexentry, core functionality, rules for method comparebysequence, thread-safety guarantee and architectural boundary constraints.

PIsberg/vibetags · 439 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 · 9,715 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,461 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