Postgres MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Postgres MCP Servershow me the columns in the users table"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Postgres MCP Server
A Model Context Protocol (MCP) server that exposes Postgres database information to VS Code agents and other MCP-compatible clients.
Features
List available databases
List schemas in a database
List tables in a schema
Get table schema (columns)
Execute read-only SQL queries
Setup
Create a virtual environment and install dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txtConfigure your Postgres connection in
.env:DB_HOST=localhost DB_PORT=5432 DB_NAME=postgres DB_USER=postgres DB_PASSWORD=your_passwordRun the server:
source venv/bin/activate python server.py
Usage with VS Code
Add to your .vscode/mcp.json:
{
"servers": {
"postgres-mcp": {
"type": "stdio",
"command": "venv/bin/python",
"args": ["server.py"]
}
}
}Tools
list_databases: Lists all databaseslist_schemas: Lists schemas in a databaselist_tables: Lists tables in a schemaget_table_schema: Gets column details for a tableexecute_query: Runs SELECT queries (read-only)
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/eddykuhan/postgres-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server