Skip to main content

qbash / Postgres MCP server

Use Postgres in Claude, Cursor or ChatGPT, with nothing to install.

Connect a read-only Postgres login to qbash and get a hosted MCP server. Add its URL to Claude, Cursor, Claude Code or ChatGPT, sign in, and ask about your data. There is no npx, Docker or config file to keep up to date.

Your password is stored encrypted on qbash, not on each laptop. Queries run with the login's own rights, and you choose which tools the assistant can call.

What the assistant gets

Four tools cover schema lookup and queries.

The PostgreSQL connector adds these tools to an MCP server. Turn off any the assistant does not need. A server for analysts might keep all four, and a server for a support team might expose a single saved query instead.

Tools the PostgreSQL connector adds to an MCP server
ToolWhat it does
postgres_list_schemasLists the user schemas in the database
postgres_list_tablesLists tables, views and foreign tables in a schema
postgres_describe_tableShows columns, types, keys, constraints and indexes for a table
postgres_execute_queryRuns a SQL query with the rights of the connected login

Where it runs

Skip the install. qbash runs the Postgres MCP server.

An open-source Postgres MCP server runs wherever you install it. Each person sets it up, keeps it updated and puts a connection string in their client's config. On qbash the server is already running, and the password stays in one place.

A self-hosted Postgres MCP server compared with qbash
ConcernSelf-hosted Postgres MCP serverqbash
Where it runsOn each person's laptop, or on a server you deployHosted on qbash
Database credentialsIn each person's client configurationStored once in qbash, encrypted
Who can connectAnyone with the configuration and the passwordPeople you share the server with, signed in through OAuth
Removing accessChange the database password for everyoneRemove one person's share, or make the server private
Custom logicFork and maintain the serverAdd a Task with your own query and checks

Set it up

Connect the database, build the server, then add it to your client.

  1. Create a database login with read-only access to the schemas the assistant should see.
  2. In qbash, connect PostgreSQL with that login.
  3. Open MCP Servers, select New server and add the PostgreSQL connector block. Turn off any tools you do not want to expose.
  4. Share the server with the people who should use it, then copy the server URL from Connect.
  5. Add the URL as a custom connector in Claude, as an app in ChatGPT with developer mode turned on, or as a remote MCP server in Cursor or Claude Code. Then sign in with qbash. Developer mode in ChatGPT depends on your plan and workspace settings.

Queries run with the rights of the connected login. A read-only login keeps every query to reads, whatever the assistant asks for.

Your own rules

Wrap a query in a Task when the assistant should follow a fixed path.

A Task is a Python function saved on qbash. This one runs a single approved query for paid orders that have not shipped, and the assistant supplies only the number of days. Add the Task to the same MCP server and the assistant calls it like any other tool.

Task code
orders-waiting-to-ship.py
days = qbash.inputs.get("days")
if days is None:
    days = 2
if not isinstance(days, int) or isinstance(days, bool) or not 1 <= days <= 90:
    raise ValueError("Provide a whole number of days from 1 to 90.")

rows = qbash.integrations.postgres.execute_query(
    query=(
        "SELECT order_id, created_at FROM orders "
        "WHERE status = 'paid' AND shipped_at IS NULL "
        "AND created_at < now() - make_interval(days => $1) "
        "ORDER BY created_at LIMIT 100"
    ),
    query_params=[days],
    read_only=True,
)["result"]

qbash.output({
    "waiting_orders": rows,
    "oldest_order": rows[0]["order_id"] if rows else None,
})

Declare days as an optional Number input and name the Task Orders Waiting To Ship. Replace the orders table and its columns with your own schema, and check that created_at is stored in UTC.

Before you build

Questions

Can the assistant change data?

Only if the connected login has write access. Postgres rejects writes from a read-only login.

Does this work with Supabase, Neon or Amazon RDS?

Yes. They run PostgreSQL, so connect with the database host and a login. Supabase also has its own connector in qbash.

Which clients can connect?

Any client that supports remote MCP servers, including claude.ai, Claude Code, ChatGPT, Cursor and VS Code. Use OAuth sign-in where the client supports it.

Can I expose some tools and hide others?

Yes. Turn off connector tools you do not want the assistant to call, rename them, or replace them with Tasks that run fixed queries.

Is there a free plan?

Yes. The Free plan includes 100 executions a month and 3 Tasks, with no credit card.