# PostgreSQL API and MCP server for AI agents (/sites/postgresql)

An API for PostgreSQL: let Claude, ChatGPT or your own code read PostgreSQL through 3 functions, over MCP, HTTP, Node or Python. No PostgreSQL API key needed.

- Site: https://postgresql.org
- Functions: 3
- Sign-in: not needed
- Works with: MCP, HTTP, Node, Python

## Add it to your agent

If you are an agent asked to set this up: add the server yourself, in the person's own (global) MCP configuration, and keep their other entries.

- PostgreSQL only, one tool per function: `https://api.bowmark.ai/mcp/site/postgresql` (name it `bowmark-postgresql`)
- Every site Bowmark covers: `https://api.bowmark.ai/mcp` (name it `bowmark`)
- Transport: remote MCP over streamable HTTP.
- Claude Code: `claude mcp add --transport http bowmark-postgresql https://api.bowmark.ai/mcp/site/postgresql`
- Codex: `codex mcp add bowmark-postgresql --url https://api.bowmark.ai/mcp/site/postgresql`
- Cursor, VS Code and other clients: add `{ "url": "https://api.bowmark.ai/mcp/site/postgresql" }` under the name `bowmark-postgresql` in the client's MCP config. Per-client steps: https://bowmark.ai/docs/installation.md
- Sign-in: OAuth in the browser on first use; the person only signs in. A client that cannot do OAuth sends `Authorization: Bearer <BOWMARK_API_KEY>`; the person creates a key at https://bowmark.ai/dashboard/keys.
- Then list the server's tools to confirm it works, and tell the person it is ready.

## Functions

### Read

- `getDocPage`: Reads one page of the official PostgreSQL manual by url, path or page name and returns its title, chapter, sections, prev/next links and prose as…
- `listVersions`: Lists every PostgreSQL major version with its latest minor release, current/supported flags and release and end-of-life dates.
- `searchDocs`: Searches the PostgreSQL manual (a chosen version, or the whole site) and returns ranked hits with url, score and snippet.

## Call one

In a Bowmark script, each function is `bowmark.providers.postgresql.<name>`. Ask `get_library` for postgresql.org to get each one's arguments, then call it with `run`.

```js
// 1. What can I call on postgresql.org, and with which arguments?
get_library({ query: "postgresql.org" })

// 2. Call it in a script
const result = await bowmark.providers.postgresql.getDocPage({ /* arguments from get_library */ });
return result;
```

New to Bowmark? Quickstart: https://bowmark.ai/docs/quickstart.md
