Skip to main content
ClaudeWave
hedging8563 avatar
hedging8563

tokenlab-mcp-server

Ver en GitHub

OpenAPI-generated MCP server for TokenLab text, image, video, music, 3D, audio, files, embeddings, rerank, translation, and async tasks.

MCP ServersRegistry oficial0 estrellas1 forksJavaScriptMITActualizado today
ClaudeWave Trust Score
95/100
Verified
Passed
  • Open-source license (MIT)
  • Actively maintained (<30d)
  • Clear description
  • Topics declared
  • Documented (README)
Last scanned: 9/17/2026
Install in Claude Code / Claude Desktop
Method: NPX · @tokenlabai/mcp-server
Claude Code CLI
claude mcp add tokenlab -- npx -y @tokenlabai/mcp-server
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "tokenlab": {
      "command": "npx",
      "args": ["-y", "@tokenlabai/mcp-server"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
Casos de uso

Resumen de MCP Servers

# TokenLab MCP Server

[![CI](https://github.com/hedging8563/tokenlab-mcp-server/actions/workflows/ci.yml/badge.svg)](https://github.com/hedging8563/tokenlab-mcp-server/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/%40tokenlabai%2Fmcp-server)](https://www.npmjs.com/package/@tokenlabai/mcp-server)
[![npm downloads](https://img.shields.io/npm/dm/%40tokenlabai%2Fmcp-server)](https://www.npmjs.com/package/@tokenlabai/mcp-server)

OpenAPI-generated Model Context Protocol server for TokenLab public model discovery, pricing, native LLM endpoints, 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, 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.20 generates 78 endpoint tools; with the two MCP-only composite discovery tools, the full profile returns 80 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) | 29 | 31 | Portable | Catalog and pricing; Chat Completions, Responses, Anthropic Messages, Gemini generateContent; images, video, music, 3D, speech and transcription; async tasks; files; embeddings, rerank, and translation |
| `full` | 78 | 80 | 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, 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` 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.

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 100 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.

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`](./generated/tools.json).

The smaller [`generated/public-contract.json`](./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.

## Native MCP Features

- JSON tool responses include `structuredContent` while retaining serialized text for older clients.
- HTTP errors retain the original response text (up to 4,000 characters), including public correction hints, alongside structured status, request ID and retry timing. Only the request ID and retry headers are exposed; failed generation requests are never submitted again automatically.
- Generated tools expose human-readable titles, standard read-only/destructive/idempotent/open-world annotations, and response request IDs when available.
- Tool schemas are published and validated directly as JSON Schema. The runtime does not round-trip generated tool schemas through Zod; `exact` mode is byte-shape equivalent to the generated canonical schema.
- Three resources expose the live API overview, the package's OpenAPI snapshot, and the compact MCP public contract.
- `choose_tokenlab_model` and `build_tokenlab_request` prompts guide agents to use live model truth and preserve native endpoint shapes.
- Server instructions tell clients to confirm billable or destructive operations and treat external model/API output as untrusted content.

## Run

```bash
npm install
npm start
```

Install from npm:

```bash
npx -y @tokenlabai/mcp-server
```

Agent-assisted installers can follow [`llms-install.md`](./llms-install.md) for a credential-safe setup and verification flow.

Run in Docker:

```bash
docker build -t tokenlab-mcp-server .
docker run --rm -i tokenlab-mcp-server
```

Add `-e TOKENLAB_API_KEY` when using credentialed API tools. Public catalog tools do not require a key.

Claude Desktop style config:

```json
{
  "mcpServers": {
    "tokenlab-model-catalog": {
      "command": "npx",
      "args": ["-y", "@tokenlabai/mcp-server"],
      "env": {
        "TOKENLAB_API_BASE": "https://api.tokenlab.sh"
      }
    }
  }
}
```

No TokenLab API key is required for public catalog and pricing operations. Set `TOKENLAB_API_KEY` when credentialed tools should call TokenLab APIs. Generated tools preserve the OpenAPI request shape for OpenAI-compatible and native endpoints instead of flattening them into a shared prompt format.

Multipart operations accept local file paths. Small image and audio responses are returned as native MCP content; larger or other binary responses are written to `TOKENLAB_ARTIFACT_DIR` and returned as a path with MIME type and byte count.

## Sync and Async Media Results

Video, music, and 3D creation tools always return an async task. Image generation and editing may return a completed result or an async task depending on the selected model and request.

Media tools preserve the complete TokenLab API response under `response` and add a normalized `delivery` summary:

```json
{
  "delivery": {
    "mode": "async",
    "task_id": "ldtask_...",
    "status": "pending",
    "poll_url": "/v1/tasks/ldtask_...",
    "terminal": false,
    "next_tool": "get_task_status"
  },
  "response": {}
}
```

Use `delivery.mode` instead of assuming all image requests are synchronous. For async tasks, call `get_task_status` with `{ "id": delivery.task_id }` until `delivery.terminal` is `true`. Completion is determined from `status`, not from an optional progress field.

## Environment

- `TOKENLAB_API_BASE`: optional, defaults to `https://api.tokenlab.sh`
- `TOKENLAB_API_KEY`: optional; required for text inference, multimodal generation, async task, embedding, rerank, and translation tools
- `TOKENLAB_MCP_TOOL_PROFILE`: optional, `catalog`, `core` (default), or `full`
- `TOKENLAB_MCP_SCHEMA_MODE`: optional, `portable`, `exact`, or `strict`; defaults to the selected profile's tested mode
- `TOKENLAB_REQUEST_TIMEOUT_MS`: optional request timeout in milliseconds, defaults to `120000`
- `TOKENLAB_MCP_MAX_FILE_BYTES`: optional maximum local upload size per file, defaults to `104857600` (100 MiB)
- `TOKENLAB_MCP_INLINE_BYTES`: optional maximum binary/JSON response size returned inline, defaults to `2097152` (2 MiB)
- `TOKENLAB_ARTIFACT_DIR`: optional output directory for non-inline response artifacts, defaults to the OS temp directory under `tokenlab-mcp`

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.

## Contract Sync

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.

```bash
npm run contract:source-check # compare the snapshot with the live canonical OpenAPI (read-only)
npm run contract:check        # check generated output against the checked-in snapshot (offline)
npm run contract:sync         # fetch OpenAPI and regenerate; refuses dirty outputs or a stale branch
npm test                      # compile profiles and test exact/portable/strict schemas, provider conversion, routing, tasks, files, and binary output
```

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.

## MCP Registry Metadata

This repository includes `server.json` for the official MCP Registry.

Release metadata:

- npm package: `@tokenlabai/mcp-server@0.6.20`
- MCP registry name: `io.github.hedging8563/tokenlab`
- `package.json.mcpN
ai-apianthropic-messagesembeddingsgeminiimage-generationllm-gatewaymcpmodel-context-protocolmodel-routingmultimodalnative-endpointsopenai-compatibleresponses-apitext-to-speechtokenlabvideo-generation

Lo que la gente pregunta sobre tokenlab-mcp-server

¿Qué es hedging8563/tokenlab-mcp-server?

+

hedging8563/tokenlab-mcp-server es mcp servers para el ecosistema de Claude AI. OpenAPI-generated MCP server for TokenLab text, image, video, music, 3D, audio, files, embeddings, rerank, translation, and async tasks. Tiene 0 estrellas en GitHub y su última actualización registrada es del 2026-09-16.

¿Cómo se instala tokenlab-mcp-server?

+

Puedes instalar tokenlab-mcp-server clonando el repositorio (https://github.com/hedging8563/tokenlab-mcp-server) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.

¿Es seguro usar hedging8563/tokenlab-mcp-server?

+

Nuestro agente de seguridad ha analizado hedging8563/tokenlab-mcp-server y le ha asignado un Trust Score de 95/100 (tier: Verified). Revisa el desglose completo de comprobaciones superadas y flags en esta página.

¿Quién mantiene hedging8563/tokenlab-mcp-server?

+

hedging8563/tokenlab-mcp-server es mantenido por hedging8563. La última actividad registrada en GitHub es del 2026-09-16, con 1 issues abiertos.

¿Hay alternativas a tokenlab-mcp-server?

+

Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.

Despliega tokenlab-mcp-server en tu cloud

Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.

¿Mantienes este repo? Añade un badge a tu README

Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.

Featured on ClaudeWave: hedging8563/tokenlab-mcp-server
[![Featured on ClaudeWave](https://claudewave.com/api/badge/hedging8563-tokenlab-mcp-server)](https://claudewave.com/repo/hedging8563-tokenlab-mcp-server)
<a href="https://claudewave.com/repo/hedging8563-tokenlab-mcp-server"><img src="https://claudewave.com/api/badge/hedging8563-tokenlab-mcp-server" alt="Featured on ClaudeWave: hedging8563/tokenlab-mcp-server" width="320" height="64" /></a>

Más MCP Servers

Alternativas a tokenlab-mcp-server