PostgreSQL MCP Server
Enables AI assistants to query and manage local PostgreSQL databases through SQL execution and schema exploration tools. It supports both read-only queries and write operations including table creation and data modification via natural language.
README
PostgreSQL MCP Server
An MCP (Model Context Protocol) server that connects to a local PostgreSQL database, enabling AI assistants to query and manage your database.
Tools Provided
| Tool | Description |
|---|---|
| query | Execute read-only SQL (SELECT, SHOW, EXPLAIN) |
| execute | Execute write SQL (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP) |
| list_tables | List all tables in a schema |
| describe_table | Show columns, types, keys, and indexes for a table |
| list_schemas | List all user schemas in the database |
Resources
- schema-overview (
postgres://schema/overview) — Full database schema overview in Markdown
Setup
1. Install dependencies
npm install
2. Configure your database connection
Edit the .env file with your PostgreSQL credentials:
PG_HOST=localhost
PG_PORT=5432
PG_USER=postgres
PG_PASSWORD=your_password_here
PG_DATABASE=your_database_name
3. Build
npm run build
4. Configure in VS Code (Copilot / Claude Desktop)
Add this to your MCP settings:
VS Code (.vscode/settings.json or User Settings):
{
"mcp": {
"servers": {
"postgres": {
"command": "node",
"args": ["c:\\Users\\Admin\\Desktop\\postgree mco\\dist\\index.js"],
"env": {
"PG_HOST": "localhost",
"PG_PORT": "5432",
"PG_USER": "postgres",
"PG_PASSWORD": "your_password",
"PG_DATABASE": "your_database"
}
}
}
}
}
Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"postgres": {
"command": "node",
"args": ["c:\\Users\\Admin\\Desktop\\postgree mco\\dist\\index.js"],
"env": {
"PG_HOST": "localhost",
"PG_PORT": "5432",
"PG_USER": "postgres",
"PG_PASSWORD": "your_password",
"PG_DATABASE": "your_database"
}
}
}
}
Usage Examples
Once configured, you can ask the AI assistant things like:
- "List all tables in my database"
- "Describe the users table"
- "SELECT * FROM orders WHERE created_at > '2025-01-01'"
- "Create a new table called products"
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.