aixx-mcp 1.0.2 → 1.0.4

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.
Files changed (3) hide show
  1. package/README.md +69 -0
  2. package/index.js +13 -4
  3. package/package.json +53 -8
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # @ AIXX MCP Server
2
+
3
+ > **Google for AI — One line. Every AI model.**
4
+ > A zero-dependency MCP server that lets any MCP-compatible client (WorkBuddy, Claude Desktop, Cursor, etc.) call **dozens of LLMs + image/video generation** through a single AIXX key.
5
+
6
+ ## What it does
7
+
8
+ - 🔑 **One key, every model** — Claude, GPT, Gemini, DeepSeek, Qwen, GLM, Moonshot, MiniMax and more (38+ text models, live list).
9
+ - 🖼️ **Image generation** — GPT-Image-2, Nano Banana Pro, Seedream, Midjourney, ...
10
+ - 🎬 **Video generation** — MiniMax H3, Veo 3.1, Kling, Seedance, ... (async + task polling).
11
+ - 🔌 **OpenAI-compatible** — talks to `https://baodan.run/v1`.
12
+ - 🪶 **Zero dependencies** — single file, Node 18+ only.
13
+
14
+ ## Get a key
15
+
16
+ Register at **https://baodan.run/console/** — new accounts get **¥5 free credit**. After login, generate your `sk-` key on the **令牌 (Tokens)** page.
17
+
18
+ Your key looks like `sk-` + 16-128 alphanumeric characters.
19
+
20
+ ## Configure
21
+
22
+ Set your key via the `AIXX_API_KEY` environment variable (recommended), or pass `apiKey` per call.
23
+
24
+ ### WorkBuddy
25
+
26
+ Add to `~/.workbuddy/mcp.json`:
27
+
28
+ ```json
29
+ {
30
+ "mcpServers": {
31
+ "aixx": {
32
+ "command": "npx",
33
+ "args": ["-y", "aixx-mcp"],
34
+ "env": {
35
+ "AIXX_API_KEY": "sk-your-key-here"
36
+ }
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
42
+ ### Claude Desktop / Cursor
43
+
44
+ Same block under `mcpServers` in your client's MCP config.
45
+
46
+ ## Tools
47
+
48
+ | Tool | Description |
49
+ |------|-------------|
50
+ | `aixx_list_models` | List live text models (cached 5 min). |
51
+ | `aixx_chat` | Chat completion. Supports streaming internally, returns full text. |
52
+ | `aixx_image` | Generate an image (sync ≤90s, then falls back to task). |
53
+ | `aixx_video` | Submit a video generation task (async). |
54
+ | `aixx_task` | Poll an image/video task for status/result URL. |
55
+
56
+ ### Tip: reasoning models
57
+
58
+ Models like `deepseek-v4-pro` spend tokens on reasoning. Give `max_tokens` enough headroom (≥500) or the visible answer may be empty.
59
+
60
+ ## Billing
61
+
62
+ - Text: token-based credit.
63
+ - Images: from ¥0.06/image.
64
+ - Video: per-second (e.g. MiniMax 480p ¥0.048/s); rate limit 5 req/min/key.
65
+ - `402` means insufficient credit — top up at https://baodan.run/console/topup.
66
+
67
+ ## License
68
+
69
+ MIT
package/index.js CHANGED
@@ -11,13 +11,22 @@
11
11
  * aixx_task - 轮询媒体任务(GET /v1/media/task/{id})
12
12
  *
13
13
  * 鉴权: 优先用工具参数 apiKey,其次环境变量 AIXX_API_KEY。
14
- * Key 格式: sk- + 48位字母数字。
14
+ * Key 格式: sk- + 16-128位字母数字。
15
15
  */
16
16
  'use strict';
17
17
 
18
+ const fs = require('fs');
19
+ const path = require('path');
20
+
18
21
  const BASE_URL = process.env.AIXX_BASE_URL || 'https://baodan.run/v1';
19
22
  const ENV_KEY = process.env.AIXX_API_KEY || '';
20
23
 
24
+ // 版本号从同目录 package.json 读取,避免与包版本脱节(npx 场景下包以目录形式存在,__dirname/package.json 必在)。
25
+ let VERSION = 'unknown';
26
+ try {
27
+ VERSION = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8')).version || VERSION;
28
+ } catch { /* 保持 fallback */ }
29
+
21
30
  let modelCache = null;
22
31
  let modelCacheAt = 0;
23
32
  const MODEL_TTL_MS = 5 * 60 * 1000;
@@ -138,7 +147,7 @@ async function handle(msg) {
138
147
  return reply(id, {
139
148
  protocolVersion: '2024-11-05',
140
149
  capabilities: { tools: {} },
141
- serverInfo: { name: 'aixx-mcp', version: '1.0.1' }
150
+ serverInfo: { name: 'aixx-mcp', version: VERSION }
142
151
  });
143
152
  }
144
153
  if (method === 'notifications/initialized') return; // no response
@@ -158,8 +167,8 @@ async function callTool(id, params) {
158
167
  if (!key) {
159
168
  return toolResult(id, '缺少 AIXX API Key。请在连接器环境变量设置 AIXX_API_KEY,或在调用时传 apiKey 参数。注册并领取 Key: https://baodan.run/console/ (新用户送 ¥5,登录后在「令牌」页生成 sk- key)。', true);
160
169
  }
161
- if (!/^sk-[A-Za-z0-9]{48}$/.test(key)) {
162
- return toolResult(id, 'API Key 格式不对:应为 sk- + 48位字母数字。', true);
170
+ if (!/^sk-[A-Za-z0-9]{16,128}$/.test(key)) {
171
+ return toolResult(id, 'API Key 格式不对:应为 sk- + 16-128位字母数字(不要含连字符等符号)。', true);
163
172
  }
164
173
 
165
174
  try {
package/package.json CHANGED
@@ -1,11 +1,56 @@
1
1
  {
2
2
  "name": "aixx-mcp",
3
- "version": "1.0.2",
4
- "description": "AIXX MCP Server - AI capability gateway (list models / chat / image / video / task)",
5
- "type": "module",
6
- "bin": { "aixx-mcp": "./index.js" },
7
- "keywords": ["aixx", "mcp", "ai", "llm", "gateway"],
8
- "author": "AIXX",
9
- "license": "ISC",
10
- "engines": { "node": ">=16" }
3
+ "version": "1.0.4",
4
+ "description": "AIXX MCP server one API key to every AI model (Claude/GPT/Gemini/DeepSeek/Qwen/GLM) + image & video generation. Unified AI gateway, OpenAI-compatible. Works with any MCP client (CodeBuddy, Claude Code, Cursor, Cline).",
5
+ "type": "commonjs",
6
+ "main": "index.js",
7
+ "bin": {
8
+ "aixx-mcp": "index.js"
9
+ },
10
+ "files": [
11
+ "index.js",
12
+ "README.md"
13
+ ],
14
+ "keywords": [
15
+ "aixx",
16
+ "mcp",
17
+ "mcp-server",
18
+ "model-context-protocol",
19
+ "ai-gateway",
20
+ "llm-gateway",
21
+ "one-api",
22
+ "multi-model",
23
+ "openai",
24
+ "openai-compatible",
25
+ "openai-api",
26
+ "llm",
27
+ "ai",
28
+ "claude",
29
+ "claude-code",
30
+ "gpt",
31
+ "gemini",
32
+ "deepseek",
33
+ "qwen",
34
+ "glm",
35
+ "cursor",
36
+ "cline",
37
+ "codebuddy",
38
+ "image-generation",
39
+ "text-to-image",
40
+ "video-generation",
41
+ "text-to-video"
42
+ ],
43
+ "engines": {
44
+ "node": ">=18"
45
+ },
46
+ "license": "MIT",
47
+ "author": {
48
+ "name": "AIXX",
49
+ "url": "https://baodan.run/aixx/"
50
+ },
51
+ "homepage": "https://baodan.run/aixx/",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://gitee.com/kk0803/token-hub.git"
55
+ }
11
56
  }