Skip to main content
Glama

Grey Swan LLM Safety Challenge MCP Server

by GravityPhone
connection.ts774 B
import mongoose from 'mongoose'; import dotenv from 'dotenv'; // Load environment variables dotenv.config(); // MongoDB connection string const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost:27017/greyswan'; // Connect to MongoDB export const connectToDatabase = async (): Promise<void> => { try { await mongoose.connect(MONGODB_URI); console.error('Connected to MongoDB'); } catch (error) { console.error('MongoDB connection error:', error); process.exit(1); } }; // Disconnect from MongoDB export const disconnectFromDatabase = async (): Promise<void> => { try { await mongoose.disconnect(); console.error('Disconnected from MongoDB'); } catch (error) { console.error('MongoDB disconnection error:', error); } };

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/GravityPhone/SwanzMCP'

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