@z_ai/mcp-server 0.1.3-beta.0 → 0.1.4-beta.0

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.
@@ -34,14 +34,17 @@ export class EnvironmentService {
34
34
  // for zhipuai is https://open.bigmodel.cn/api/paas/v4/
35
35
  envConfig.Z_AI_BASE_URL = 'https://open.bigmodel.cn/api/paas/v4/';
36
36
  }
37
- if (envConfig.PLATFORM_MODE != null) {
38
- console.info('Running in mode', { mode: envConfig.PLATFORM_MODE });
39
- if (envConfig.PLATFORM_MODE === 'Z_AI' || envConfig.PLATFORM_MODE === 'ZAI' || envConfig.PLATFORM_MODE === 'Z') {
37
+ // Support both PLATFORM_MODE and Z_AI_MODE for backward compatibility
38
+ // Priority: PLATFORM_MODE > Z_AI_MODE > default(ZHIPU)
39
+ const platformMode = envConfig.PLATFORM_MODE || envConfig.Z_AI_MODE;
40
+ if (platformMode != null) {
41
+ console.info('Running in mode', { mode: platformMode });
42
+ if (platformMode === 'Z_AI' || platformMode === 'ZAI' || platformMode === 'Z') {
40
43
  envConfig.Z_AI_BASE_URL = 'https://api.z.ai/api/paas/v4/';
41
44
  envConfig.PLATFORM_MODE = 'ZAI';
42
45
  }
43
- else if (envConfig.PLATFORM_MODE === 'ZHIPU_AI' || envConfig.PLATFORM_MODE === 'ZHIPUAI'
44
- || envConfig.PLATFORM_MODE === 'ZHIPU' || envConfig.PLATFORM_MODE === 'BIGMODEL') {
46
+ else if (platformMode === 'ZHIPU_AI' || platformMode === 'ZHIPUAI'
47
+ || platformMode === 'ZHIPU' || platformMode === 'BIGMODEL') {
45
48
  envConfig.Z_AI_BASE_URL = 'https://open.bigmodel.cn/api/paas/v4/';
46
49
  envConfig.PLATFORM_MODE = 'ZHIPU';
47
50
  }
@@ -92,7 +95,7 @@ export class EnvironmentService {
92
95
  /**
93
96
  * Get platform mode
94
97
  */
95
- getPlatformModel() {
98
+ getPlatformMode() {
96
99
  const config = this.getConfig();
97
100
  return config.PLATFORM_MODE || 'ZHIPU';
98
101
  }
package/build/index.js CHANGED
@@ -63,14 +63,6 @@ class McpServerApplication {
63
63
  * Setup error handling
64
64
  */
65
65
  setupErrorHandling() {
66
- process.on('uncaughtException', (error) => {
67
- console.error('Uncaught exception:', error);
68
- this.gracefulShutdown(1);
69
- });
70
- process.on('unhandledRejection', (reason, promise) => {
71
- console.error('Unhandled rejection at:', { promise, reason });
72
- this.gracefulShutdown(1);
73
- });
74
66
  process.on('SIGINT', () => {
75
67
  console.info('Received SIGINT, shutting down gracefully...');
76
68
  this.gracefulShutdown(0);
@@ -125,7 +117,7 @@ class McpServerApplication {
125
117
  // Start server
126
118
  await this.server.connect(transport);
127
119
  console.info('MCP Server started successfully', {
128
- mode: configurationService.getPlatformModel(),
120
+ mode: configurationService.getPlatformMode(),
129
121
  name: configurationService.getServerConfig().name,
130
122
  version: configurationService.getServerConfig().version
131
123
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@z_ai/mcp-server",
3
- "version": "0.1.3-beta.0",
3
+ "version": "0.1.4-beta.0",
4
4
  "description": "MCP Server for Z.AI - A Model Context Protocol server that provides AI capabilities",
5
5
  "main": "build/index.js",
6
6
  "type": "module",