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/call518/mcp-postgresql-ops/copilot-instructionsgit clone --depth 1 https://github.com/call518/MCP-PostgreSQL-OpsWhat 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.01932 | $0.01932 |
| Opus 5 | $0.00966 | $0.00966 |
| Sonnet 5 | $0.00386 | $0.00386 |
| Haiku 4.5 | $0.00193 | $0.00193 |
Grade A, and why
MCP-PostgreSQL-Ops copilot-instructions.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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MCP PostgreSQL Operations Server - AI Coding Agent Instructions
Architecture Overview
This is a Model Context Protocol (MCP) server built with FastMCP that provides PostgreSQL database monitoring and operations through natural language queries. The server acts as a safe, read-only bridge between AI assistants and PostgreSQL databases.
Core Components
mcp_main.py: Main MCP server with 24+@mcp.tool()decorated functionsfunctions.py: Database connection layer usingasyncpgwith multi-database supportversion_compat.py: PostgreSQL 12-17 version detection and adaptive feature handlingprompt_template.md: Comprehensive prompt definitions loaded via@mcp.prompt()decorators- Docker stack: PostgreSQL + MCP server + MCPO proxy + Open WebUI integration
Key Patterns
Multi-Database Architecture: All tools accept optional database_name parameter to target specific databases while maintaining a default connection database from POSTGRES_DB env var.
Extension Dependencies: Core functionality requires pg_stat_statements extension; pg_stat_monitor is optional. Always check extension availability with check_extension_exists() before using related tools.
Version-Aware Tools: Use version_compat.py for PostgreSQL 12-17 compatibility. Tools auto-adapt features based on detected version. PostgreSQL 18 is beta and not yet supported - will be added once stable.
Tool Structure: Each MCP tool follows this pattern:
@mcp.tool()
async def get_something(limit: int = 20, database_name: str = None) -> str:
"""Detailed docstring with [Tool Purpose], [Exact Functionality], [Required Use Cases], [Strictly Prohibited Use Cases]"""
try:
# Validate inputs (limit constraints: max 1-100)
# Check extension dependencies if needed
# Execute queries via functions.py
# Return formatted table data
except Exception as e:
logger.error(f"Failed to...: {e}")
return f"Error: {str(e)}"
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.
- 2d ago First seen · 184 lines · 1,932 tokens per session scan A 77c1a14b67e1
MCP-PostgreSQL-Ops copilot-instructions.md is an instructions file published in the GitHub repository call518/MCP-PostgreSQL-Ops (161 stars, last pushed 28d ago), licensed MIT. It adds 1,932 tokens to every session, about $0.0097 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-30.
Other instructions, from other repositories
ai-dba-workbench CLAUDE.md
Claude Code instructions for pgEdge/ai-dba-workbench, covering claude standing instructions, primary agent role, trivial-edit carve-out, project structure and key files.
PgQue CLAUDE.md
Instructions for NikolayS/PgQue, covering claude.md -- pgque, project, naming convention, architecture and stack.
expense-budget-tracker AGENTS.md
Instructions for kirill-markin/expense-budget-tracker, covering expense-budget-tracker, rules, components, supported clients and key paths.
pgmnemo AGENTS.md
Instructions for pgmnemo/pgmnemo, covering pgmnemo — agent integration guide, 1. what pgmnemo is — and the problem it solves, the problem, architectural consequences and 2. when to adopt / when not to.
bun-pg-mcp AGENTS.md
AGENTS.md instructions for igoraguiar/bun-pg-mcp, covering agents.md, project context, tech stack, directory map and commands.
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.