PostgreSQL MCP Server
PostgreSQL MCP-Server
Ein generischer Model Context Protocol (MCP)-Server für PostgreSQL, der es KI-Agenten ermöglicht, PostgreSQL-Datenbanken sicher zu untersuchen und abzufragen.
Funktionen
list_tables: Listet alle Tabellen impublic-Schema auf.get_schema: Ruft das Schema (Spalten, Typen, Nullability) einer bestimmten Tabelle ab.run_query: Führt eine schreibgeschützte SQL-Abfrage aus (nurSELECT/WITHerlaubt) mit einem maximalen Limit von 100 Zeilen, um zu große Antworten zu vermeiden.
Related MCP server: PostgreSQL MCP Server
Voraussetzungen
Python 3.13+
PostgreSQL-Datenbank
Installation
Sie können dies direkt mit uvx oder uv run ausführen, wenn Sie das Repository klonen.
Verwendung
Dieser Server erfordert, dass die Umgebungsvariable DATABASE_URL gesetzt ist.
Beispiel für einen Verbindungs-String:
postgres://user:password@localhost:5432/mydatabase
Direktes Ausführen
DATABASE_URL="postgresql://postgres:poggerpogger@localhost:5432/boxboxWeb" uv run main.pyVerwendung mit Claude Desktop / MCP-Clients
Fügen Sie Folgendes zu Ihrer MCP-Client-Konfiguration hinzu (z. B. zur claude_desktop_config.json von Claude Desktop):
{
"mcpServers": {
"postgres": {
"command": "uv",
"args": [
"run",
"/path/to/2025postgresqlmcp/main.py"
],
"env": {
"DATABASE_URL": "postgres://user:password@localhost:5432/mydatabase"
}
}
}
}Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides read-only access to PostgreSQL databases, enabling LLMs to inspect database schemas and execute read-only SQL queries.66,136MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely interact with PostgreSQL databases through read-only operations, providing schema discovery, table inspection, and query execution capabilities with structured context awareness.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with PostgreSQL databases through natural language queries, schema inspection, and safe SQL execution.101
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely interact with PostgreSQL databases, perform queries, inspect schemas, and analyze query performance.2
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Explore, query, and inspect SQLite databases with ease. List tables, preview results, and view det…
Comprehensive PostgreSQL documentation and best practices, including ecosystem tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/KannaKim/PostgresqlMCPServer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server