ghost-database

Create, fork, query, and share managed PostgreSQL databases via Ghost CLI or MCP.

1.8k|106|Updated Jul 23, 2025
One-click install
npx skills add https://github.com/timescale/pg-aiguide --skill ghost-database
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ghost-database
Source: https://github.com/timescale/pg-aiguide/tree/main/skills/ghost-database
Command: npx skills add https://github.com/timescale/pg-aiguide --skill ghost-database

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Agent workflows often need persistent PostgreSQL storage on demand, but provisioning databases manually is slow and risky when testing schema changes. This Skill lets agents spin up databases instantly, fork them for safe migration testing, and pass database snapshots between agents without touching production data.

Core Features & Use Cases

  • On-Demand Database Lifecycle: Create, list, query, resume, and delete PostgreSQL databases through the Ghost CLI or MCP tools, with compute billed only when queries execute.
  • Instant Forking for Safe Testing: Copy a full database in seconds to test migrations or schema changes, then apply validated changes to the original or discard the fork.
  • Shareable Snapshots: Generate share URLs so other agents or teammates can spin up their own copy of a database, enabling databases to be passed as assets between agents.
  • Use Case: An agent needs to validate a schema migration. It forks the production database, runs the ALTER TABLE on the fork, verifies the result, applies it to the original, and deletes the fork — all without risking live data.

Quick Start

Ask your agent to create a new PostgreSQL database named my-app-db using Ghost and return its connection string.

Frequently Asked Questions about ghost-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a PostgreSQL database with Ghost?

Run ghost create my-app-db after authenticating with ghost login, which returns a database ID. Via MCP, call ghost_create with a name parameter. Then use ghost connect or ghost_connect to retrieve the connection string.

How do I test a database migration safely before applying it?

Fork the database with ghost fork to create a full copy in seconds, run your migration on the fork, and verify the results. If successful, apply the change to the original; if it fails, delete the fork and the original stays untouched.

Does Ghost work with AI coding agents like Claude Code or Cursor?

Yes, Ghost provides an MCP server installed with ghost mcp install, supporting Claude Code, Cursor, Windsurf, Codex, Gemini, VS Code, and Kiro. Agents get full database lifecycle control through MCP tools.

Can I give an agent read-only access to my Ghost databases?

Yes, run ghost config set read_only true before starting the MCP server. This forces ghost_sql into read-only mode and blocks destructive tools like ghost_delete, ghost_password, and ghost_rename.

How does Ghost billing work for on-demand databases?

Databases share a pool of compute hours billed in 15-minute chunks only when queries execute, with a free tier of 100 hours per month and 1TB storage. Databases auto-pause after 30 days idle while retaining storage.

When is Ghost not the right choice for a database?

Ghost is not suitable if you need a web dashboard, since it is CLI and MCP only, or if you need a non-PostgreSQL database. It is designed specifically for managed Postgres in agent-driven workflows.