PostgreSQL MCP Server
MCP-сервер PostgreSQL
Универсальный сервер протокола контекста модели (MCP) для PostgreSQL, позволяющий ИИ-агентам безопасно проверять базы данных PostgreSQL и выполнять запросы к ним.
Функции
list_tables: перечисление всех таблиц в схемеpublic.get_schema: получение схемы (столбцы, типы, возможность значения null) конкретной таблицы.run_query: выполнение SQL-запроса только для чтения (разрешены толькоSELECT/WITH) с максимальным ограничением в 100 строк во избежание получения слишком больших ответов.
Related MCP server: PostgreSQL MCP Server
Предварительные требования
Python 3.13+
База данных PostgreSQL
Установка
Вы можете запустить сервер напрямую с помощью uvx или uv run, если клонируете репозиторий.
Использование
Для работы этого сервера необходимо установить переменную окружения DATABASE_URL.
Пример строки подключения:
postgres://user:password@localhost:5432/mydatabase
Прямой запуск
DATABASE_URL="postgresql://postgres:poggerpogger@localhost:5432/boxboxWeb" uv run main.pyИспользование с Claude Desktop / MCP-клиентами
Добавьте следующее в конфигурацию вашего MCP-клиента (например, в файл claude_desktop_config.json для 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
- Alicense-qualityDmaintenanceProvides read-only access to PostgreSQL databases, enabling LLMs to inspect database schemas and execute read-only SQL queries.Last updated126,036MIT
- Alicense-qualityDmaintenanceEnables 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.Last updatedMIT
- Flicense-qualityDmaintenanceEnables AI assistants to interact with PostgreSQL databases through natural language queries, schema inspection, and safe SQL execution.Last updated161
- Flicense-qualityDmaintenanceEnables AI assistants to safely interact with PostgreSQL databases, perform queries, inspect schemas, and analyze query performance.Last updated2
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
Comprehensive PostgreSQL documentation and best practices, including ecosystem tools
Read-only bank access for your AI agent. Connects Claude, ChatGPT, Cursor, Gemini, Codex.
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