db-operations

db-operations is a command for Claude Code from vishnu2kmohan/mcp-server-langgraph. It costs 12 tokens per session (2,264 once invoked), scanned B, original, MIT.

A command set for managing a PostgreSQL database, including data used by OpenFGA, an authorization service, and the application.

In plain words
What is it for?
Use it to open the database shell, create or restore backups, and run database migrations.
Why use it?
It collects common database tasks in one workflow instead of requiring you to remember separate shell commands for inspecting, backing up, restoring, and changing the database.

Command for Claude Code

Install

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.

agentmods
npx agentmods add commands/vishnu2kmohan/mcp-server-langgraph/db-operations
Clone the repo
git clone --depth 1 https://github.com/vishnu2kmohan/mcp-server-langgraph

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 db-operations

README.md
[![agentmods](https://agentmods.dev/badge/commands/vishnu2kmohan/mcp-server-langgraph/db-operations.svg)](https://agentmods.dev/commands/vishnu2kmohan/mcp-server-langgraph/db-operations)
Your own site
<a href="https://agentmods.dev/commands/vishnu2kmohan/mcp-server-langgraph/db-operations"><img src="https://agentmods.dev/badge/commands/vishnu2kmohan/mcp-server-langgraph/db-operations.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,264 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00012 $0.02264
Opus 5 $0.00006 $0.01132
Sonnet 5 $0.00002 $0.00453
Haiku 4.5 $0.00001 $0.00226

Measured 5d ago against content hash baf2d5781595, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

db-operations 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 5d 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.

chmod 755 backups
.claude/commands/db-operations.md · 495 lines

How it starts

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

Database Operations

Usage: /db-operations or /db-operations <action>

Purpose: Manage PostgreSQL database operations for OpenFGA and application data

Actions:

  • shell - Access database shell
  • backup - Create database backup
  • restore - Restore from backup
  • migrate - Run migrations

📊 Database Overview

The MCP Server LangGraph uses PostgreSQL for:

  • OpenFGA data: Authorization tuples and models
  • Session data: (if configured for PostgreSQL backend)
  • Application state: Persistent storage

Connection Details:

  • Host: localhost
  • Port: 5432
  • Database: openfga
  • User: postgres
  • Container: postgres (via docker-compose)

🔧 Database Operations

Access Database Shell

Open PostgreSQL interactive shell:

make db-shell

What it does:

  • Connects to PostgreSQL container
  • Opens psql interactive shell
  • Connected to openfga database

Example session:

openfga=# \dt
-- List all tables

openfga=# SELECT * FROM store;
-- View OpenFGA stores

openfga=# \d authorization_model
-- Describe authorization_model table

openfga=# \q
-- Quit

Common psql commands:

  • \dt - List tables
  • \d table_name - Describe table
  • \l - List databases
  • \du - List users
  • \q - Quit

Create Database Backup

Create timestamped backup:

make db-backup

What it does:

  • Creates backups/ directory if needed
  • Dumps database to SQL file
  • Filename: openfga_backup_YYYYMMDD_HHMMSS.sql
  • Includes all tables, data, and schema

Example:

Creating database backup...
✓ Backup created in backups/

Backup file: backups/openfga_backup_20251021_143022.sql
Size: 2.4 MB

Backup includes:

  • All OpenFGA stores
  • Authorization models
  • Tuples (user-role-resource relationships)
  • Configuration data

Storage location: ./backups/

Retention: Manual cleanup (keep critical backups)


Restore from Backup

Restore database from backup file:

make db-restore

Read the full file on GitHub · 495 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. 5d ago First seen · 495 lines · 12 tokens per session scan B baf2d5781595

Subscribe to this mod's changes

db-operations is a command published in the GitHub repository vishnu2kmohan/mcp-server-langgraph (4 stars, last pushed 5d ago), licensed MIT. It adds 12 tokens to every session and 2,264 once invoked, about $0.0001 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.