w
This commit is contained in:
+14
-9
@@ -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 () => {
|
||||
|
||||
Reference in New Issue
Block a user