MCP Setup Guide
How to Set Up PostgreSQL MCP with ClawdBot
Query local or remote Postgres for dashboards and reports.
Overview
- Category: Database
- Difficulty: Hard
- Best for: Query local or remote Postgres for dashboards and reports.
Quick Start
If your provider offers a hosted MCP endpoint, use a URL-based config:
Hosted MCP Config json
{
"postgresql": {
"url": "https://YOUR_POSTGRESQL_MCP_ENDPOINT"
}
} For local or self-hosted servers, use a CLI bridge and keep secrets in environment variables:
Local CLI Config json
{
"postgresql": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://YOUR_POSTGRESQL_MCP_ENDPOINT"],
"env": {
"POSTGRESQL_API_KEY": "YOUR_POSTGRESQL_API_KEY"
}
}
} Common Pitfalls
- Connection strings, SSL, schema discovery.
- Store credentials in environment variables, not in config files.
- Limit scopes to the minimum required for your workflows.
- Verify the MCP is running with
clawdbot statusbefore testing.
Example Prompts
- List tables in the database schema.
- Run a sample query to fetch the latest 5 records.
- Describe the columns in the users table.