We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/peacockery-studio/outlook-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
index.js•778 B
/**
* Authentication module for Outlook MCP server
*/
const tokenManager = require("./token-manager");
const { authTools } = require("./tools");
/**
* Ensures the user is authenticated and returns an access token
* @param {boolean} forceNew - Whether to force a new authentication
* @returns {Promise<string>} - Access token
* @throws {Error} - If authentication fails
*/
async function ensureAuthenticated(forceNew = false) {
if (forceNew) {
// Force re-authentication
throw new Error("Authentication required");
}
// Check for existing token
const accessToken = tokenManager.getAccessToken();
if (!accessToken) {
throw new Error("Authentication required");
}
return accessToken;
}
module.exports = {
tokenManager,
authTools,
ensureAuthenticated,
};