Early Access We're currently in early access. Sign up and be the first to test new features and share your feedback with us!
how to query your database using natural language

How to Query Your Database Using Natural Language (In 5 Minutes)

By Pratik Budhathoki 10 minute

February 10, 2026

It's 5:45 PM on a Friday. You're shutting down your laptop, about to head out for the weekend. Your phone buzzes—it's the support team. "Quick question: Can you check if customer john@example.com's payment went through?" You reopen your laptop. Switch to the terminal. Remember the table schema. Write the query. Run it. Format the results. Paste them back. Ten minutes later, another message: "Actually, can you check their last five orders too?" This happens 15-20 times a day. You're not doing engineering work—you're a human SQL translator.

The Problem

Every time someone needs data from your database, they have three options: learn SQL (which takes weeks), consult an engineer (which interrupts deep work), or operate without any insights (forcing them to make decisions blindly).

Your team has questions. Your database has the answers. But the technical gap between them creates a costly delay in decision-making.


The Solution

Give Claude direct access to your PostgreSQL database. Your team asks questions in plain English. Claude queries the database and returns answers—no SQL required.

Example interactions:

  • Support: "Show me customer john@example.com's order history."

  • Product Manager: "How many active subscriptions do we have?"

  • DevOps: "Show me failed API requests in the last hour."

No context switching. No waiting for someone who knows SQL. Just ask and get answers.


How to Set It Up (In 5 Minutes, No Coding)

In this article, we will connect PostgreSQL with Claude. Upon completion, you will be able to query our database using natural language.

Prerequisites

Before proceeding, here’s what you need to query your database using natural language:

Step 1: Create Your MCP Server

  1. Go to MCP ServersNew MCP Server

    new

  2. Name it based on your use case (e.g., "Production-DB")

    create

  3. Click Create MCP Server

Step 2: Connect Your Database

  1. Select PostgreSQL from the tools

    choose

  2. Choose Quick Connect for easy configuration and paste your connection string

    quick

  3. Configure queries: Select which operations (Get, List, Insert, Update, Delete) Claude can use in each table, along with the table's columns

Optional - Custom SQL: Add advanced queries for complex needs like multi-table JOINs. If you want Claude to generate SQL dynamically based on your prompts, add {{query}} inside Custom SQL. However, this is not recommended as it may allow Claude to execute harmful queries like `DROP TABLE` or unintended deletions.

configuring

  1. Add tool name and description (helps Claude decide when to use this tool)

Step 3: Connect to Claude Desktop

  1. Go to ClientsAdd New Client

adding

2. Name your client, select Claude Desktop, and choose your MCP server

connecting

3. Click the () in Actions → Setup Instructions

setting

4. Download the config snippet and add it to your claude_desktop_config.json

The snippet looks like this:

{

"mcpServers": {

"Your Client Name": {

"command": "node",

"args": ["<path_to_mcp-express-cli.js>"],

"env": {

"CLIENT_ID": "your-client-id",

"CLIENT_SECRET": "your-client-secret"

}

}

}

}

editing

Finding the config file: Open Claude Desktop → FilesSettingsDeveloperEdit Config

Step 4: Start Querying

Open Claude Desktop. Your MCP server will appear in FilesSettingsDeveloper.

checking

You can now ask questions in plain English. Claude will look up relevant information from your database to provide you with proper answers and insights.

Claude

Security First

MCP Express uses structured operations with guardrails. You control exactly what Claude can access:

  1. Select specific tables - Choose only what your team needs (customers, orders) along with specific columns, not sensitive tables or values like admin_credentials or password.

  2. Set permissions - Read-only for investigation, or read-write if teams need to update data.

  3. Define allowed operations - Get, List, Insert, Update, Delete. You choose which ones Claude can use.

  4. Add custom SQL (optional) - For complex queries like "abandoned carts in last 24 hours" that require JOINs.

What Claude CANNOT do:

  • DROP TABLE users (unless you give permission) ❌

  • Access tables you didn't expose ❌

  • Write its own SQL commands (until permitted) ❌


Real-World Example of the Initial Situation

Before MCP Express:

Your support team Slacks you: "Can you check if customer john@example.com's payment went through?" You need to investigate:

1. Pause your current work

2. Switch to your terminal

3. Remember the table schema

4. Write the query to check payments table

5. Format the results

6. Paste back into Slack

7. Wait for follow-up questions

Total time: 10-15 minutes per request. Multiply by 15-20 requests per day.

After MCP Express:

Your support team Slacks you: "Can you check if customer john@example.com's payment went through?"

You tell them: "Just ask Claude directly." Support opens Claude Desktop:

- Support: "Did payment go through for john@example.com?"

- Claude: Queries payments table - "Recent payments:

  • Payment ID 1 (Order #1): $149.99

Completed ✓ (credit card, processed Feb 8)

  • Payment ID 2 (Order #2): $89.50

Completed ✓ (PayPal, processed Feb 9)

  • Payment ID 3 (Order #3): $299.00

Pending ⏳ (credit card, created Feb 10)"

Here's how Claude works with MCP Express:

Query

Total time: 30 seconds. Zero engineer interruptions.

Configuration for This Setup

Tables exposed:

- customers (read-only)

- orders (read-only)

- payments (read-only)

Operations allowed: Get, List only (read-only access for support team)

Engineers reclaim 3-4 hours per day. Support gets instant answers. Everyone wins.


Who This Helps

  • Support teams - Look up customer data without waiting for engineers

  • Product managers - Check metrics without learning SQL

  • Developers - Quick schema exploration: "What tables store X?"

  • DevOps - Investigate production issues at 3 AM without remembering the exact syntax

  • Freelancers - Query client databases without learning their schema, deliver insights faster


Start Reclaiming Your Time Today!

Give your team the power of natural language queries and get back to the engineering work you love.

Share

On this page

    Ready to Connect AI to
    Your Infrastructure?

    Set up an MCP server in minutes and give your AI secure, controlled access to your existing tools—no code, no credit card required.

    Try for free