UNPKG

microsoft-todo-mcp-server

Version:

Microsoft Todo MCP service for Claude and Cursor. Fork of @jhirono/todomcp

35 lines (34 loc) 1.31 kB
#!/usr/bin/env node // src/create-mcp-config.ts import fs from "fs"; import path from "path"; import { fileURLToPath } from "url"; var __filename = fileURLToPath(import.meta.url); var __dirname = path.dirname(__filename); var tokenPath = process.argv[2] || path.join(process.cwd(), "tokens.json"); var outputPath = process.argv[3] || path.join(process.cwd(), "mcp.json"); console.log(`Reading tokens from: ${tokenPath}`); console.log(`Writing config to: ${outputPath}`); try { const tokenData = JSON.parse(fs.readFileSync(tokenPath, "utf8")); const mcpConfig = { mcpServers: { microsoftTodo: { command: "npx", args: ["--yes", "microsoft-todo-mcp-server"], env: { MS_TODO_ACCESS_TOKEN: tokenData.accessToken, MS_TODO_REFRESH_TOKEN: tokenData.refreshToken } } } }; fs.writeFileSync(outputPath, JSON.stringify(mcpConfig, null, 2), "utf8"); console.log("MCP configuration file created successfully!"); console.log("You can now use the service with Claude or Cursor by referencing this mcp.json file."); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); console.error("Error creating MCP config:", errorMessage); process.exit(1); } //# sourceMappingURL=create-mcp-config.js.map