Skip to main content
Glama
auth-manager.js940 B
import fs from 'fs-extra'; import path from 'path'; import os from 'os'; const CONFIG_DIR = path.join(os.homedir(), '.overleaf-mcp'); const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json'); export class AuthManager { constructor() { this.ensureConfigDir(); } async ensureConfigDir() { await fs.ensureDir(CONFIG_DIR); } async saveConfig(config) { const current = await this.getConfig(); const newConfig = { ...current, ...config }; await fs.writeJson(CONFIG_FILE, newConfig, { spaces: 2 }); } async getConfig() { if (await fs.pathExists(CONFIG_FILE)) { return await fs.readJson(CONFIG_FILE); } return {}; } async getCredentials() { const config = await this.getConfig(); if (config.email && config.token) { return { email: config.email, token: config.token }; } return null; } }

Implementation Reference

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/juho127/overleafMCP'

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