@z_ai/mcp-server 0.0.11 → 0.0.13

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.
@@ -54,6 +54,7 @@ export class ChatService {
54
54
  'Authorization': `Bearer ${apiKey}`,
55
55
  'Content-Type': 'application/json',
56
56
  'X-Title': '4.5V MCP Local',
57
+ 'Accept-Language': 'en-US,en'
57
58
  },
58
59
  body: JSON.stringify(body),
59
60
  signal: controller.signal
@@ -52,12 +52,17 @@ export class EnvironmentService {
52
52
  console.info('Running in mode', { mode: envConfig.PLATFORM_MODE });
53
53
  if (envConfig.PLATFORM_MODE === 'Z_AI' || envConfig.PLATFORM_MODE === 'ZAI' || envConfig.PLATFORM_MODE === 'Z') {
54
54
  envConfig.Z_AI_BASE_URL = 'https://api.z.ai/api/paas/v4/';
55
+ envConfig.PLATFORM_MODE = 'ZAI';
55
56
  }
56
57
  else if (envConfig.PLATFORM_MODE === 'ZHIPU_AI' || envConfig.PLATFORM_MODE === 'ZHIPUAI'
57
58
  || envConfig.PLATFORM_MODE === 'ZHIPU' || envConfig.PLATFORM_MODE === 'BIGMODEL') {
58
59
  envConfig.Z_AI_BASE_URL = 'https://open.bigmodel.cn/api/paas/v4/';
60
+ envConfig.PLATFORM_MODE = 'ZHIPU';
59
61
  }
60
62
  }
63
+ else {
64
+ envConfig.PLATFORM_MODE = 'ZHIPU';
65
+ }
61
66
  if (!envConfig.Z_AI_API_KEY) {
62
67
  throw new ApiError('ZAI_API_KEY environment variable is required');
63
68
  }
@@ -73,7 +78,8 @@ export class EnvironmentService {
73
78
  Z_AI_TOP_P: envConfig.Z_AI_TOP_P,
74
79
  Z_AI_MAX_TOKENS: envConfig.Z_AI_MAX_TOKENS,
75
80
  SERVER_NAME: envConfig.SERVER_NAME,
76
- SERVER_VERSION: envConfig.SERVER_VERSION
81
+ SERVER_VERSION: envConfig.SERVER_VERSION,
82
+ PLATFORM_MODE: envConfig.PLATFORM_MODE
77
83
  };
78
84
  }
79
85
  /**
@@ -105,9 +111,16 @@ export class EnvironmentService {
105
111
  const config = this.getConfig();
106
112
  return {
107
113
  name: config.SERVER_NAME || 'zai-mcp',
108
- version: config.SERVER_VERSION || '0.0.1'
114
+ version: config.SERVER_VERSION || '0.1.0'
109
115
  };
110
116
  }
117
+ /**
118
+ * Get platform mode
119
+ */
120
+ getPlatformModel() {
121
+ const config = this.getConfig();
122
+ return config.PLATFORM_MODE || 'ZHIPU';
123
+ }
111
124
  /**
112
125
  * Get API configuration
113
126
  */
@@ -86,7 +86,7 @@ export function registerImageAnalysisTool(server) {
86
86
  );
87
87
  server.tool('analyze_image', 'Analyze an image using advanced AI vision models with comprehensive understanding capabilities. Supports both local files and remote URL. Maximum file size: 5MB', {
88
88
  image_source: z.string().describe('Local file path or remote URL to the image (supports PNG, JPG, JPEG)'),
89
- prompt: z.string().describe('Detailed text prompt.If the task is front-end code replication, the prompt you provide should be: "Describe in detail the layout structure, color style, main components, and interactive elements of the website in this image to facilitate subsequent code generation by the model."For other tasks, the prompt you provide should be: "Describe this image and explain its content."')
89
+ prompt: z.string().describe('Detailed text prompt. If the task is **front-end code replication**, the prompt you provide must be: "Describe in detail the layout structure, color style, main components, and interactive elements of the website in this image to facilitate subsequent code generation by the model." + your additional requirements. \ For **other tasks**, the prompt you provide must clearly describe what to analyze, extract, or understand from the image.')
90
90
  }, async (params) => {
91
91
  try {
92
92
  // Validate parameters
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@z_ai/mcp-server",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
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",