P

Postgres MCP

Query Postgres with schema-aware natural language

Anthropic·No reviews yet
Repo
Share:

About

Query and manage PostgreSQL databases through natural language. Runs read-only or read-write SQL against your database, inspects schemas, lists tables and columns, and returns results as structured data. Ideal for exploration, ad-hoc analytics, and letting the assistant understand your data model before writing application code.

Example tools

Illustrative tool names — the actual tool set is defined by the server at runtime.

query
Run a read-only SQL query
list_tables
List tables in the connected database
describe_table
Return column info for a table

Screenshots

No screenshots yet.

Frequently Asked Questions

Common questions about Postgres MCP.

What does the Postgres MCP do?
The Postgres MCP enables natural language interaction with PostgreSQL databases. It can execute read-only or read-write SQL queries, inspect database schemas, and return structured results. It is designed for data exploration, ad-hoc analysis, and understanding data models without writing code.
How do I install the Postgres MCP on a client?
Installation typically involves cloning the repository and running setup commands, specific to your MCP client. For example, using 'cline', you might run 'cline install postgres' if the server is available via a public registry, or point to the local server directory.
Does the Postgres MCP require any specific credentials?
Yes, it requires 'bearer' authentication, meaning you will need to provide a bearer token. Additionally, you will need credentials to connect to your PostgreSQL database.
What key capabilities does the Postgres MCP offer?
It offers the ability to query, inspect, and manage PostgreSQL databases using natural language. This includes running read-only or read-write SQL, examining schemas, listing tables and columns, and retrieving structured data.
Can I use the Postgres MCP for both read-only and read-write operations?
Yes, the Postgres MCP supports both read-only and read-write SQL operations against your database. You can configure its permissions based on your use case.
What is a prerequisite for using the Postgres MCP?
A key prerequisite for using the Postgres MCP is a running PostgreSQL database that the MCP can access. Proper network connectivity and valid database credentials are essential.

Install Postgres MCP

Claude Desktop

Add this to claude_desktop_config.json.

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres"
      ]
    }
  }
}

Cursor

Add this to ~/.cursor/mcp.json.

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres"
      ]
    }
  }
}

VS Code

Add this to your workspace settings.json.

{
  "mcp.servers": {
    "postgres": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres"
      ]
    }
  }
}

Reviews

Sign in to leave a review.

No reviews yet. Be the first!

Discussion(0)

Sign in to join the discussion.

No comments yet.