Compare commits
8 Commits
main
..
a4741b6820
| Author | SHA1 | Date | |
|---|---|---|---|
| a4741b6820 | |||
| 07db914ca0 | |||
| 2f0bfba1cf | |||
| 8dcdab97ce | |||
| afa2bf5126 | |||
| 979e974521 | |||
| 1599bf3981 | |||
| 17a6f91b3f |
@@ -2,17 +2,17 @@ import { XMLParser } from "fast-xml-parser";
|
||||
import https from "node:https";
|
||||
import { createRequire } from "node:module";
|
||||
import { promisify } from "node:util";
|
||||
import { initDataDir } from "../utils/data.ts";
|
||||
import { type Email, extractEmail } from "../utils/extract_email.ts";
|
||||
import { extractEmail, type Email } from "../utils/extract_email.ts";
|
||||
import { extractFolders, type Folder } from "../utils/extract_folder.ts";
|
||||
import { initDataDir } from "../utils/data.ts";
|
||||
import {
|
||||
loadConfig,
|
||||
saveConfig,
|
||||
clearConfig,
|
||||
setPassword,
|
||||
getPassword,
|
||||
hasPassword,
|
||||
loadConfig,
|
||||
type LoginConfig,
|
||||
saveConfig,
|
||||
setPassword,
|
||||
} from "../utils/login.ts";
|
||||
|
||||
const ntlm: any = createRequire(import.meta.url)("httpntlm");
|
||||
@@ -130,8 +130,7 @@ export class EwsClient {
|
||||
|
||||
async getFolderId(folderName: string): Promise<string> {
|
||||
const lower = folderName.toLowerCase();
|
||||
const distinguished =
|
||||
(DISTINGUISHED_FOLDERS as Record<string, string>)[lower];
|
||||
const distinguished = (DISTINGUISHED_FOLDERS as Record<string, string>)[lower];
|
||||
|
||||
if (distinguished) {
|
||||
const soap = buildSoapEnvelope(`\
|
||||
@@ -206,8 +205,7 @@ export class EwsClient {
|
||||
} = options;
|
||||
|
||||
const isDistinguished =
|
||||
(DISTINGUISHED_FOLDERS as Record<string, string>)[folderId.toLowerCase()]
|
||||
!== undefined;
|
||||
(DISTINGUISHED_FOLDERS as Record<string, string>)[folderId.toLowerCase()] !== undefined;
|
||||
|
||||
const folderIdXml = isDistinguished
|
||||
? `<t:DistinguishedFolderId Id="${folderId}"/>`
|
||||
|
||||
@@ -4,13 +4,13 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
||||
import { Command } from "commander";
|
||||
import crypto from "node:crypto";
|
||||
import http from "node:http";
|
||||
import { initDataDir } from "./utils/data.ts";
|
||||
import { registerAuthTools } from "./tools/auth.ts";
|
||||
import { registerAvailabilityTools } from "./tools/availability.ts";
|
||||
import { registerCalendarTools } from "./tools/calendar.ts";
|
||||
import { registerEmailTools } from "./tools/email.ts";
|
||||
import { registerFolderTools } from "./tools/folders.ts";
|
||||
import { registerPeopleTools } from "./tools/people.ts";
|
||||
import { initDataDir } from "./utils/data.ts";
|
||||
|
||||
const program = new Command()
|
||||
.name("exchange-mcp")
|
||||
|
||||
+1
-7
@@ -1,13 +1,7 @@
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { z } from "zod/v4";
|
||||
import { clearConfig, hasPassword, loadConfig, saveConfig, setPassword } from "../utils/login.ts";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
import {
|
||||
clearConfig,
|
||||
hasPassword,
|
||||
loadConfig,
|
||||
saveConfig,
|
||||
setPassword,
|
||||
} from "../utils/login.ts";
|
||||
import { type LoginConfig } from "../utils/login.ts";
|
||||
|
||||
export function registerAuthTools(server: McpServer): void {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { z } from "zod/v4";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
import { loadConfig } from "../utils/login.ts";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
|
||||
export function registerAvailabilityTools(server: McpServer): void {
|
||||
server.registerTool(
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@ import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { z } from "zod/v4";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
import { loadConfig } from "../utils/login.ts";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
|
||||
export function registerCalendarTools(server: McpServer): void {
|
||||
server.registerTool(
|
||||
|
||||
+1
-1
@@ -2,8 +2,8 @@ import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { z } from "zod/v4";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
import { loadConfig } from "../utils/login.ts";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
|
||||
function getClient(): EwsClient {
|
||||
return new EwsClient(loadConfig());
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { z } from "zod/v4";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
import { loadConfig } from "../utils/login.ts";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
|
||||
export function registerFolderTools(server: McpServer): void {
|
||||
server.registerTool(
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { z } from "zod/v4";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
import { loadConfig } from "../utils/login.ts";
|
||||
import { EwsClient } from "../client/ews_client.ts";
|
||||
|
||||
export function registerPeopleTools(server: McpServer): void {
|
||||
server.registerTool(
|
||||
|
||||
Reference in New Issue
Block a user