Content
# PostgreSQL-MCP
PostgreSQL-MCP is a PostgreSQL database interface service based on the MCP framework, providing a simple and easy-to-use tool for PostgreSQL database operations.
## Installation
1. Clone this repository
2. Create a virtual environment and install dependencies
```bash
cd postgresql-mcp
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# or
.venv\Scripts\activate # Windows
pip install -e .
```
## Usage
Configure the database connection through environment variables or command line arguments:
```bash
# Through environment variables
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=postgres
export POSTGRES_DATABASE=postgres
# Start the service
python postgresql-mcp.py
```
Or use command line arguments:
```bash
python postgresql-mcp.py --host localhost --port 5432 --user postgres --password postgres --database postgres
```
## Main Features
- `execute_query`: Execute SQL queries
- `list_tables`: List all tables in the specified schema
- `describe_table`: Get table structure
- `list_schemas`: List all schemas in the database
## Notes
Ensure that the PostgreSQL server is running and accessible.
Connection Info
You Might Also Like
X Video Transcript
X / Twitter 视频文案提取 MCP Server — 专注解析 X 平台公开视频链接(x.com / twitter.com status...
firecrawl
Firecrawl MCP Server enables web scraping, crawling, and content extraction.
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
worldmonitor
Real-time global intelligence dashboard. AI-powered news aggregation,...
OmniRoute
Never stop coding. The free AI gateway — one endpoint, 160+ providers, zero...