OpenAPI-generated MCP server for TokenLab model discovery, pricing, chat, native System One decisions, media, files, embeddings, webhooks and async tasks.
TokenLab MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
OpenAPI-generated Model Context Protocol server for TokenLab public model discovery, pricing, native LLM endpoints, typed decisions, multimodal generation, async tasks, files, embeddings, rerank, translation, resources, prompts, and the broader developer API.
It exposes public catalog tools for agents that need to choose models, inspect supported request formats, or compare pricing before calling TokenLab APIs. Credentialed tools cover text inference, image generation and editing, video, music, 3D, async task polling, embeddings, rerank, typed decisions, and text translation.
Generated Tool Profiles
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.30 generates 87 endpoint tools; with the two MCP-only composite discovery tools, the full profile returns 89 tools from tools/list.
| Profile | Endpoint tools | Total registered tools | Model-facing schema | Coverage |
| --- | ---: | ---: | --- | --- |
| catalog | 4 | 6 | Exact | Public model discovery and pricing only; no API key required |
| core (default) | 30 | 32 | Portable | Catalog and pricing; Chat Completions, Responses, Anthropic Messages, Gemini generateContent; System One typed decisions; images, video, music, 3D, speech and transcription; async tasks; files; embeddings, rerank, and translation |
| full | 87 | 89 | Portable | Every allowlisted developer API operation in the checked-in OpenAPI snapshot, including core plus response lifecycle, batches, worlds, and native model discovery |
The total registered count is the number returned by tools/list. All profiles include compare_models and get_api_overview, producing totals of 6, 32, and 89 tools. Realtime and streaming-only operations are excluded because stdio MCP tool calls return one final result. API operations that accept stream fix it internally to false without exposing a boolean const to provider adapters, and the Gemini query-string API key is intentionally hidden from tool arguments. create_gemini_content exposes the camelCase Gemini fields (systemInstruction, generationConfig, safetySettings, toolConfig, cachedContent) and hides their snake_case proto spellings, which the API accepts as aliases.
The portable projection keeps every top-level argument but bounds deeply nested model-facing shapes. The server still validates calls against the complete generated OpenAPI schema before issuing an API request. Compatibility budgets keep core at no more than 60 KB and depth 8, and full at no more than 115 KB and depth 8 for the complete tools/list response. Tests also run the full profile through the Google AI SDK version used by the observed OpenCode/Gemini failure and keep its function declarations within 90 KB.
Set TOKENLAB_MCP_TOOL_PROFILE=catalog for the smallest public-only tool list or TOKENLAB_MCP_TOOL_PROFILE=full for the broad developer API. Set TOKENLAB_MCP_SCHEMA_MODE=exact only when a client needs the complete nested JSON Schema and can accept its larger/deeper tool payload. Use strict for providers that require every property to be listed in required and every object to set additionalProperties: false; complex top-level arguments are represented as JSON-encoded strings and decoded before canonical validation. Canonical tool names, descriptions, input JSON Schemas, HTTP bindings, content types, auth requirements, and task behavior can be inspected in generated/tools.json.
The smaller generated/public-contract.json is the machine-readable projection used by TokenLab's website and other public consumers. It contains package identity, profile counts, core tool layers, resources, prompts, and source hashes without copying all endpoint schemas.