Skip to main content
Glama
database.py587 B
import os from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine from src.utils.env_handler import DATABASE_URL as ENV_DATABASE_URL # Engine and Session setup (defaults to local Postgres) DATABASE_URL = ENV_DATABASE_URL # Prefer psycopg v3 driver if not specified if DATABASE_URL.startswith("postgresql://") and "+psycopg" not in DATABASE_URL: DATABASE_URL = DATABASE_URL.replace("postgresql://", "postgresql+psycopg://", 1) engine = create_engine(DATABASE_URL, echo=False, pool_pre_ping=True) SessionLocal = sessionmaker(bind=engine, expire_on_commit=False)

Latest Blog Posts

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/bernerspace/bernerspace'

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