outlook-mcp/config.js
Seton Carmichael 68a64461eb fix(outlook-mcp): P0 audit fixes
- Handle empty 2xx Graph API responses without JSON parse errors
- Fix list-rules handler import (handleListRules named export)
- Add timezone-aware display formatting using MS_TIMEZONE / DEFAULT_TIMEZONE
- Return created event ID in create-event success message
- Change default timezone from Windows name to IANA (America/New_York)
2026-06-21 20:28:11 -04:00

51 lines
2.3 KiB
JavaScript

/**
* Configuration for Outlook MCP Server
*/
const path = require('path');
const os = require('os');
// Ensure we have a home directory path even if process.env.HOME is undefined
const homeDir = process.env.HOME || process.env.USERPROFILE || os.homedir() || '/tmp';
module.exports = {
// Server information
SERVER_NAME: "outlook-assistant-main",
SERVER_VERSION: "1.0.1",
// Test mode setting
USE_TEST_MODE: process.env.USE_TEST_MODE === 'true',
// Debug mode setting
DEBUG_MODE: process.env.DEBUG_MODE === 'true',
// Authentication configuration
AUTH_CONFIG: {
clientId: process.env.MS_CLIENT_ID || '',
// Optional: set MS_CLIENT_SECRET for confidential client app registrations.
// Public client apps (Allow public client flows enabled, no secret) leave this blank.
clientSecret: process.env.MS_CLIENT_SECRET || '',
scopes: ['Mail.Read', 'Mail.ReadWrite', 'Mail.Send', 'User.Read', 'Calendars.Read', 'Calendars.ReadWrite', 'MailboxSettings.ReadWrite', 'offline_access'],
tokenStorePath: process.env.OUTLOOK_TOKEN_STORE_PATH || path.join(homeDir, '.outlook-mcp-tokens.json'),
// Device code flow: polling interval in seconds (Microsoft returns the recommended interval)
deviceCodePollingInterval: 5
},
// Microsoft Graph API
GRAPH_API_ENDPOINT: 'https://graph.microsoft.com/v1.0/',
// Calendar constants
CALENDAR_SELECT_FIELDS: 'id,subject,start,end,location,bodyPreview,isAllDay,recurrence,attendees',
// Email constants
EMAIL_SELECT_FIELDS: 'id,subject,from,toRecipients,ccRecipients,receivedDateTime,bodyPreview,hasAttachments,importance,isRead,conversationId',
EMAIL_DETAIL_FIELDS: 'id,subject,from,toRecipients,ccRecipients,bccRecipients,receivedDateTime,bodyPreview,body,hasAttachments,importance,isRead,internetMessageHeaders',
// Calendar constants
CALENDAR_SELECT_FIELDS: 'id,subject,bodyPreview,start,end,location,organizer,attendees,isAllDay,isCancelled',
// Default timezone for calendar event creation and display (IANA tz name, e.g. 'America/New_York').
// Override via MS_TIMEZONE env var. Graph API accepts IANA timezone identifiers.
DEFAULT_TIMEZONE: process.env.MS_TIMEZONE || 'America/New_York',
DEFAULT_PAGE_SIZE: 25,
MAX_RESULT_COUNT: 500
};