execute-sql

Read PostgreSQL databases via mcp-postgres with psql fallback.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/flesler/dotfiles --skill execute-sql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: execute-sql
Source: https://github.com/flesler/dotfiles/tree/main/home/.cursor/skills/execute-sql
Command: npx skills add https://github.com/flesler/dotfiles --skill execute-sql

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables reading data from a PostgreSQL-compatible database by using MCP tools, providing a reliable workflow and a clear fallback path when MCP tools are unavailable.

Core Features & Use Cases

  • Read data from a PostgreSQL database via mcp-postgres MCP tools for streamlined data access.
  • If MCP tools fail or are unavailable, extract the connection URI from the local .cursor/mcp.json file and execute SQL with psql to retrieve results.
  • Suitable for development and operational environments where quick, robust database read access is required without manual setup.

Quick Start

Use mcp-postgres to read the database, and fallback to psql if MCP tools are unavailable.

Frequently Asked Questions about execute-sql

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

FAQPage Schema
How do I read a PostgreSQL database when MCP tools are unavailable?

To read a PostgreSQL database when MCP tools are unavailable, extract the connection URI from the .cursor/mcp.json file and execute SQL queries using psql. This fallback method ensures data access when mcp-postgres tools timeout or are missing.

How do I execute SQL queries using mcp-postgres tools?

You execute SQL queries using mcp-postgres MCP tools for streamlined data access from a PostgreSQL-compatible database. The skill prioritizes mcp-postgres to read the database directly, providing a reliable workflow for development environments.

Where do I find the DATABASE_URI for psql fallback execution?

You find the DATABASE_URI for psql fallback execution within the local .cursor/mcp.json configuration file. The skill extracts this database connection string automatically to execute SQL queries when mcp-postgres tools are unavailable.

Does the psql fallback preserve the PostgreSQL search_path behavior?

Yes, the psql fallback preserves the implicit search_path behavior when executing SQL queries. This ensures that querying the PostgreSQL database via the command line maintains the same schema resolution as the primary MCP tools approach.

What is the best way to handle mcp-postgres timeouts during database read operations?

The best way to handle mcp-postgres timeouts during database read operations is to fallback to psql. By locating the DATABASE_URI in .cursor/mcp.json, you can execute SQL directly and retrieve results without manual environment setup.