@z_ai/mcp-server 0.0.14-beta.0 → 0.0.14-beta.1

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.
@@ -49,12 +49,20 @@ export class EnvironmentService {
49
49
  else {
50
50
  envConfig.PLATFORM_MODE = 'ZHIPU';
51
51
  }
52
- if (!envConfig.Z_AI_API_KEY) {
53
- if (envConfig.ZAI_API_KEY) {
54
- envConfig.Z_AI_API_KEY = envConfig.ZAI_API_KEY;
52
+ if (!envConfig.Z_AI_API_KEY && envConfig.ZAI_API_KEY) {
53
+ envConfig.Z_AI_API_KEY = envConfig.ZAI_API_KEY;
54
+ console.warn("[important] Z_AI_API_KEY is not set but found ZAI_API_KEY, using ZAI_API_KEY as Z_AI_API_KEY");
55
+ }
56
+ // for some user forget replace the `your_api_key` `your_zhipu_api_key` `your_zai_api_key` in the env
57
+ if (!envConfig.Z_AI_API_KEY || envConfig.Z_AI_API_KEY?.toLowerCase().includes('api')
58
+ || envConfig.Z_AI_API_KEY?.toLowerCase().includes('key')) {
59
+ if (envConfig.ANTHROPIC_AUTH_TOKEN && !envConfig.ANTHROPIC_AUTH_TOKEN?.toLowerCase().includes('api')) {
60
+ // use the ANTHROPIC_AUTH_TOKEN as Z_AI_API_KEY if available
61
+ envConfig.Z_AI_API_KEY = envConfig.ANTHROPIC_AUTH_TOKEN;
62
+ console.warn('[important] Z_AI_API_KEY is not set but found ANTHROPIC_AUTH_TOKEN, using ANTHROPIC_AUTH_TOKEN as Z_AI_API_KEY');
55
63
  }
56
64
  else {
57
- throw new ApiError('Z_AI_API_KEY environment variable is required');
65
+ throw new ApiError('Z_AI_API_KEY environment variable is required, please set your actual API key');
58
66
  }
59
67
  }
60
68
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@z_ai/mcp-server",
3
- "version": "0.0.14-beta.0",
3
+ "version": "0.0.14-beta.1",
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",
@@ -26,7 +26,8 @@
26
26
  ],
27
27
  "author": "Z.AI",
28
28
  "contributors": [
29
- "Chao Gong (https://github.com/tomsun28)"
29
+ "Chao Gong (https://github.com/tomsun28)",
30
+ "Lei Yuan (https://github.com/Web-Life)"
30
31
  ],
31
32
  "license": "Apache-2.0",
32
33
  "files": [