Database · MODEL CONTEXT PROTOCOL

NetanelBollag simple psql mcp

A beginner-friendly MCP server template featuring a PostgreSQL connector with clean, easy-to-understand code. Perfect for developers new to Model Context Protocol who want to experiment and create their own AI tool connectors with minimal setup.

WHAT IT CONNECTS

What NetanelBollag simple psql mcp gives an AI Agent

  • **Tools**
  • `execute_query` - Run SQL queries against your database
  • `test_connection` - Verify the database connection is working
  • **Resources**
  • `db://tables` - List of all tables in the schema
  • `db://tables/{table_name}` - Schema information for a specific table
  • `db://schema` - Complete schema information for all tables in the database
  • **Prompts**
  • Query generation templates
  • Analytical query builders
  • Based on the templates in this repo
  • Python 3.8+
  • [uv](https://github.com/astral-sh/uv) - Modern Python package manager and installer
  • npx (included with Node.js)
  • PostgreSQL database you can connect to
  • **Create a virtual environment and install dependencies:**
  • **Run the server with the MCP Inspector:**
  • **Using the Inspector:**
  • Click the "Connect" button in the interface (unless there's an error message in the console on the bottom left)
  • Explore the "Tools", "Resources", and "Prompts" tabs to see available functionality
  • Try clicking on listed commands or typing resource names to retrieve resources and prompts
  • The interface allows you to test queries and see how the MCP server responds
  • **Take a look at the official docs**
  • "What are all the tables in my database?"
  • "Show me the top 5 users by creation date"
  • "Count addresses by state"
  • Create a new directory under `/src` (e.g., `/src/my-new-mcp`)
  • Implement your MCP server following the PostgreSQL example
  • Add your new MCP to `pyproject.toml`:
  • MCP docs included for easy LLM development
  • Based on the approach at: https://modelcontextprotocol.io/tutorials/building-mcp-with-llms

SECURITY

An MCP listing is not a security review

An MCP server may receive model context, credentials, local files, or permission to call external systems. Review its code, requested environment variables, network behavior, package provenance, and maintenance status before connecting it to an agent.