# hedging8563/tokenlab-mcp-server [Health: Active]

**Category:** 🔗 Aggregators  
**Repository:** https://github.com/hedging8563/tokenlab-mcp-server  
**GitHub Stars:** 1  
**npm Downloads (last month):** 5425  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/hedging8563-tokenlab-mcp-server

## Description
TokenLab AI gateway MCP server for model and pricing discovery, OpenAI-compatible Chat Completions, and native Responses, Anthropic Messages, and Gemini inference. Catalog tools require no API key; inference tools use an optional TokenLab key.

## Tools
Capabilities this server exposes over MCP:

- **cancel_task** — Cancel async task Cancels a queued asynchronous task when cancellation is supported for the selected task. Cancellation currently supports queued Seedance video tasks (`seedance-1.5-pro`, `seedance-2.0`, and `seedance-2.0-fast`) while they are still waiting to run. Tasks that are already processing, completed, failed, expired, or unsupported are not cancelled.
- **create_3d_model** — Create 3D model generation task Creates a 3D model generation task using Tripo3D. Returns a task ID for polling.
- **create_anthropic_message** — Create message (Anthropic-compatible) Creates a model response using Anthropic's native request format. Supports Claude models with vision and streaming. **Authentication:** Use `x-api-key` header or `Authorization: Bearer` header.
- **create_chat_completion** — 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.
- **create_embedding** — Create embeddings Creates an embedding vector representing the input text.
- **create_gemini_content** — Generate content (Gemini-compatible) Generates content using the native Gemini GenerateContent shape. This route is exposed only when the model details advertise Gemini requests and a same-protocol route is currently available. ProtoJSON lowerCamelCase and original proto snake_case field names are preserved. Unknown fields are forwarded best-effort and support is determined by the selected provider. **Authentication:** Use `?key=` query parameter, `x-goog-api-key` header, or `Authorization: Bearer` header.
- **create_image** — Create image Creates an image given a prompt.
- **create_image_file** — Create image Creates an image given a prompt.
- **create_multimodal_embedding** — Create multimodal embeddings Creates embeddings for multimodal input items. Text input is generally available; image input may require feature enablement.
- **create_music** — Create music generation task Creates a music generation task using Suno. Returns a task ID for polling.
- **create_response** — Create response (OpenAI Responses API) Creates a response using the native OpenAI Responses API shape. The model details must advertise the Responses request format and a same-protocol route must be currently available; model names and providers do not imply availability. Unknown request fields are forwarded on a best-effort basis and remain subject to the selected provider's support.
- **create_speech** — Create speech Generates audio from the input text (Text-to-Speech).
- **create_video** — Create video generation task Creates an asynchronous video generation task. The response returns a canonical task ID and usually a preferred `poll_url`; clients should poll `poll_url` first, or use `/v1/tasks/{id}` as the fixed status endpoint.
- **delete_file** — Delete file Deletes a batch file or a bound image/reference file. When the request includes anthropic-beta: files-api-2025-04-14, the route uses Anthropic Files API mode for the bound workspace.
- **edit_image** — Edit image Edits an image using multipart image uploads, JSON image URLs, or the official JSON images array for supported GPT Image models.
- **edit_image_file** — Edit image Edits an image using multipart image uploads, JSON image URLs, or the official JSON images array for supported GPT Image models.
- **get_model** — Get model Retrieves current model details, including supported operations, request parameters, request endpoints, selector limits, and pricing when available. Non-chat integrations should read these current model-specific request details before creating a request.
- **get_model_pricing** — Get model pricing Retrieves pricing-only detail for one model. Use this endpoint for price explanation, not for non-chat request construction.
- **get_pricing** — List model pricing Returns the public pricing surface for active models, with optional provider and tag filters.
- **get_task_status** — Get async task status Retrieves the status and result of an asynchronous generation task. Prefer the `poll_url` returned by the create response; `/v1/tasks/{id}` is the canonical fixed status endpoint for video, music, and 3D jobs.
- **list_files** — List files
- **list_models** — List models Lists the currently available models. Use `view=compact` for model selection and `view=full` for the existing OpenAI-compatible discovery shape. Native API calls default to `full`; integrations may choose `compact` as their default. Non-chat recommendations are available through `recommended_for`.
- **rerank_documents** — Rerank documents Reranks documents by relevance to a query using semantic similarity.
- **retrieve_file** — Retrieve file
- **retrieve_file_content** — Retrieve file content
- **transcribe_audio** — Create transcription Transcribes audio into text (Speech-to-Text).
- **translate_audio** — Translate audio Transcribes audio and translates the result to English.
- **translate_text** — Translate text Translates text into a target language using the current translation request format.
- **upload_file** — Upload file Uploads a TokenLab/OpenAI-compatible batch or image file. With anthropic-beta: files-api-2025-04-14, uploads an Anthropic Files resource without a purpose field and returns Anthropic file metadata.
- **compare_models** — Compare public TokenLab model details and pricing for several model IDs.
- **get_api_overview** — Fetch TokenLab's agent-readable API overview.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "tokenlab-mcp-server": {
    "command": "npx",
    "args": ["-y","@tokenlabai/mcp-server"],
    "env": {
      "TOKENLAB_API_BASE": "",
      "TOKENLAB_API_KEY": "",
      "TOKENLAB_MCP_TOOL_PROFILE": "",
      "TOKENLAB_MCP_SCHEMA_MODE": "",
      "TOKENLAB_REQUEST_TIMEOUT_MS": "",
      "TOKENLAB_MCP_MAX_FILE_BYTES": "",
      "TOKENLAB_MCP_INLINE_BYTES": "",
      "TOKENLAB_ARTIFACT_DIR": ""
    }
  }
}
```

**Requires environment variables:** `TOKENLAB_API_BASE`, `TOKENLAB_API_KEY`, `TOKENLAB_MCP_TOOL_PROFILE`, `TOKENLAB_MCP_SCHEMA_MODE`, `TOKENLAB_REQUEST_TIMEOUT_MS`, `TOKENLAB_MCP_MAX_FILE_BYTES`, `TOKENLAB_MCP_INLINE_BYTES`, `TOKENLAB_ARTIFACT_DIR` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What hedging8563/tokenlab-mcp-server does

hedging8563/tokenlab-mcp-server connects MCP clients to TokenLab’s public model directory and developer API. Agents can inspect available models, retrieve model-specific capabilities and pricing, compare several models, and list public prices with provider or tag filters. Catalog operations are available without an API key.

Credentialed operations cover OpenAI-compatible Chat Completions, the OpenAI Responses API, Anthropic Messages, and Gemini GenerateContent. Additional tools support image creation and editing, speech synthesis, transcription, audio translation, text translation, embeddings, multimodal embeddings, document reranking, and file upload, listing, retrieval, and deletion. Video, music, and 3D generation are represented as asynchronous jobs.

## How it works

The server is generated from TokenLab’s public OpenAPI contract with an MCP-specific overlay. It preserves native request shapes instead of converting every provider to one shared prompt format. Gemini fields use the API’s camelCase representation, while the server validates calls against the full generated schema before sending requests.

Three exposure profiles control the published tool set:

- `catalog` provides the smallest public discovery and pricing surface.
- `core` is the default and includes catalog, inference, media, task, file, embedding, reranking, and translation operations.
- `full` exposes the broader allowlisted developer API, including additional lifecycle and batch operations.

Responses include structured MCP content alongside serialized text. Media creation returns a normalized delivery summary. When a request is asynchronous, the response supplies a task ID and usually a polling URL; call `get_task_status` until the task reaches a terminal state. The server also publishes resources for the live API overview, OpenAPI snapshot, and compact MCP contract, plus prompts that help agents select models and build requests.

## Setup and configuration

Install from npm with `npx -y @tokenlabai/mcp-server`, or install the package and run `npm start`. The server can also run in Docker and communicates over standard input and output. A typical client configuration sets `TOKENLAB_API_BASE`, which defaults to `https://api.tokenlab.sh`.

Set `TOKENLAB_API_KEY` for inference, media generation, asynchronous tasks, embeddings, reranking, decisions, and translation. Select the published surface with `TOKENLAB_MCP_TOOL_PROFILE`. `TOKENLAB_MCP_SCHEMA_MODE` accepts `portable`, `exact`, or `strict`; portable is the tested default for the selected profile, while exact publishes complete nested schemas and strict targets clients requiring explicit required properties and closed objects.

`TOKENLAB_REQUEST_TIMEOUT_MS` controls request timeouts. `TOKENLAB_MCP_MAX_FILE_BYTES` limits local uploads, and `TOKENLAB_MCP_INLINE_BYTES` controls how much binary or JSON output is returned inline. Larger responses are written to `TOKENLAB_ARTIFACT_DIR`, which defaults to a temporary `tokenlab-mcp` directory.

## Tools and capabilities

- Discover models with `list_models` and inspect individual model support with `get_model`.
- Read prices using `get_pricing` or `get_model_pricing`, and compare several models with `compare_models`.
- Send requests through Chat Completions, Responses, Anthropic Messages, or Gemini GenerateContent.
- Generate or edit images and create speech, transcriptions, translations, video, music, and 3D jobs.
- Create and poll asynchronous tasks, including cancellation for supported queued Seedance video jobs.
- Upload, enumerate, retrieve, and delete TokenLab-compatible files.
- Create text or multimodal embeddings and rerank documents.

## Limitations and notes

Realtime and streaming-only operations are excluded because stdio MCP calls return one final result. Requests that accept streaming are internally fixed to non-streaming behavior. Video, music, and 3D creation always run asynchronously; image operations may be synchronous or asynchronous depending on the selected model, so clients should inspect the delivery mode rather than assume an immediate result.

Multipart tools accept local file paths. Small audio and image results can be returned as native MCP content, while larger or other binary results are stored as artifacts. For inline Chat Completions images, use byte-accurate PNG, JPEG, WebP, or GIF data URLs. Recognized images labeled as generic octet-stream are corrected, but unrecognized generic binary image data is rejected before a billable request.

_Full upstream README: https://allmcps.com/mcp/hedging8563-tokenlab-mcp-server/readme_

