@z_ai/mcp-server 0.1.5 → 0.1.6

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.
@@ -44,13 +44,15 @@ export class ChatService {
44
44
  async chatCompletions(url, body) {
45
45
  const apiConfig = configurationService.getVisionConfig();
46
46
  const apiKey = this.environmentService.getApiKey();
47
+ // Keys like ANTHROPIC_AUTH_TOKEN may already carry the "Bearer" prefix — don't double it
48
+ const authorization = /^bearer\s/i.test(apiKey) ? apiKey : `Bearer ${apiKey}`;
47
49
  const controller = new AbortController();
48
50
  const timeoutId = setTimeout(() => controller.abort(), apiConfig.timeout);
49
51
  try {
50
52
  const response = await fetch(url, {
51
53
  method: 'POST',
52
54
  headers: {
53
- 'Authorization': `Bearer ${apiKey}`,
55
+ 'Authorization': authorization,
54
56
  'Content-Type': 'application/json',
55
57
  'X-Title': '4.5V MCP Local',
56
58
  'Accept-Language': 'en-US,en'
@@ -106,7 +106,7 @@ export class EnvironmentService {
106
106
  const config = this.getConfig();
107
107
  return {
108
108
  model: config.Z_AI_VISION_MODEL || 'glm-5.3-flash',
109
- timeout: parseInt(config.Z_AI_TIMEOUT || '300000'),
109
+ timeout: parseInt(config.Z_AI_TIMEOUT || '600000'),
110
110
  retryCount: parseInt(config.Z_AI_RETRY_COUNT || '1'),
111
111
  url: config.Z_AI_BASE_URL + 'chat/completions',
112
112
  temperature: parseFloat(config.Z_AI_VISION_MODEL_TEMPERATURE || '0.8'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@z_ai/mcp-server",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
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",