Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/mahanuj/mcp-multi-db/agents-mdgit clone --depth 1 https://github.com/mahAnuj/mcp-multi-dbWrote 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/mahanuj/mcp-multi-db/agents-md)<a href="https://agentmods.dev/instructions/mahanuj/mcp-multi-db/agents-md"><img src="https://agentmods.dev/badge/instructions/mahanuj/mcp-multi-db/agents-md.svg" alt="Measured on agentmods" 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 | $0.01567 | $0.01567 |
| Opus 5 | $0.00783 | $0.00783 |
| Sonnet 5 | $0.00313 | $0.00313 |
| Haiku 4.5 | $0.00157 | $0.00157 |
Grade B, and why
mcp-multi-db AGENTS.md scanned grade B with 1 finding 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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
npm run build # tsc -> build/, then chmod 755 build/index.js How it starts
The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Guidance for AI coding agents working in this repository. Also useful to humans.
See CONTRIBUTING.md for the contributor workflow.
Commands
npm install # install dependencies
npm run build # tsc -> build/, then chmod 755 build/index.js
npm test # runs build, then node:test suite in test/
node --test "test/**/*.test.ts" # run tests without rebuilding
node --test test/validateReadOnly.test.ts # run a single test file
Tests use Node's built-in runner (node:test, no extra deps) and require Node ≥ 22.18 / 24 (native TypeScript execution). They import the compiled build/*.js — not src — because the source uses constructor parameter properties that Node's type-stripping can't run, so npm test builds first. There is no linter; TypeScript strict mode is the type/correctness gate. Always npm run build after changes — build/index.js is what the MCP client executes.
To run the server manually for debugging (it speaks MCP over stdio, so it waits for JSON-RPC on stdin):
MCP_DB_CONFIG=./databases.json node build/index.js
Architecture
Deeper reference docs (with diagrams) live in docs/ — docs/architecture.md for the component map + run_query lifecycle, docs/extending.md for adding an engine. Keep them in sync when the architecture changes.
A read-only MCP server (stdio transport) that exposes SQL queries over PostgreSQL, MySQL, and SQLite to MCP clients (e.g. Cursor). Layers, from entry point outward:
src/index.ts— wires everything: load config → buildDatabaseRegistry→ wrap inDatabaseService→registerTools→ connectStdioServerTransport.src/config.ts— loads/validates config via Zod. ReadsMCP_DB_CONFIG(path to JSON file) first, elseMCP_DATABASES(inline JSON). Accepts either{ databases: [...] }or a bare array. Enforces uniqueids.src/tools/registerTools.ts— the 4 MCP tools (list_databases,list_tables,describe_table,run_query). Each is a thin wrapper that callsDatabaseServiceand returns the result JSON-stringified into a text content block. Tool input schemas are defined here with Zod.src/services/databaseService.ts— orchestration layer. The only place the read-only SQL guard runs:runQuerycallsclampQueryLimit+validateReadOnlySqlbefore dispatching to an adapter. Resolves adapters viagetSqlAdapter, which narrows onkindand rejects a non-SQLdatabase_idwith a clear error (the routing seam for future non-SQL families).src/adapters/registry.ts— mapsdatabase_id→ adapter instance (typedAnyDatabasePort), lazily constructing and caching adapters (and their connection pools) on first use.src/adapters/{postgres,mysql,sqlite}.ts— per-engine implementations ofSqlDatabasePort.src/core/databasePort.ts— the thinDatabasePortbase (id,type,kind,close) shared by every family, theDatabaseKinddiscriminant (currently just"sql"), andAnyDatabasePort(the union of all port families). Port-family model: relational engines share oneSqlDatabasePort(kind: "sql") because they share a model; non-relational engines are intentionally not grouped under a "nosql" port — each would get its own port/family (e.g. a futureMongoDbPortwithkind: "mongodb"), its own read-only guard, and its own service, since they share no common vocabulary.src/core/sqlDatabasePort.ts+src/core/types.ts— theSqlDatabasePortinterface (extendsDatabasePort) every SQL adapter implements, plus shared types. This is the seam: code above the adapters is engine-agnostic.
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.
- 4d ago First seen · 53 lines · 1,567 tokens per session scan B 92d5b7573914
mcp-multi-db AGENTS.md is an instructions file published in the GitHub repository mahAnuj/mcp-multi-db (1 stars, last pushed 5d ago), licensed ISC. It adds 1,567 tokens to every session, about $0.0078 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
db-mcp-server CLAUDE.md
Instructions for vika2603/db-mcp-server, covering claude.md, build and development commands, architecture, layer structure and key design patterns.
graphjin AGENTS.md
AGENTS.md instructions for dosco/graphjin, covering graphjin agent guide, architectural overview, directory structure & responsibilities, build commands and coding guidelines.
databasement CLAUDE.md
Claude Code instructions for David-Crty/databasement, covering claude.md, project overview, development commands, setup and installation and running the application.
Chat2DB AGENTS.md
AGENTS.md instructions for OtterMind/Chat2DB, covering chat2db community agent contract, context, product invariants, repository map and structural code navigation.
neon-mcp-server CLAUDE.md
Claude Code instructions for voyagi/neon-mcp-server, covering neon mcp server — upwork portfolio project, purpose, what to build, demo scenario: "techstart crm" and value proposition.
munin-memory CLAUDE.md
Claude Code instructions for Magnus-Gille/munin-memory, a project described as: Persistent memory for AI assistants, self-hosted and provider-portable. MCP server with SQLite + FTS5 + sqlite-vec.