sql-mcp: semantic warehouse queries

    1

    Tells Cursor, Claude Code, and other agents to query Postgres or SQLite only through the sql-mcp semantic layer, and links the GitHub install guide. Free to use.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    sql-mcp: semantic warehouse queries

    Example session with this skill installed

    What is the total revenue for the 'enterprise' segment in the sales_warehouse database for the last quarter? I have sql-mcp installed.

    • Read your context and instructions
    • Compiled the sql-mcp

    I will query the sales_warehouse database to find the total revenue for the 'enterprise' segment. First, I'll identify the correct cube and metric names.

    1. Discovery: I used list_tables on sales_warehouse to find the revenue_cube.

    Inspection: I called describe_table for revenue_cube which confirmed the total_revenue metric and the segment dimension.
    3. Refinement: I used sample_column to verify that 'enterprise' is a valid value for the segment dimension.

    Revenue Report: Enterprise Segment

    DatabaseCubeMetricSegmentTotal Revenue
    sales_warehouserevenue_cubetotal_revenueenterprise$1,240,500.00

    Semantic SQL Executed:

    SELECT total_revenue
    FROM revenue_cube
    WHERE segment = 'enterprise'
    AND time_period = 'Q3-2023'
    

    Next steps

    • To see a breakdown by month, ask for "revenue by month for the enterprise segment."
    • If you need to compare this to the 'smb' segment, I can run a comparative query.
    • Use sample_column if you want to see other available segments in this warehouse.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Raw SQL queries against complex data warehouses often lead to hallucinated joins and schema confusion. This skill equips your agent to interface with the sql-mcp semantic layer, ensuring it queries business metrics, dimensions, and cubes instead of guessing physical table relationships.

    What it does

    • Semantic Querying translates business questions into valid semantic SQL using cubes, metrics, and segments.
    • Model Discovery explores available data models via metadata tools before attempting to execute queries.
    • Guided Installation provides step-by-step instructions for connecting the sql-mcp server to Cursor or Claude Code when tools are missing.
    • Safe Execution enforces read-only access and prevents dangerous physical SQL injections or SELECT * calls.
    • Credential Hygiene ensures connection strings and passwords remain in environment variables rather than chat history.

    How it works

    1. Tool Verification: The agent checks for the presence of the sql-mcp toolset; if missing, it initiates the installation workflow from the repository reference.
    2. Metadata Discovery: Uses list_tables and describe_table to map user requests to the existing semantic model.
    3. Data Inspection: Refines filters by searching columns or sampling specific members to ensure high-accuracy results.
    4. Semantic Execution: Runs execute_sql using only semantic syntax, then summarizes the results based on the retrieved rows.

    Frameworks & tools

    This skill requires the sql-mcp server and works with Postgres or SQLite backends. It is designed for use within MCP-compliant environments like Cursor and Claude Code.

    Why this beats prompting it yourself

    Standard prompts often fail when warehouse schemas are too large for the context window. This skill provides a structured discovery protocol that prevents the agent from guessing table names or writing broken joins, saving tokens and improving accuracy.

    Use cases

    • Querying monthly recurring revenue (MRR) metrics without knowing the underlying subscription table schema.
    • Installing the sql-mcp binary and configuring it for a local SQLite database.
    • Filtering warehouse data using predefined segments like "active_users" or "enterprise_tier".
    • Troubleshooting missing cubes or metadata registration errors in the semantic layer.

    Known limitations

    Does not support DDL or write operations. Requires the sql-mcp server to be installed and running locally or in a container. SQL queries are limited to semantic syntax.

    Supports read-only semantic SELECT only. No DDL or write access. Requires external sql-mcp server installation. Does not support physical SELECT * calls.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 15 days ago

    • Free with an Agensi account

    Requires

    Sql MCP

    Permissions

    Read Files
    Network Access

    Read-only guide. Network is only for the public GitHub install page. The skill does not read or repeat warehouse passwords or DSNs. sql-mcp runs semantic SELECT only.

    Listed15 days ago

    What's inside

    Frequently Asked Questions

    This skill allows your AI agent to query data using business terms (metrics and cubes) rather than raw table names, preventing the common problem of hallucinated joins and broken SQL in large data warehouses.

    This skill is built for Model Context Protocol (MCP) environments and is fully compatible with Cursor and Claude Code using Postgres or SQLite backends.

    The skill includes a guided installation workflow that helps you set up the sql-mcp server, configure environment variables for security, and connect it to your local or containerized database.

    By using a structured discovery protocol to fetch metadata only when needed, this skill keeps your context window clear of massive schema definitions, saving tokens and improving performance.

    No, this skill is designed strictly for safe, read-only data retrieval and does not support DDL (Data Definition Language) or write operations like INSERT or DELETE.

    You receive the specialized agent instructions for the sql-mcp workflow, access to the semantic query protocol, and the guided setup routines for the underlying server.

    New in Data & Databases