oshaani MCP Marketplace
Sign in

← Documentation

PostgreSQL MCP Database

Explore schemas and run read-only SQL queries on your PostgreSQL databases.

1 credits / tool call

Quick start

  1. Add a PostgreSQL connection with the settings below, then click Test configuration.
  2. Create an API key for your agent.
  3. Paste the key below, click Test endpoint, and copy the configuration for your platform.
Endpointhttps://market.oshaani.com/postgres (your default connection) or https://market.oshaani.com/postgres/<connection-id>
TransportStreamable HTTP (stateless, JSON responses). MCP protocol versions 2024-11-05 to 2025-11-25 and 2026-07-28.
AuthenticationAuthorization: Bearer <API key>, using a key from the API keys page.

Agent configuration

The default URL uses your organisation's default PostgreSQL connection; a URL with an ID pins one connection.
Get a key
The key is filled into the snippets below. It stays in this page and is only sent with the test request.
Runs initialize and tools/list against the endpoint, exactly like an agent. No credits are charged.

Any MCP client that supports remote (Streamable HTTP) servers with custom headers.

{
  "name": "postgres",
  "transport": "streamable-http",
  "url": "https://market.oshaani.com/postgres",
  "headers": {
    "Authorization": "Bearer YOUR_API_KEY"
  }
}

Connection settings

Entered once per connection on market.oshaani.com. Secrets are encrypted and never shown again or sent to agents.

SettingTypeDescription
Host
host required
string Public hostname or IP address of the server
pattern ^[A-Za-z0-9.:-]+$
Port
port
integer
default 5432

min 1, max 65535
Database
database required
string
min length 1, max length 63
Username
username required
string Use a role that only has SELECT privileges
min length 1
Password
password required secret
string
TLS mode
sslmode
"require" | "verify-full" | "prefer" | "disable"
default "require"
verify-full also checks the server certificate against public CAs
Maximum rows per query
max_rows
integer
default 500

min 1, max 10000
Query timeout (seconds)
statement_timeout_seconds
integer
default 15

min 1, max 25

Tools (5)

list_schemas read-only

List schemas in the database

No arguments.

list_tables read-only

List tables and views in a schema with estimated row counts and sizes

ArgumentTypeDescription
schema_name string
default "public"

min length 1, max length 63

describe_table read-only

Describe a table: columns, types, defaults, primary key, indexes and foreign keys

ArgumentTypeDescription
table required string
min length 1, max length 63
schema_name string
default "public"

min length 1, max length 63

run_read_query read-only

Run a read-only SQL query and return the columns and rows

ArgumentTypeDescription
sql required string A single SELECT (or WITH ... SELECT) statement
min length 1, max length 50000
max_rows integer Defaults to the connection's limit
min 1, max 10000

explain_query read-only

Show the query plan PostgreSQL would use, without running the query

ArgumentTypeDescription
sql required string A single SELECT (or WITH ... SELECT) statement
min length 1, max length 50000

Billing & errors

Each successful tool call costs 1 oshaani.com credit. initialize, tools/list, failed calls and timeouts are free.

JSON-RPC codeMeaning
-32054 (HTTP 401)Missing, unknown or revoked API key
-32053 (HTTP 404)No PostgreSQL connection configured for your organisation, or the connection ID is wrong
-32055 (HTTP 403)Connection disabled or origin not allowed
-32052 (HTTP 429)Rate limit reached; retry after a minute
-32050Not enough oshaani.com credits for the call
-32051Billing temporarily unavailable; the call was not run

Errors from PostgreSQL itself (bad IDs, permissions) come back as tool results with isError: true so the agent can read and correct them. See the PostgreSQL API documentation.