@jhirono/todomcp
Version:
Microsoft Todo MCP service for Claude and Cursor
34 lines (28 loc) • 1.11 kB
JavaScript
// Read your .env file for CLIENT_ID and CLIENT_SECRET
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import dotenv from 'dotenv';
import { createRequire } from 'module';
// Get current file directory
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// Try to find and load .env file
try {
const envPath = path.resolve(process.cwd(), '.env');
if (fs.existsSync(envPath)) {
console.error('Loading environment variables from .env');
dotenv.config({ path: envPath });
}
} catch (error) {
console.error('Error loading .env file:', error.message);
}
// Set environment variables for the actual CLI
process.env.CLIENT_ID = process.env.CLIENT_ID || 'your_client_id_here';
process.env.CLIENT_SECRET = process.env.CLIENT_SECRET || 'your_client_secret_here';
process.env.TENANT_ID = process.env.TENANT_ID || '8df7657b-11c2-4e56-b7a9-b3ec1797cd78';
// Run the actual CLI
console.error('Starting Microsoft Todo MCP with client credentials');
// Import and run the CLI module
import('../build/cli.js');