Skip to main content
Glama
MIT License
26,201
68,255
  • Apple
  • Linux

PostgreSQL

PostgreSQLデータベースへの読み取り専用アクセスを提供するモデルコンテキストプロトコル(CMP)サーバー。このサーバーにより、LLMはデータベーススキーマを検査し、読み取り専用クエリを実行できます。

コンポーネント

ツール

  • クエリ
    • 接続されたデータベースに対して読み取り専用のSQLクエリを実行する
    • 入力: sql (文字列): 実行するSQLクエリ
    • すべてのクエリは読み取り専用トランザクション内で実行されます

リソース

サーバーは、データベース内の各テーブルのスキーマ情報を提供します。

  • テーブルスキーマ( postgres://<host>/<table>/schema )
    • 各テーブルのJSONスキーマ情報
    • 列名とデータ型が含まれます
    • データベースのメタデータから自動的に検出

構成

Claude Desktopでの使用

このサーバーを Claude Desktop アプリで使用するには、 claude_desktop_config.jsonの「mcpServers」セクションに次の構成を追加します。

ドッカー

  • macOSでdockerを実行する場合、サーバーがホストネットワーク(例:localhost)上で実行されている場合はhost.docker.internalを使用します。
  • ユーザー名/パスワードはpostgresql://user:password@host:port/db-nameのように postgresql の URL に追加できます。
{ "mcpServers": { "postgres": { "command": "docker", "args": [ "run", "-i", "--rm", "mcp/postgres", "postgresql://host.docker.internal:5432/mydb"] } } }

NPX

{ "mcpServers": { "postgres": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb" ] } } }

/mydbデータベース名に置き換えます。

VS Codeでの使用

素早くインストールするには、以下のワンクリック インストール ボタンのいずれかを使用します...

手動でインストールする場合は、VS Code のユーザー設定 (JSON) ファイルに次の JSON ブロックを追加します。Ctrl Ctrl + Shift + Pを押してPreferences: Open User Settings (JSON)と入力すると、このブロックを追加できます。

オプションとして、ワークスペース内の.vscode/mcp.jsonというファイルに追加することもできます。これにより、他のユーザーと設定を共有できるようになります。

.vscode/mcp.jsonファイルではmcpキーは必要ないことに注意してください。

ドッカー

注意: Docker を使用してホスト マシン上の PostgreSQL サーバーに接続する場合は、接続 URL でlocalhostではなくhost.docker.internalを使用します。

{ "mcp": { "inputs": [ { "type": "promptString", "id": "pg_url", "description": "PostgreSQL URL (e.g. postgresql://user:pass@host.docker.internal:5432/mydb)" } ], "servers": { "postgres": { "command": "docker", "args": [ "run", "-i", "--rm", "mcp/postgres", "${input:pg_url}" ] } } } }

NPX

{ "mcp": { "inputs": [ { "type": "promptString", "id": "pg_url", "description": "PostgreSQL URL (e.g. postgresql://user:pass@localhost:5432/mydb)" } ], "servers": { "postgres": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-postgres", "${input:pg_url}" ] } } } }

建物

ドッカー:

docker build -t mcp/postgres -f src/postgres/Dockerfile .

ライセンス

このMCPサーバーはMITライセンスに基づいてライセンスされています。つまり、MITライセンスの条件に従って、ソフトウェアを自由に使用、改変、配布することができます。詳細については、プロジェクトリポジトリのLICENSEファイルをご覧ください。

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

PostgreSQLデータベースへの読み取り専用アクセスを提供するモデルコンテキストプロトコル(CMP)サーバー。このサーバーにより、LLMはデータベーススキーマを検査し、読み取り専用クエリを実行できます。

  1. コンポーネント
    1. ツール
    2. リソース
  2. 構成
    1. Claude Desktopでの使用
    2. ドッカー
    3. NPX
    4. VS Codeでの使用
    5. ドッカー
    6. NPX
  3. 建物
    1. ライセンス

      Related MCP Servers

      • -
        security
        A
        license
        -
        quality
        A Model Context Protocol server providing LLMs read-only access to PostgreSQL databases for inspecting schemas and executing queries.
        Last updated -
        26,201
        22
        MIT License
        • Apple
      • -
        security
        A
        license
        -
        quality
        A Model Context Protocol server that provides read-only access to PostgreSQL databases with enhanced multi-schema support, allowing LLMs to inspect database schemas across multiple namespaces and execute read-only queries while maintaining schema isolation.
        Last updated -
        9
        3
        MIT License
      • -
        security
        F
        license
        -
        quality
        A Model Context Protocol server providing both read and write access to PostgreSQL databases, enabling LLMs to query data, modify records, and manage database schemas.
        Last updated -
        583
        7
      • -
        security
        F
        license
        -
        quality
        A Model Context Protocol server that provides read-only access to PostgreSQL databases, enabling LLMs to inspect database schemas and execute read-only queries.
        Last updated -
        26,201

      View all related MCP servers

      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/modelcontextprotocol/postgresql'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server