@modelbay/mcp 0.2.2 → 0.4.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.
package/README.md CHANGED
@@ -14,19 +14,24 @@ One command serves every platform that ships MCP tools; the platform is the firs
14
14
  npx -y @modelbay/mcp ark # or: modelbay-mcp ark
15
15
  ```
16
16
 
17
- | Platform | Argument | Required keys (any one row) |
18
- | --------------- | --------------- | ------------------------------------------------------------ |
19
- | Volcengine Ark | `ark` | `ARK_API_KEY`, or `ARK_AGENT_PLAN_API_KEY` |
20
- | MiniMax | `minimax` | `MINIMAX_API_KEY` |
21
- | Alibaba Bailian | `bailian` | `BAILIAN_API_KEY` (alias `DASHSCOPE_API_KEY`) |
22
- | Doubao Speech | `doubao-speech` | `DOUBAO_API_KEY`, or `DOUBAO_APP_ID` + `DOUBAO_ACCESS_TOKEN` |
23
- | OpenAI | `openai` | `OPENAI_API_KEY` |
17
+ | Platform | Argument | Required keys (any one row) |
18
+ | --------------- | --------------- | ------------------------------------------------------------------------------ |
19
+ | Volcengine Ark | `ark` | `ARK_API_KEY`, or `ARK_AGENT_PLAN_API_KEY` |
20
+ | MiniMax | `minimax` | `MINIMAX_API_KEY` |
21
+ | Alibaba Bailian | `bailian` | `BAILIAN_API_KEY` (alias `DASHSCOPE_API_KEY`), or `BAILIAN_TOKEN_PLAN_API_KEY` |
22
+ | Doubao Speech | `doubao-speech` | `DOUBAO_API_KEY`, or `DOUBAO_APP_ID` + `DOUBAO_ACCESS_TOKEN` |
23
+ | OpenAI | `openai` | `OPENAI_API_KEY` |
24
24
 
25
25
  Ark has two billing channels. Prefix the model with `ark-plan:` to use the Agent Plan
26
26
  (`ARK_AGENT_PLAN_API_KEY`, `/api/plan/v3`) and `ark:` for pay-per-use (`ARK_API_KEY`). A model
27
27
  without a prefix goes to the channel it is declared in, preferring pay-per-use when both keys are
28
28
  set; with only the plan key configured, calls without a model use the plan.
29
29
 
30
+ Bailian works the same way for text chat: `bailian-plan:` (or a model only offered in the Token
31
+ Plan, such as `qwen4-max-preview`) uses `BAILIAN_TOKEN_PLAN_API_KEY` and the Token Plan endpoint.
32
+ Token Plan keys are for interactive use inside coding and agent tools only, so plan models are
33
+ marked `agentOnly`.
34
+
30
35
  The platform list, key names and aliases come from each platform package's `PlatformDescriptor`;
31
36
  running `modelbay-mcp` without an argument prints the available platforms. Keys are supplied by the
32
37
  host through environment variables and never stored. When a key is missing, `tools/list` still
package/dist/generate.mjs CHANGED
@@ -100,7 +100,7 @@ function buildRoute(meta, nativeOp, capability) {
100
100
  function buildExtraTool(name) {
101
101
  return {
102
102
  name,
103
- description: "列出本平台声明的模型 ID、能力与生命周期提示(从 ModelDeclaration 派生),不联网、不计费。",
103
+ description: "列出本平台声明的模型 ID、能力、生命周期提示与各渠道的上下文窗口 / 最大输出(从 ModelDeclaration 派生),不联网、不计费。",
104
104
  inputSchema: {
105
105
  type: "object",
106
106
  title: "listDeclaredModelsArguments",
package/dist/routing.mjs CHANGED
@@ -106,7 +106,17 @@ function localResult(handler, args, set, models) {
106
106
  title: model.title,
107
107
  capabilities: model.capabilities,
108
108
  status: model.lifecycle.status,
109
- notice: lifecycleNotice(model)
109
+ notice: lifecycleNotice(model),
110
+ channels: model.channels.map((entry) => {
111
+ const contextWindow = entry.contextWindow ?? model.contextWindow;
112
+ const maxOutputTokens = entry.maxOutputTokens ?? model.maxOutputTokens;
113
+ return {
114
+ channel: entry.channel,
115
+ id: entry.id,
116
+ ...contextWindow !== void 0 ? { contextWindow } : {},
117
+ ...maxOutputTokens !== void 0 ? { maxOutputTokens } : {}
118
+ };
119
+ })
110
120
  })) });
111
121
  }
112
122
  case "voices": {
@@ -152,7 +162,7 @@ function createHandlers(options) {
152
162
  if (byPrefix) return byPrefix;
153
163
  }
154
164
  const fallback = defaultAdapter();
155
- const declared = models.find((item) => item.id === model || item.canonicalId === model || item.channels.some((entry) => entry.id === model));
165
+ const declared = models.find((item) => item.id === model) ?? resolveModel(models, model)?.declaration;
156
166
  if (!declared) return fallback;
157
167
  const candidates = pool.filter((item) => declared.channels.some((entry) => item.channels.includes(entry.channel)));
158
168
  return candidates.find((item) => item === fallback) ?? candidates.find(usable) ?? candidates[0] ?? fallback;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelbay/mcp",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "description": "MCP server for Volcengine Ark, Alibaba Bailian, MiniMax, Doubao Speech and OpenAI: image, video, speech, music and chat tools for Claude Code, Codex, Cursor and Claude Desktop",
5
5
  "keywords": [
6
6
  "mcp",
@@ -55,7 +55,7 @@
55
55
  "zod": "^4.6"
56
56
  },
57
57
  "dependencies": {
58
- "modelbay": "0.2.2"
58
+ "modelbay": "0.4.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@modelbay/ark": "0.1.0",