Claude Desktop Configuration
Add this to your Claude Desktop configuration file:
{
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres"
],
"env": {
"DATABASE_URL": "postgresql://user:password@localhost:5432/dbname"
}
}
}
Requirements
- PostgreSQL database (9.6 or higher)
- Database connection credentials
- Network access to database server
Setup Steps
- 1Ensure PostgreSQL is running and accessible
- 2Create a database user with appropriate permissions
- 3Install the server: npm install -g @modelcontextprotocol/server-postgres
- 4Configure with your database connection string
Query data
Analyzing and retrieving database records
Prompt:
Show me all users created in the last 30 days
Expected Output:
Table of users with creation dates
Schema inspection
Understanding database schema
Prompt:
Describe the structure of the orders table
Expected Output:
Column names, types, and constraints
Detailed Metrics
Popularity
Stars52,462
Forks6,000
Watchers52,462
Quality
Documentation✓ Good
LicenseMIT License
LanguagePython
Maintenance
Last CommitToday
Open Issues526
Contributors1
Repository
Size3.7 MB
CreatedNov 2024
Live data • Updated 3:49:39 AM
Quality Factors
Documentation
✓ Has READMERepository has a README with description
License
✓ MIT LicenseOpen source license for legal clarity
Test Coverage
Coming SoonAutomated tests ensure reliability
TypeScript
Coming SoonType safety for better developer experience
NPM Downloads
Coming SoonWeekly download statistics from NPM
Security Scan
Coming SoonVulnerability detection and alerts