Skip to main content
View rawEdit

How to install MCP for AI coding tools

MCP (Model Context Protocol) allows AI coding tools to interact with PostgresAI services. This guide shows how to install MCP integration for supported tools.

Supported tools​

  • Cursor
  • Claude Code
  • Windsurf
  • Codex

Prerequisites​

  1. Authenticated with PostgresAI (see below)

Authenticate​

postgresai auth

Install MCP​

Run the following command to install MCP for your AI coding tool:

postgresai mcp install

Without arguments, mcp install prints a numbered menu and asks you to pick a tool:

Available AI coding tools:
1. Cursor
2. Claude Code
3. Windsurf
4. Codex
Select your AI coding tool (1-4):

To skip the prompt, pass the client name as an argument: postgresai mcp install <client>, where <client> is one of cursor, claude-code, windsurf, or codex.

note

mcp install pins the absolute path of the pgai binary it was invoked from into the client config. If you ran the command via npx or bunx, the pinned path points into a per-version package cache that may be garbage-collected. For a stable install, prefer npm install -g postgresai (or brew install postgresai) before running mcp install, or re-run mcp install after each CLI upgrade.

Verify installation​

After installation, restart your AI coding tool. The PostgresAI MCP server exposes the following tools (see the mcp section of the CLI reference for full details):

  • list_issues, view_issue, create_issue, update_issue — browse and manage issues in the PostgresAI Console.
  • post_issue_comment, update_issue_comment — comment on issues.
  • upload_file, download_file — upload local files to PostgresAI storage and download them back.

To check the install landed, inspect the client config file. For Cursor:

cat ~/.cursor/mcp.json

You should see a postgresai entry under mcpServers with command pointing at the pgai binary and args: ["mcp", "start"].

Manual configuration​

If you prefer to wire up MCP by hand, edit the client config and add a postgresai entry under mcpServers. See the mcp install section of the CLI reference for the exact JSON shape.

Next steps​