# ainative-postgres MCP server

> Provides an auto-provisioned PostgreSQL database with pgvector support for AI agents to execute queries and manage schemas.

- Repository: https://github.com/AINative-Studio/ainative-postgres-mcp
- Page: https://hostedmcp.org/servers/ainative-studio/ainative-postgres-mcp
- Transport: stdio
- Stars: 0
- License: MIT
- Latest version: 1.0.1

## Install

### Claude Code

```sh
claude mcp add ainative-postgres-mcp -- npx -y ainative-postgres-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "ainative-postgres-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ainative-postgres-mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "ainative-postgres-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "ainative-postgres-mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"ainative-postgres-mcp","type":"stdio","command":"npx","args":["-y","ainative-postgres-mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "ainative-postgres-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ainative-postgres-mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add ainative-postgres-mcp -- npx -y ainative-postgres-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.ainative-postgres-mcp]
command = "npx"
args = ["-y", "ainative-postgres-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user ainative-postgres-mcp npx -- -y ainative-postgres-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "ainative-postgres-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ainative-postgres-mcp"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `DATABASE_URL` | no | no |  |

## Tools (5)

- `query`
- `list_tables`
- `describe_table`
- `create_table`
- `insert`

## FAQ

### Do I need to provide my own database connection string?

No, the server can auto-provision a managed PostgreSQL instance with pgvector on its first run if no DATABASE_URL is provided.

### Does it support vector search?

Yes, pgvector is automatically enabled on provisioned instances, allowing for vector columns and similarity searches.
