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
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.