@tokenlabai/mcp-server 0.6.10 → 0.6.12
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 +11 -8
- package/contract/mcp-overlay.json +2 -0
- package/contract/openapi.json +482 -55
- package/generated/public-contract.json +8 -5
- package/generated/tools.json +328 -54
- package/llms-install.md +1 -1
- package/package.json +5 -3
- package/scripts/generate-contract.mjs +61 -5
- package/scripts/sync-contract.mjs +95 -13
- package/src/index.js +35 -1
- package/src/media-mime.js +68 -0
package/README.md
CHANGED
|
@@ -10,15 +10,15 @@ It exposes public catalog tools for agents that need to choose models, inspect s
|
|
|
10
10
|
|
|
11
11
|
## Generated Tool Profiles
|
|
12
12
|
|
|
13
|
-
The checked-in `generated/tools.json` manifest is generated from TokenLab's public OpenAPI document plus the small MCP-only overlay in `contract/mcp-overlay.json`. Version 0.6.
|
|
13
|
+
The checked-in `generated/tools.json` manifest is generated from TokenLab's public OpenAPI document plus the small MCP-only overlay in `contract/mcp-overlay.json`. Version 0.6.12 generates 78 endpoint tools; two composite discovery tools are registered at runtime.
|
|
14
14
|
|
|
15
15
|
| Profile | Endpoint tools | Coverage |
|
|
16
16
|
| --- | ---: | --- |
|
|
17
17
|
| `catalog` | 4 | Public model discovery and pricing only; no API key required |
|
|
18
18
|
| `core` (default) | 29 | Catalog and pricing; Chat Completions, Responses, Anthropic Messages, Gemini generateContent; images, video, music, 3D, speech and transcription; async tasks; files; embeddings, rerank, and translation |
|
|
19
|
-
| `full` |
|
|
19
|
+
| `full` | 78 | Every allowlisted developer API operation in the checked-in OpenAPI snapshot, including core plus response lifecycle, batches, worlds, and native model discovery |
|
|
20
20
|
|
|
21
|
-
All profiles also include `compare_models` and `get_api_overview`, producing totals of 6, 31, and
|
|
21
|
+
All profiles also include `compare_models` and `get_api_overview`, producing totals of 6, 31, and 80 tools. Realtime and streaming-only operations are excluded because stdio MCP tool calls return one final result. API operations that accept `stream` constrain it to `false` in the MCP overlay, and the Gemini query-string API key is intentionally hidden from tool arguments.
|
|
22
22
|
|
|
23
23
|
Set `TOKENLAB_MCP_TOOL_PROFILE=catalog` for the smallest public-only tool list or `TOKENLAB_MCP_TOOL_PROFILE=full` for the broad developer API. Tool names, descriptions, input JSON Schemas, HTTP bindings, content types, auth requirements, and task behavior can be inspected in [`generated/tools.json`](./generated/tools.json).
|
|
24
24
|
|
|
@@ -108,17 +108,20 @@ Use `delivery.mode` instead of assuming all image requests are synchronous. For
|
|
|
108
108
|
- `TOKENLAB_MCP_INLINE_BYTES`: optional maximum binary/JSON response size returned inline, defaults to `2097152` (2 MiB)
|
|
109
109
|
- `TOKENLAB_ARTIFACT_DIR`: optional output directory for non-inline response artifacts, defaults to the OS temp directory under `tokenlab-mcp`
|
|
110
110
|
|
|
111
|
+
For Chat Completions image inputs, prefer byte-accurate data URLs such as `data:image/png;base64,...`. If an MCP caller labels a recognized PNG, JPEG, WebP, or GIF payload as `application/octet-stream`, the server corrects that generic MIME before forwarding. An unrecognized generic binary payload is rejected locally with a precise input error.
|
|
112
|
+
|
|
111
113
|
## Contract Sync
|
|
112
114
|
|
|
113
115
|
The public OpenAPI document is the API contract source. The overlay contains only MCP-specific choices: profile exposure, stable tool aliases, secret omission, non-streaming constraints, content-type variants, async task semantics, and the compact public projection consumed by the website and docs gates.
|
|
114
116
|
|
|
115
117
|
```bash
|
|
116
|
-
npm run contract:
|
|
117
|
-
npm run contract:check
|
|
118
|
-
npm
|
|
118
|
+
npm run contract:source-check # compare the snapshot with the live canonical OpenAPI (read-only)
|
|
119
|
+
npm run contract:check # check generated output against the checked-in snapshot (offline)
|
|
120
|
+
npm run contract:sync # fetch OpenAPI and regenerate; refuses dirty outputs or a stale branch
|
|
121
|
+
npm test # compile profiles and test routing, tasks, files, and binary output
|
|
119
122
|
```
|
|
120
123
|
|
|
121
|
-
The scheduled `Sync TokenLab OpenAPI contract` workflow runs
|
|
124
|
+
Always run `git pull --ff-only` before a manual contract sync. `contract:check` proves internal consistency only; `contract:source-check` proves freshness against the canonical source. The scheduled `Sync TokenLab OpenAPI contract` workflow runs the full write sequence and commits only the verified OpenAPI snapshot and generated manifest to `main`. A failed fetch, stale local branch, dirty generated output, generation error, schema compilation error, or test leaves the tracked contract unchanged.
|
|
122
125
|
|
|
123
126
|
## MCP Registry Metadata
|
|
124
127
|
|
|
@@ -126,7 +129,7 @@ This repository includes `server.json` for the official MCP Registry.
|
|
|
126
129
|
|
|
127
130
|
Release metadata:
|
|
128
131
|
|
|
129
|
-
- npm package: `@tokenlabai/mcp-server@0.6.
|
|
132
|
+
- npm package: `@tokenlabai/mcp-server@0.6.12`
|
|
130
133
|
- MCP registry name: `io.github.hedging8563/tokenlab`
|
|
131
134
|
- `package.json.mcpName`: `io.github.hedging8563/tokenlab`
|
|
132
135
|
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"Video",
|
|
52
52
|
"Tasks",
|
|
53
53
|
"Models",
|
|
54
|
+
"Responses",
|
|
54
55
|
"Anthropic",
|
|
55
56
|
"Gemini",
|
|
56
57
|
"Files",
|
|
@@ -242,6 +243,7 @@
|
|
|
242
243
|
"omit_arguments": ["key"]
|
|
243
244
|
},
|
|
244
245
|
"createChatCompletion": {
|
|
246
|
+
"description": "Create an OpenAI-compatible chat completion. For inline image_url data URLs, declare the byte-accurate image MIME type. The MCP boundary corrects recognized PNG, JPEG, WebP, and GIF payloads declared as application/octet-stream and rejects unrecognized generic binary image payloads before sending a billable request.",
|
|
245
247
|
"input_property_overrides": {
|
|
246
248
|
"stream": {
|
|
247
249
|
"const": false,
|