@egain/egain-mcp-server 1.0.23 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mcp-server.js +38 -30
- package/bin/mcp-server.js.map +6 -6
- package/esm/src/hooks/auth-hook.d.ts.map +1 -1
- package/esm/src/hooks/auth-hook.js +47 -38
- package/esm/src/hooks/auth-hook.js.map +1 -1
- package/esm/src/lib/config.d.ts +2 -2
- package/esm/src/lib/config.js +2 -2
- package/esm/src/mcp-server/mcp-server.js +1 -1
- package/esm/src/mcp-server/server.js +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/src/hooks/auth-hook.ts +50 -39
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
package/bin/mcp-server.js
CHANGED
|
@@ -4046,9 +4046,9 @@ var init_config = __esm(() => {
|
|
|
4046
4046
|
SDK_METADATA = {
|
|
4047
4047
|
language: "typescript",
|
|
4048
4048
|
openapiDocVersion: "1.0.0",
|
|
4049
|
-
sdkVersion: "1.0.
|
|
4049
|
+
sdkVersion: "1.0.24",
|
|
4050
4050
|
genVersion: "2.723.8",
|
|
4051
|
-
userAgent: "speakeasy-sdk/mcp-typescript 1.0.
|
|
4051
|
+
userAgent: "speakeasy-sdk/mcp-typescript 1.0.24 2.723.8 1.0.0 @egain/egain-mcp-server"
|
|
4052
4052
|
};
|
|
4053
4053
|
});
|
|
4054
4054
|
|
|
@@ -42030,34 +42030,42 @@ class AuthenticationHook {
|
|
|
42030
42030
|
}
|
|
42031
42031
|
}
|
|
42032
42032
|
if (currentUrl && currentUrl.includes("error=")) {
|
|
42033
|
-
|
|
42033
|
+
const errorMatch = currentUrl.match(/[?&]error=([^&]+)/);
|
|
42034
|
+
const errorDescMatch = currentUrl.match(/error_description=([^&]+)/);
|
|
42035
|
+
const error = errorMatch && errorMatch[1] ? decodeURIComponent(errorMatch[1]) : "unknown_error";
|
|
42036
|
+
const errorDesc = errorDescMatch && errorDescMatch[1] ? decodeURIComponent(errorDescMatch[1]) : "No description";
|
|
42037
|
+
const errorLower = error.toLowerCase();
|
|
42038
|
+
const errorDescLower = errorDesc.toLowerCase();
|
|
42039
|
+
const isScopeError = error === "invalid_scope" || errorDescLower.includes("scope") || errorLower.includes("scope");
|
|
42040
|
+
const isRetryableError = error === "access_denied" || error === "invalid_grant" || errorDescLower.includes("password") || errorLower.includes("password") || errorDescLower.includes("username") || errorLower.includes("username") || errorDescLower.includes("credential") || errorLower.includes("credential") || errorLower.includes("user not found") || errorDescLower.includes("user not found");
|
|
42041
|
+
const isNewError = currentUrl !== lastErrorUrl;
|
|
42042
|
+
if (isNewError) {
|
|
42034
42043
|
lastErrorUrl = currentUrl;
|
|
42035
|
-
|
|
42036
|
-
|
|
42037
|
-
|
|
42038
|
-
const errorDesc = errorDescMatch && errorDescMatch[1] ? decodeURIComponent(errorDescMatch[1]) : "No description";
|
|
42039
|
-
const isScopeError = error === "invalid_scope" || errorDesc.toLowerCase().includes("scope");
|
|
42040
|
-
const isRetryableError = error === "access_denied" || error === "invalid_grant" || errorDesc.toLowerCase().includes("password") || errorDesc.toLowerCase().includes("username") || errorDesc.toLowerCase().includes("credential");
|
|
42041
|
-
if (!oAuthErrorLogged) {
|
|
42044
|
+
}
|
|
42045
|
+
if (isScopeError) {
|
|
42046
|
+
if (!oAuthErrorLogged || isNewError) {
|
|
42042
42047
|
console.error("❌ OAuth authentication error:", `${error} - ${errorDesc}`);
|
|
42043
|
-
|
|
42044
|
-
|
|
42045
|
-
|
|
42046
|
-
oAuthErrorLogged = true;
|
|
42047
|
-
this.stopConfigServer();
|
|
42048
|
-
return;
|
|
42049
|
-
} else if (isRetryableError) {
|
|
42050
|
-
console.error("\uD83D\uDCA1 The configuration server will remain running. Please try again with correct credentials.");
|
|
42051
|
-
console.error("\uD83D\uDD0D Continuing to monitor browser for authorization code...");
|
|
42052
|
-
oAuthErrorLogged = true;
|
|
42053
|
-
} else {
|
|
42054
|
-
console.error("\uD83D\uDCA1 Please check the error message displayed in your browser and close the window.");
|
|
42055
|
-
console.error("\uD83D\uDED1 Stopping monitoring.");
|
|
42056
|
-
oAuthErrorLogged = true;
|
|
42057
|
-
this.stopConfigServer();
|
|
42058
|
-
return;
|
|
42059
|
-
}
|
|
42048
|
+
console.error("\uD83D\uDCA1 This is a configuration error. Please check your scope settings and close this window.");
|
|
42049
|
+
console.error("\uD83D\uDED1 Stopping monitoring - please fix the configuration and try again.");
|
|
42050
|
+
oAuthErrorLogged = true;
|
|
42060
42051
|
}
|
|
42052
|
+
this.stopConfigServer();
|
|
42053
|
+
return;
|
|
42054
|
+
} else if (!isRetryableError) {
|
|
42055
|
+
if (!oAuthErrorLogged || isNewError) {
|
|
42056
|
+
console.error("❌ OAuth authentication error:", `${error} - ${errorDesc}`);
|
|
42057
|
+
console.error("\uD83D\uDCA1 Please check the error message displayed in your browser and close the window.");
|
|
42058
|
+
console.error("\uD83D\uDED1 Stopping monitoring.");
|
|
42059
|
+
oAuthErrorLogged = true;
|
|
42060
|
+
}
|
|
42061
|
+
this.stopConfigServer();
|
|
42062
|
+
return;
|
|
42063
|
+
}
|
|
42064
|
+
if (isNewError) {
|
|
42065
|
+
console.error("❌ OAuth authentication error:", `${error} - ${errorDesc}`);
|
|
42066
|
+
console.error("\uD83D\uDCA1 The configuration server will remain running. Please try again with correct credentials.");
|
|
42067
|
+
console.error("\uD83D\uDD0D Continuing to monitor browser for authorization code...");
|
|
42068
|
+
oAuthErrorLogged = true;
|
|
42061
42069
|
}
|
|
42062
42070
|
} else {
|
|
42063
42071
|
if (lastErrorUrl !== null) {
|
|
@@ -47433,7 +47441,7 @@ The Search API is a hybrid search service that combines semantic understanding w
|
|
|
47433
47441
|
function createMCPServer(deps) {
|
|
47434
47442
|
const server = new McpServer({
|
|
47435
47443
|
name: "EgainMcp",
|
|
47436
|
-
version: "1.0.
|
|
47444
|
+
version: "1.0.24"
|
|
47437
47445
|
});
|
|
47438
47446
|
const getClient = deps.getSDK || (() => new EgainMcpCore({
|
|
47439
47447
|
security: deps.security,
|
|
@@ -48680,7 +48688,7 @@ var routes = ln({
|
|
|
48680
48688
|
var app = _e(routes, {
|
|
48681
48689
|
name: "mcp",
|
|
48682
48690
|
versionInfo: {
|
|
48683
|
-
currentVersion: "1.0.
|
|
48691
|
+
currentVersion: "1.0.24"
|
|
48684
48692
|
}
|
|
48685
48693
|
});
|
|
48686
48694
|
Yt(app, process3.argv.slice(2), buildContext(process3));
|
|
@@ -48688,5 +48696,5 @@ export {
|
|
|
48688
48696
|
app
|
|
48689
48697
|
};
|
|
48690
48698
|
|
|
48691
|
-
//# debugId=
|
|
48699
|
+
//# debugId=FF186799450FA50E64756E2164756E21
|
|
48692
48700
|
//# sourceMappingURL=mcp-server.js.map
|