Skip to main content
Glama

MCP-Expokossodo 2025

by gfxjef
session.py1.24 kB
""" Database session management """ from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmaker from sqlalchemy.orm import declarative_base import structlog from app.config import settings logger = structlog.get_logger() # SQLAlchemy base Base = declarative_base() # Create async engine engine = create_async_engine( settings.database_url, echo=settings.debug, pool_size=20, max_overflow=30, pool_pre_ping=True, pool_recycle=300 ) # Create session maker AsyncSessionLocal = async_sessionmaker( engine, class_=AsyncSession, expire_on_commit=False ) async def get_db_session() -> AsyncSession: """ Dependency to get database session """ async with AsyncSessionLocal() as session: try: yield session except Exception as e: await session.rollback() logger.error("database_session_error", error=str(e)) raise finally: await session.close() async def init_db(): """Initialize database - create tables if needed""" async with engine.begin() as conn: # Create tables (if using alembic, this won't be needed) await conn.run_sync(Base.metadata.create_all)

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/gfxjef/mcp_expokossodo2025'

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