kwjm-mcp
Provides tools for text generation and image generation using OpenAI models (e.g., GPT, gpt-image-2) via OpenAI-compatible endpoints such as /v1/chat/completions and /v1/images/generations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kwjm-mcp帮我生成一段30秒的太空探索视频"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
开物基模 MCP Service (kwjm-mcp)
Based on the 开物基模 (kwjm.com) API, this is an MCP service. Any MCP-capable Agent tool only needs to configure the platform API Key once to call text / image / video models, and can clearly see the available scope and capability boundaries of each model.
Platform essence: 开物基模 is an AI model aggregation proxy (API Provider). Once you hold a platform token, you can use this service to call various model families (OpenAI, Seed/Seedance, DeepSeek, Qwen, Gemini, Anthropic, 快手可灵, etc.).
Features
Configure once, use everywhere: Set
KWJM_API_KEYto call models; additionally configure the non-secret fieldKWJM_API_KEY_IDto bind the default daily settlement query precisely to the current member Key.Capability discovery:
list_models/get_model_capabilitieslet the Agent see each model's modality, family, selection tier, aliases, and capability boundaries before calling.Multimodal calls: text (OpenAI
/v1/chat/completionsand Anthropic/v1/messages), image (/v1/images/generations,/v1/images/edits), video (async tasks including/v1,/v2,/v3and kling-specific endpoints).Misjudgment prevention rules (core design):
Default / fallback / off-by-default tiers:
defaultis preferred for the same kind of task,fallbackis the backup, andoff-by-defaultis only called when explicitly named—never touch unknown models by default.Ambiguity query: when a model is specified but version/name ambiguity exists (e.g., the
deepseekfamily), return a candidate list and let the user or Agent choose based on accurate context; do not guess.Real-time exact ID priority: the exact ID returned by
/v1/modelsis the final request value; aliases are only auxiliary entry points and cannot override same-name real-time IDs. For example,kw-video-v2*must be passed to the platform as-is.Default decision for same-kind tasks: for the same kind of task, the Agent decides which default model to use based on context, without forcing a query every time.
Capability boundary pre-check + proactive interception:
validate_requestvalidates user input before calling (reference image count upper limit, size/resolution/aspect-ratio/duration enums, and required error cases), proactively warns and gives correction suggestions when out of bounds;suggest_modelprovides default/fallback/off-by-default tiers by task.Human-readable error codes: error codes such as
401/403/429/500/503are internalized into a four-part structure of 'problem nature + original meaning + plain explanation + next-step guidance'. The Agent no longer just outputs status codes, but explains in plain language what happened, why, and what to do.
Related MCP server: Jimeng MCP Server
Quick Start
1. Install
npm install -g kwjm-mcpYou can also skip global installation and let the MCP client start via npx:
npx -y kwjm-mcp2. Configure API Key
In any MCP client's server configuration, pass the token via env:
Environment variable | Required | Description |
| Yes | 开物基模 platform token (Console → API Token) |
| Required for daily settlement | Numeric ID of the current token; used only for precise filtering in |
The API Base URL is fixed to the official https://kwjm.com and does not accept environment variable overrides, so the bearer token will not be accidentally sent to other sources.
3. Example using npx as the server command
npx -y kwjm-mcp
# 源码开发:npm install && npm run build && node dist/index.jsTools Overview
Tool | Description | Endpoint |
| List all models and capability metadata (modality/tier/aliases) | registry |
| Deep dive into a single model's capabilities and alias resolution | registry |
| Call |
|
| OpenAI-compatible text generation |
|
| Anthropic Messages text generation (Claude family) |
|
| Text-to-image (endpoint dispatched by model: | Dispatched |
| Image-to-image / editing |
|
| Text/image/reference-to-video generation, endpoint dispatched by model family (/v1, /v3, /v2, DashScope, kling) | Dispatched |
| Poll video/image task results (queryPath varies by model family) | Dispatched |
| Query the daily cost of the current |
|
| Query daily costs for all Keys in the same account only when |
|
| Query current account wallet balance |
|
Capability Atomization (Internalizing Real Documentation)
The model capability table is internalized item by item from the platform's 62 API documentation pages, covering the real end-to-end system:
Text:
/v1/chat/completions,/v1/responses,/v1/messages(gpt-5.2/5.4, deepseek-v3.2, qwen3, doubao-seed, gemini, Claude family)Image:
/v1/images/generations,/v1/images/edits,/v1/images/generations/tasks(async,-gpsuffix), DashScope equivalent, geminigenerateContentVideo (multi-endpoint system, async task polling):
/v1/videos/generations(doubao-seedance, wan series)/v3/contents/generations/tasks(kw-video-v2*exact models and dreamina-seedance compatible models)/v1/videos/text2video|image2video|video2video|reference(kling series)/v1/videos/create(veo3.1, sora-2-sp),/v1/videos(sora-2)/v2/video_generation(MiniMax-H3), DashScope/api/v1/services/aigc/video-generation/video-synthesis(wan2.7)
Exact ID rule:
kw-video-v2,kw-video-v2-fast,kw-video-v2-mini,kw-video-v2.5are independent platform IDs and are not mapped to dreamina IDs.
About Selection Rules (Important)
Default models: text
gpt-5.2-pro-2025-12-11; imagegpt-image-2; videokw-video-v2. When a same-kind task is not specified, the Agent uses them by default.Ambiguity: when the input matches multiple candidates (e.g., the
wan,klingfamilies with multiple versions) → the tool returns a candidate list; call only after confirmation.Off-by-default: marked models such as
claude-opus-4-8,gpt-image-2-gp(async),grok-imagineare not called unless explicitly specified (explicit: true).
Testing
npm test # 单元 + 端到端(无需平台 key;e2e 验证防误判规则在协议层生效)
npm run test:live # 只读实时模型校验;不会触发生成
npm run test:live:text
KWJM_LIVE_COST_ACK=image npm run test:live:image
KWJM_LIVE_COST_ACK=video npm run test:live:video
KWJM_LIVE_COST_ACK=video-reference npm run test:live:video-referenceThe daily settlement interface only provides Key lists at the account level; therefore, the default current-member query must use KWJM_API_KEY_ID for precise binding. get_account_daily_costs also requires explicitly passing all_keys=true to prevent ordinary cost queries from accidentally expanding to other members of the same account.
Agent Integration Guide
Design Documents
Directory Structure
src/
core/
types.ts 类型:能力/层级/别名
registry.ts 策展能力表 + 选择规则 + 别名映射 + refresh 合并
client.ts HTTP 封装(鉴权/错误归一化)
handlers/
result.ts MCP 结果/错误封装
guard.ts 防误判守卫(歧义/off-by-default)
discovery.ts list_models / get_model_capabilities / refresh_models
text.ts chat_completions / messages
image.ts generate_image / edit_image
video.ts generate_video / get_video_result
usage.ts 当前 Key / 全账户日结与钱包查询
index.ts MCP Server 引导
test/ 单元 / 端到端 / 实时集成测试This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Wan AI video generation
MCP server for Qwen Image 3 AI image generation
MCP server for MiniMax H3 multimodal video generation
Multi-model AI image and video generator. 14 models behind one OAuth-secured MCP endpoint.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables AI applications to access 20+ model providers (including OpenAI, Anthropic, Google) through a unified interface for text and image generation.230MIT
- FlicenseNot gradedqualityCmaintenanceA Model Context Protocol server for AI image and video generation using Jimeng AI, enabling text-to-image, image composition, text-to-video, and image-to-video through Claude Desktop and other MCP clients.78-
- FlicenseAqualityDmaintenanceAn MCP server that provides a standardized interface for accessing WaveSpeed AI's image and video generation capabilities, including text-to-image, image-to-image, inpainting, and dynamic video generation.3-
- AlicenseAqualityCmaintenanceMCP server for generating images and videos using Volcengine's Jimeng APIs, supporting text-to-image, image-to-image, multi-image fusion, text-to-video, and image-to-video.31MIT