Skip to main content
Glama

FastMCP_RecSys

by attarmau
database.py571 B
from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorDatabase from backend.app.config.settings import settings from typing import AsyncGenerator client: AsyncIOMotorClient = None db: AsyncIOMotorDatabase = None async def init_db(): global client, db client = AsyncIOMotorClient(settings.MONGO_URI) db = client[settings.MONGO_DB_NAME] print("Database connected") async def close_db(): global client client.close() print("Database connection closed") async def get_db() -> AsyncGenerator[AsyncIOMotorDatabase, None]: yield db

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/attarmau/StyleCLIP'

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