Skip to main content
Glama

Postgres MCP Server

analysis.ipynb1.21 kB
{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "3c063413", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Postgres connection OK: 1\n" ] } ], "source": [ "import os\n", "import psycopg\n", "from dotenv import load_dotenv\n", "\n", "load_dotenv()\n", "\n", "DATABASE_URL = os.getenv(\"DATABASE_URL\")\n", "\n", "if not DATABASE_URL:\n", " raise ValueError(\"DATABASE_URL environment variable is required\")\n", "\n", "conn = psycopg.connect(DATABASE_URL)\n", "\n", "with conn.cursor() as cur:\n", " cur.execute(\"SELECT 1\")\n", " print(\"✅ Postgres connection OK:\", cur.fetchone()[0])\n" ] } ], "metadata": { "kernelspec": { "display_name": ".venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.10" } }, "nbformat": 4, "nbformat_minor": 5 }

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/ericzakariasson/pg-mcp-server'

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