mcp-multi-db: Instructions file for Codex

AGENTS.md

mcp-multi-db AGENTS.md is an instructions file for Codex, OpenCode from mahAnuj/mcp-multi-db. It costs 1,891 tokens per session, scanned B, original, ISC.

Repository instructions for an MCP server that connects coding agents to multiple databases. MCP is a standard way for an AI tool to call external services.

In plain words
What is it for?
Use them when installing dependencies, building or testing the TypeScript server, configuring databases, or debugging its JSON-RPC connection.
Why use it?
They document the commands, tests, configuration, architecture, and rules needed to change the server safely.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is mahAnuj/mcp-multi-db's own configuration. It tells Codex and OpenCode how to work on mcp-multi-db 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 mcp-multi-db configures →

Reuse

Borrowing it

Nothing to install: this file belongs to mahAnuj/mcp-multi-db. 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/mahAnuj/mcp-multi-db/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/mahAnuj/mcp-multi-db

Made for: Codex, OpenCode.

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 mcp-multi-db AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/mahanuj/mcp-multi-db/agents-md/github.svg)](https://agentmods.dev/instructions/mahanuj/mcp-multi-db/agents-md)
Your own site
<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/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 mcp-multi-db AGENTS.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,891 This file is loaded in full into every session.
When invoked 1,891 The same file — it is already loaded in full.
Security scan B 1 finding. 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.01891 $0.01891
Opus 5.5 $0.00756 $0.00756
Sonnet 5.5 $0.00378 $0.00378
Haiku 4.5 $0.00189 $0.00189

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

Security

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 7d 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
AGENTS.md · 54 lines

How it starts

The opening of the file, as written. The whole thing — 54 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 → build DatabaseRegistry → wrap in DatabaseService → registerTools → connect StdioServerTransport.
  • src/config.ts — loads/validates config via Zod. Reads MCP_DB_CONFIG (path to JSON file) first, else MCP_DATABASES (inline JSON). Accepts either { databases: [...] } or a bare array. Enforces unique ids.
  • src/tools/registerTools.ts — the 4 MCP tools (list_databases, list_tables, describe_table, run_query). Each is a thin wrapper that calls DatabaseService and 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: runQuery calls clampQueryLimit + validateReadOnlySql before dispatching to an adapter. Resolves adapters via getSqlAdapter, which narrows on kind and rejects a non-SQL database_id with a clear error (the routing seam for future non-SQL families).
  • src/adapters/registry.ts — maps database_id → adapter instance (typed AnyDatabasePort), lazily constructing and caching adapters (and their connection pools) on first use.
  • src/adapters/{postgres,mysql,sqlite}.ts — per-engine implementations of SqlDatabasePort.
  • src/core/databasePort.ts — the thin DatabasePort base (id, type, kind, close) shared by every family, the DatabaseKind discriminant (currently just "sql"), and AnyDatabasePort (the union of all port families). Port-family model: relational engines share one SqlDatabasePort (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 future MongoDbPort with kind: "mongodb"), its own read-only guard, and its own service, since they share no common vocabulary.
  • src/core/sqlDatabasePort.ts + src/core/types.ts — the SqlDatabasePort interface (extends DatabasePort) every SQL adapter implements, plus shared types. This is the seam: code above the adapters is engine-agnostic.

Read the full file on GitHub · 54 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. 7d ago Changed · +1 lines · +324 tokens per session 81a72d8e7572
  2. 2mo ago First seen · 53 lines · 1,567 tokens per session scan B 92d5b7573914

Subscribe to this mod's changes

mcp-multi-db AGENTS.md is an instructions file published in the GitHub repository mahAnuj/mcp-multi-db (1 stars, last pushed 7d ago), licensed ISC. It adds 1,891 tokens to every session, about $0.0076 per session on Opus 5.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.

Related

mcp-multi-db AGENTS.md compared with instructions from other repositories

mcp-multi-db AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-multi-db AGENTS.mdmahAnuj/mcp-multi-dbInstructions file17d agoISCB1,891Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot