Skip to main content
Glama
SQL Context Pack

SQL Context Pack

by cognivex006

SQL Context Pack

SQL Context Pack turns a live database into AI-ready SQL context: the DDL and metadata of every TABLE, PROCEDURE and FUNCTION the owner's profile allows, plus a bounded masked sample of table data, organised into context folders — with anything it cannot confidently classify kept in unknowns/ rather than guessed.

Version 3.3.1 · Python >=3.11 · Output format 2

What it does

  • Reads SQL Server, PostgreSQL, MySQL, MariaDB and Oracle, read-only.

  • Exports DDL and metadata for tables, stored procedures and stored functions. Table data is only ever a bounded, masked sample — never every row.

  • Writes a managed header into every SQL file carrying identity, context, description, tags, classification status and content hashes.

  • Classifies files from an owner-registered folder, writing to a separate output directory by default.

  • Maintains [agrimap_app].[DB_METADATA_CONTEXT] as a searchable context index, synchronised on every export so the next run starts better informed.

  • Plans and applies procedure and function updates, one file or a whole folder, always through CREATE OR ALTER and always behind an approval.

  • Runs the same Skill and MCP surface on Codex, Claude Code, Antigravity (agy) and Gemini CLI.

  • Runs one service per machine. Every session connects through its own stdio bridge, not its own server.

Related MCP server: MCP Database Query Server

Boundaries worth knowing up front

  • Credentials stay on the owner's side. The agent never receives them.

  • The service binds loopback only.

  • Both database write scopes are off by default, and are independent.

  • Supervised database writes require a single-use, request-bound approval.

  • Query Data is read-only SELECT, validated by parsing, with per-column masking.

  • The context index and routine deployment are SQL Server features. The other four engines export full context and support Query Data, and say so plainly rather than failing oddly.

Repository and verification

Canonical repository: https://github.com/cognivex006/sql-context-pack. GitHub Actions are disabled and no Actions workflows are shipped. Maintainers run pwsh -NoProfile -File scripts/dev-check.ps1 and python scripts/validate_manifests.py locally before release. Version 3.3.1 is republished from this repository after migration.

Install in one line

Windows:

powershell -ExecutionPolicy Bypass -c "irm https://github.com/cognivex006/sql-context-pack/releases/latest/download/install.ps1 | iex"

Linux and macOS:

curl --progress-bar -fL https://github.com/cognivex006/sql-context-pack/releases/latest/download/install.sh | sh

Update later the same way, with update.ps1 or update.sh in place of install. Both always take the latest release, verify its SHA-256, install for every host they find, and report the package, plugin and service versions. Details are in Lifecycle.

Start here

  1. Getting Started — from nothing to a first export.

  2. Pick your host: Codex · Claude Code · Antigravity · Gemini CLI

  3. Usage Examples — three worked flows, simple to advanced.

The full documentation map lists everything else.

Everyday commands

sqlctx doctor check --mcp          # is everything ready?
sqlctx doctor update --host <host> # explicit update
sqlctx service status              # which supervisor owns the shared service

Working on this repository? Start at AGENTS.md; repair procedures are in docs/knowledge/.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Allows AI assistants to list tables, read data, and execute SQL queries through a controlled interface, making database exploration and analysis safer and more structured.
      3
      12,302 PyPI
      1,409
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query and explore databases including SQLite, PostgreSQL, MySQL, and SQL Server through a secure, read-only workflow. It provides tools for listing connections, inspecting table schemas, and executing SELECT statements directly within VS Code.
      1
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to safely query and explore SQL Server and PostgreSQL databases with read-only access, supporting schema discovery, relationship exploration, and query execution.
      33 npm
      3
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to inspect schemas, analyze performance, check security, and troubleshoot SQL Server 2019+ databases through a safe, controlled interface.
      -