---
title: "Connect Your AI Agent to Postgres via MCP"
description: "Connect Cursor, Claude Code, VS Code, Windsurf, and more to Postgres in one command with Tiger MCP. Step-by-step setup and safety tips included."
section: "Postgres guides"
published: 2026-09-17T14:18:05.896Z
updated: 2026-09-17T00:00:00.000Z
---

*Updated at Sep 17, 2026*

> **TimescaleDB is now Tiger Data.**

## How to connect your AI coding agent to Postgres

[<u>Connecting a supported AI coding agent to a Tiger Cloud Postgres database</u>](https://www.tigerdata.com/docs/get-started/quickstart/mcp-cli) takes one command: `tiger mcp install <client>`. This article is a guide for our own MCP Server, The Tiger Data MCP Server, and it covers connecting to Tiger Cloud specifically.

To start, [<u>install the Tiger Data MCP Server</u>](https://www.tigerdata.com/docs/get-started/quickstart/tiger-cli), run the command, and restart your agent. From there, it can query your schema, inspect your data, and act on your database in plain language. No JSON block to copy in, no connection string to paste.

Setting up any MCP server usually means putting a config entry in the right file yourself: copying a JSON block from the docs, finding your client’s config path, and filling in a connection string. `tiger mcp install <client>` finds the config file and writes the entry for you, and because Tiger MCP authenticates through Tiger CLI, there’s no connection string to supply at all. 

[<u>The Tiger Data MCP (Model Context Protocol) Server</u>](https://www.tigerdata.com/docs/learn/tiger-cli-mcp) auto-configures eight clients today: Claude Code, Cursor, Windsurf, Codex, Gemini CLI, VS Code, Antigravity, and Kiro CLI; but it also includes the ability to configure to any MCP-compatible client through a manual configuration process. Whatever your use case is for an AI coding agent, the setup is identical: one command per client. That’s part of how Tiger Data is designed for the [<u>Agentic Postgres</u>](https://www.tigerdata.com/blog/postgres-for-agents) era.

## Before you start

Before running any install command, you need three things:

- **Tiger CLI installed and authenticated.** Tiger MCP ships inside the [<u>Tiger CLI</u>](https://www.tigerdata.com/docs/get-started/quickstart/tiger-cli), so installing the CLI gets you both. Run `tiger auth login` to connect it to your Tiger Cloud account.
- **An active Tiger Cloud service**, including the free tier, for the agent to query. If you don’t have one yet, you can create it through the agent once you’re connected.
- **One of the supported AI coding tools already installed, **with an active API key. 

Not sure which client name to pass? Run `tiger mcp install` with no arguments and the CLI prompts you with the list. 

Two flags are worth knowing before you start:

- `--no-backup` skips backing up the client's existing config before writing to it.
- -`-config-path` points the install command at a specific config file location, useful if your setup doesn't live in the default place.

If your tool isn't one of the eight, you're not stuck. Skip ahead to [<u>connecting a client that isn't on this list</u>](https://docs.google.com/document/d/180j1fotxIlkE4PTDTL_sDwNGCbzcppr-ipDmNAiYBjc/edit#connecting-a-client-that-isnt-on-this-list) for the manual path.

## Connect Cursor to Tiger Cloud

From Cursor’s built in terminal, run: 

`tiger mcp install cursor`

The CLI confirms that the MCP server is installed:

`Successfully installed Tiger MCP server configuration for cursor

  Configuration file: ~/.cursor/mcp.json

  Next steps:
     1. Restart cursor to load the new configuration
     2. The Tiger MCP server will be available as 'tiger'`

Restart Cursor, then confirm the connection in **Cursor Settings → MCP, **where `tiger` should appear in the server list as connected. 





## Connect Claude Code to Tiger Cloud

From the command line, run:

`tiger mcp install claude-code`

Restart Claude Code, then run /mcp to list connected servers. `tiger` should appear with its tools available. 



## Connect VS Code to Tiger Cloud

From the integrated terminal. run:

`tiger mcp install vscode`

VS Code manages MCP servers through its own settings UI, reachable from the Command Palette. Reload VS Code, open that panel, and confirm the tiger entry appears.

## Connect Devin to Tiger Cloud

From the integrated terminal or the Devin CLI run:

`tiger mcp install devin`

Restart Devin, then open Devin’s settings, locate where the MCP servers are listed (after extensions)and confirm `tiger` is listed as connected. If it isn’t showing, refresh the server list; some clients need a nudge before they pick up a newly written configuration. 



## Also supported: Codex, Gemini CLI, Antigravity, and Kiro CLI

Tiger MCP auto-configures four more clients the same way. Run the command, restart the client, and confirm the server appears in that client’s MCP list.

| **Client** | **Install command** | **Notes** |
| --- | --- | --- |
| Codex | `tiger mcp install codex` | Auto-configured identically to the clients above. |
| Gemini CLI | `tiger mcp install gemini` | Auto-configured identically to the clients above. |
| Antigravity | `tiger mcp install antigravity` | Auto-configured identically to the clients above. |
| Kiro CLI | `tiger mcp install kiro-cli` | Auto-configured identically to the clients above. |

## Connecting a client that isn't on this list

If your AI coding tool supports MCP but isn't one of the eight above, tools like Cline, Claude Desktop, Zed, or Continue.dev included, you can still connect it manually.

Most clients use a JSON config that starts the server with `tiger mcp start`. Add this entry to your client’s MCP configuration file:

`{
  "mcpServers": {
    "tiger": {
      "command": "tiger",
      "args": ["mcp", "start"]
    }
  }
}`

Because Tiger MCP authenticates through Tiger CLI, there's no connection string to paste into this block; run `tiger auth login` first and the server picks up your credentials.

Config key names and file locations vary by client. Some use `mcpServers`, others use a different top-level key or a different file entirely, so check your client's MCP documentation for the exact format and the[ <u>Tiger MCP reference</u>](https://www.tigerdata.com/docs/reference/tiger-cloud/tiger-mcp) for the full list of tools and commands.

This manual path also works as a fallback for any of the eight supported clients, if you'd rather write the config entry yourself than let the CLI modify it.

## Verify your agent can actually reach your database

Regardless of which client you used, the same test works everywhere: ask your agent to list your tables or describe your schema in plain language.

A working connection returns real table and column names from your Tiger Cloud service. If the agent says it has no database access, or the Tiger MCP server doesn't show up in the client's tool list at all, something didn't connect.

A few things to try, in order:

1. Ensure that you’ve authenticated the server by running ``tiger auth`` from the command line
2. Restart the client completely, not just reload the window.
3. If you used `--config-path`, confirm the path you specified matches where your client actually expects its config file.

Once your agent can see your schema, [<u>see common tasks you can run once your agent is connected</u>](https://www.tigerdata.com/docs/build/tiger-cli-mcp/common-tasks), or [<u>copy ready-to-use prompt templates to put your agent to work</u>](https://www.tigerdata.com/blog/free-postgres-mcp-prompt-templates).

## Is it safe to connect an AI agent to your database this way?

MCP-layer security is a real, active concern in 2026. Other MCP servers have had publicly disclosed vulnerabilities, including SQL injection, unauthenticated schema access, and malicious instructions hidden inside a tool's own description text. That's a category of risk worth taking seriously with any MCP server you connect to a real database, not a Tiger MCP-specific problem.

Tiger MCP has a built in safety control for exploratory agent use, read-only mode. Turn it on before pointing an agent at a production database by running `tiger config set read_only true`, which refuses mutating commands, unregisters the matching Tiger MCP tools so an agent can't call them at all, and puts your database sessions into Tiger Cloud's immutable read-only mode.

That's the short version. For the full picture, read the [<u>agent best-practices guide</u>](https://www.tigerdata.com/docs/build/tiger-cli-mcp/agent-best-practices) and hear directly from [<u>three Tiger Data engineers on why MCP security is hard to get right</u>](https://www.tigerdata.com/blog/three-tigerdata-engineers-told-us-the-truth-about-mcp-security-is-its-achilles-heel). A dedicated deep dive on AI agent database safety is also on the way.

## Choosing how to connect

**Choose **`**tiger mcp install <client>**`** if:** you use Claude Code, Cursor, Windsurf, Codex, Gemini CLI, VS Code, Antigravity, or Kiro CLI. This covers most readers and needs no manual configuration.

**Choose manual configuration if:** your AI coding tool supports MCP but isn't one of the eight listed above.

**Turn on read-only mode first if:** you're connecting to a production database rather than a fork, branch, or dev and test service, regardless of which client you use.

## Migrating to Tiger MCP from another setup

However you're getting to this page, the migration is small.

**Coming from the deprecated reference server, or another open-source Postgres MCP server against a self-hosted database:** the config entry now points at Tiger Cloud instead, and `tiger mcp install` writes it for you. Your client's chat interface and prompts work exactly the same as before.

**Coming from a different Postgres MCP server you configured by hand:** the install command replaces that entry in your client's config. Your workflow with the agent stays the same.

**Starting from no MCP setup at all:** you're not behind. Follow the [<u>MCP and CLI quickstart</u>](https://www.tigerdata.com/docs/get-started/quickstart/mcp-cli) for the full setup path, including authentication and creating your first service, and use the per-client sections above once you're ready to connect an agent. Once you're connected, [<u>explore more Tiger CLI + MCP features worth knowing</u>](https://www.tigerdata.com/blog/five-features-tiger-cli-you-arent-using-but-should).