Skip to main content
PostgreSQL is a powerful, open-source object-relational database system. By connecting it to Nekt, your AI agent can query your live database, analyze results, and safely execute schema or data changes directly from chat.

Adding PostgreSQL as an MCP

Before you start, make sure the MCP Server is set up. See MCPs for how MCPs work.
  1. Go to Activate → MCPs, click New MCP and choose PostgreSQL.
  2. Name your MCP and describe what it is used for. The agent reads the description to choose between MCPs of the same provider.
  3. Setup access. Provide your connection credentials to allow the agent to connect to your database.
    • Host (Required): The host address of your Postgres database.
    • Port (Required): The port used for connecting to your Postgres database. The default port for Postgres is 5432, but your port might be different.
    • Database (Required): The name of a database in your Postgres account.
    • User (Required): The user name for accessing your Postgres database. Read-only tools are always run inside a READ ONLY transaction, so a user with write access is only able to write through the write tool.
    • Password (Required): The password used for accessing your Postgres database.
    • Enable SSL: Whether or not to use SSL to verify the server’s identity.
    • SSL Mode: SSL protection method.
    • SSH Tunnel: SSH Tunnel to be used in your database connection
  4. Select tools. Pick the tools your agents can use. See Available tools below.
  5. Click Save. On Growth and Custom plans, choose who can use it; see Access levels.

Example prompts

  • “Count the number of new user signups we had in our database over the last 30 days.”
  • “Update the status of order #84920 to ‘shipped’ in the orders table.”
  • “Create a new table called ‘marketing_campaigns’ with columns for id, name, budget, and start date.”
  • “Show me the top 5 most expensive products currently in our inventory.”

Available tools

Choose which of these tools your agents can use in Select tools.

Read tools

Write tools

Troubleshooting

If your database password changes or your user access is revoked, the MCP will show that it needs to reconnect. You can update your credentials and reconnect directly from the MCP’s page. If the agent fails to read or write data, verify that the configured PostgreSQL User has the necessary permissions (such as SELECT, INSERT, UPDATE, or DELETE) for the specific tables the agent is trying to access.

Need help?

Contact our support team if you have trouble connecting PostgreSQL.