This commit is contained in:
2026-07-10 16:36:22 +03:00
parent 990a8d09b6
commit 17a6f91b3f
7 changed files with 56 additions and 219 deletions
+14 -9
View File
@@ -14,15 +14,17 @@ export function registerAuthTools(server: McpServer): void {
server.registerTool(
"login",
{
description: "Authenticate to Exchange EWS using NTLM credentials",
description: "Authenticate to Exchange EWS using NTLM credentials."
+ " On first use all fields except domain are required."
+ " On subsequent logins only password is needed — previously saved"
+ " serverUrl, email, username, and domain are reused automatically from config."
+ " Returns {success, message} on success or {success, error} on failure.",
inputSchema: z.object({
serverUrl: z.string().optional().describe(
"EWS server URL (e.g. https://mail.example.com)",
),
serverUrl: z.string().optional().describe("Server URL"),
email: z.string().optional().describe("Email address"),
username: z.string().optional().describe("NTLM username"),
password: z.string().describe("NTLM password"),
domain: z.string().optional().describe("NTLM domain (default: corp)"),
domain: z.string().optional().describe("NTLM domain"),
}),
},
async ({ serverUrl, email, username, password, domain }) => {
@@ -47,8 +49,9 @@ export function registerAuthTools(server: McpServer): void {
type: "text" as const,
text: JSON.stringify({
success: false,
error:
"Missing required fields. Provide serverUrl, email, and username, or login once with all fields first.",
error: "Missing required fields."
+ " Provide serverUrl, email, and username, or"
+ " login once with all fields first.",
}),
}],
};
@@ -99,7 +102,8 @@ export function registerAuthTools(server: McpServer): void {
server.registerTool(
"check_session",
{
description: "Check whether the current EWS session is authenticated",
description:
"Check whether the current EWS session is authenticated. No parameters. Returns {authenticated, email, serverUrl} or {authenticated, error}.",
inputSchema: z.object({}),
},
async () => {
@@ -147,7 +151,8 @@ export function registerAuthTools(server: McpServer): void {
server.registerTool(
"logout",
{
description: "Clear stored credentials",
description:
"Clear stored credentials (serverUrl, email, username, domain, password). No parameters. Returns {success, message}.",
inputSchema: z.object({}),
},
async () => {