postgress -claude
Interactive SQL learning playground powered by MCP + PostgreSQL + Claude
claude mcp add --transport stdio kaustubhgupta-postgress-mcp-server-claude python -m kaustubhgupta_postgress_mcp_server_claude \ --env POSTGRES_URI="postgresql://USER:PASSWORD@HOST:PORT/DATABASE" \ --env CLAUDE_API_KEY="your-claude-api-key" \ --env CLAUDE_API_BASE="https://api.anthropic.com"
How to use
This MCP server provides an interactive SQL learning playground that integrates Claude with a PostgreSQL backend. Users can be added to the PostgreSQL database, and admin privileges can be granted to perform database operations. Claude is used to generate scenario-specific datasets on demand, which are then inserted into PostgreSQL. Learners can then run SQL queries through Claude, receiving results fetched directly from PostgreSQL, enabling an interactive, scenario-driven practice environment. To use, start the MCP server with the specified command, ensure PostgreSQL is accessible, and provide your Claude API key. Through the available capabilities, you can create users, assign admin rights, trigger Claude-driven dataset generation, and execute queries inside Claude with results sourced from PostgreSQL.
How to install
Prerequisites:
- Python 3.8+ (preferably via a virtual environment)
- PostgreSQL instance accessible by the server
- Claude API access (API key)
Installation steps:
-
Clone the repository: git clone https://github.com/kaustubhgupta-postgress-mcp-server-claude.git cd kaustubhgupta-postgress-mcp-server-claude
-
Create and activate a virtual environment: python -m venv venv
On macOS/Linux
source venv/bin/activate
On Windows
venv\Scripts\activate.bat
-
Install dependencies: pip install -r requirements.txt
-
Configure environment variables (see below) and run the server: export POSTGRES_URI=postgresql://USER:PASSWORD@HOST:PORT/DATABASE export CLAUDE_API_KEY=your-claude-api-key export CLAUDE_API_BASE=https://api.anthropic.com python -m kaustubhgupta_postgress_mcp_server_claude
Notes:
- If running behind a firewall or proxy, ensure outbound access to Claude API endpoints is allowed.
- Adjust PostgreSQL connection settings in POSTGRES_URI to match your environment.
- You can also containerize the app with Docker if preferred (see additional notes for guidance).
Additional notes
Tips and common issues:
- Ensure CLAUDE_API_KEY is active and has the required permissions for dataset generation.
- The PostgreSQL user specified in POSTGRES_URI must have privileges to create/drop tables and insert data for dataset generation.
- If you encounter connection errors, verify network access to PostgreSQL and Claude API endpoints.
- For production use, consider securing environment variables and using a secrets manager.
- If using Docker, you can map POSTGRES_URI and CLAUDE_API_KEY as environment variables at run time and ensure the container can reach both PostgreSQL and Claude endpoints.
Related MCP Servers
mcp-pinecone
Model Context Protocol server to allow for reading and writing from Pinecone. Rudimentary RAG
mcp-python-interpreter
MCP Python Interpreter: run python code. Python-mcp-server, mcp-python-server, Code Executor
pfsense
pfSense MCP Server enables security administrators to manage their pfSense firewalls using natural language through AI assistants like Claude Desktop. Simply ask "Show me blocked IPs" or "Run a PCI compliance check" instead of navigating complex interfaces. Supports REST/XML-RPC/SSH connections, and includes built-in complian
knowledgegraph
MCP server for enabling persistent knowledge storage for Claude through a knowledge graph with multiple storage backends and fuzzy search
mcp-images
## MCP-Images Looking for a powerful image processing server? MCP Server-Image provides enterprise-grade image handling with just a few lines of code. Perfect for AI applications, web services, and data processing pipelines. [Get Started](#installation) | [Support Us](https://www.buymeacoffee.com/blazzmocompany)
google-search-console
It connects directly to your Google Search Console account via the official API, letting you access key data right from AI tools like Claude Desktop or OpenAI Agents SDK and others .