bailian-tools-mcp
Integrates with Alibaba Cloud Model Studio's built-in tools through its Responses API, enabling web search, URL extraction, Python code execution in Alibaba's sandbox, reverse image search, and text-to-image search using Model Studio API keys.
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., "@bailian-tools-mcp search the web for the latest Node.js LTS release and summarize it"
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.
bailian-tools-mcp
MCP server that puts Alibaba Cloud Model Studio's built-in tools into coding agents — web search, web extractor, Python code interpreter, reverse image search and text-to-image search — using Token Plan (or pay-as-you-go) API keys.
Works with OpenCode, Claude Code, Codex, and any MCP client that speaks stdio.
Why this exists
Model Studio's built-in tools are only reachable through the Responses API (POST /compatible-mode/v1/responses with tools: [...]). Coding agents do not call it:
enable_search: trueon/chat/completionsis accepted with HTTP 200 and silently ignored — the model still answers that it cannot browse.The official MCP gateways (
https://ws-<workspace>.<region>.maas.aliyuncs.com/api/v1/mcps/EnhancedSearch/mcp) reject Token Plan keys with401 InvalidApiKey; they need a workspace-scoped pay-as-you-go key.bailianCLI'ssearch webrefuses thetoken-planprofile, and it is a client, not an MCP server.OpenCode's native
websearchtool only supports Exa, Firecrawl, Parallel, Tavily and TinyFish.
So this server does the one missing hop: MCP tools → Responses API built-in tools, on the key you already pay for.
Related MCP server: MiniMax Coding Plan MCP
Requirements
Node.js 18.17 or newer (no dependencies, no build step)
A Model Studio API key. Token Plan keys work as-is; the key needs only the model-inference scope.
Run
export BAILIAN_API_KEY=sk-... # PowerShell: $env:BAILIAN_API_KEY = "sk-..."
npx -y github:niradler/bailian-tools-mcpThe process speaks MCP over stdio and logs to stderr. Nothing is written to disk.
If you already use the bailian CLI, you can skip the env var: with BAILIAN_API_KEY unset, the server uses the active profile in ~/.bailian/config.json.
Environment variables
Variable | Default | Purpose |
| — (required unless a CLI profile exists) | Model Studio API key |
|
| Path to a |
|
| OpenAI-compatible endpoint; set this for another region or a workspace URL |
|
| Model that executes search, extraction and code tools. Must support the Responses API |
|
| Model for |
|
| Per-request timeout |
| unset |
|
Any model that supports the Responses API works (deepseek-v4.1-flash-1017, qwen3.8-max, qwen3.8-flash, qwen4-max-preview, …). Tool coverage varies by model: DeepSeek handles web_search, web_extractor and code_interpreter but rejects image_search / web_search_image, which is why the image tools use BAILIAN_IMAGE_MODEL (a Qwen model) independently of BAILIAN_MODEL. See the built-in tools docs.
Tools
Tool | What it does | Upstream |
| Live web search with a synthesized answer and source links |
|
| Reads one or more URLs for a stated goal |
|
| Runs Python in Alibaba's sandbox, returns answer, code and output |
|
| Reverse image search from an image URL |
|
| Finds images on the web from a description |
|
web_extract always sends web_search alongside, because the API rejects web_extractor on its own (The web_extractor tool must be executed with web_search tool).
OpenCode
1.x (mcp is a map)
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"bailian-tools": {
"type": "local",
"command": ["npx", "-y", "github:niradler/bailian-tools-mcp"],
"environment": {
"BAILIAN_API_KEY": "{env:BAILIAN_API_KEY}"
}
}
}
}2.x (mcp.servers)
{
"mcp": {
"servers": {
"bailian-tools": {
"type": "local",
"command": ["npx", "-y", "github:niradler/bailian-tools-mcp"],
"environment": {
"BAILIAN_API_KEY": "{env:BAILIAN_API_KEY}"
}
}
}
}
}Or from the CLI:
opencode mcp add bailian-tools --env BAILIAN_API_KEY={env:BAILIAN_API_KEY} -- npx -y github:niradler/bailian-tools-mcp
opencode mcp listSet BAILIAN_API_KEY in your shell profile (setx BAILIAN_API_KEY "sk-..." on Windows) — keep the key out of the config file. Start a new session after adding the server so the tools are offered to the model.
Claude Code
claude mcp add bailian-tools -e BAILIAN_API_KEY=sk-... -- npx -y github:niradler/bailian-tools-mcpCodex
# ~/.codex/config.toml
[mcp_servers.bailian-tools]
command = "npx"
args = ["-y", "bailian-tools-mcp"]
env = { BAILIAN_API_KEY = "sk-..." }
[mcp_servers.bailian-tools.env]
BAILIAN_TIMEOUT_MS = "180000"Cost
Each tool call is a model request plus the upstream tool fee, billed to your plan Credits or pay-as-you-go account. Web search is the expensive one: the agent policy is $10 per 1,000 calls in Singapore versus $0.573411 in Frankfurt, Virginia, Hong Kong and Tokyo. Keep web_search for questions that need current data; local file reads are free. Set max_output_tokens when you only need a short answer.
The server states this in its MCP instructions and appends a footer to every result, so the agent asks before bulk work instead of quietly burning Credits. Set BAILIAN_COST_NOTICE=off to silence the footer if your client already enforces its own budget.
The notices stay compact on purpose: the whole tools/list payload is about 1.5 k characters (~390 tokens), because tool descriptions ride along on every request. Run npm run describe to print exactly what your agent receives.
Troubleshooting
Symptom | Cause / fix |
| Export the key in the environment OpenCode starts from, then restart the session |
| Key is wrong, revoked, or from another region. Token Plan keys only work on the |
| Use this server's |
| Plan rate limit or Credits exhausted — check |
| Set |
Tools listed but the model never calls them | The model needs tool calling; |
Security
No credentials in this repository. Keys come from the environment, the server keeps no state, and tool output is untrusted web content — see SECURITY.md.
License
MIT
Available Tools
5 toolscode_interpreterCode interpreter (Model Studio sandbox)A
Run Python in Model Studio's sandbox for calculations, data analysis, file parsing and charting. Send the task, not necessarily the code; returns the answer plus the executed code and output. Billed to your Model Studio plan (~$10/1k web searches in Singapore) — ask before bulk use.
Inputs: task (required), max_output_tokens.
image_searchSearch by image (Model Studio)B
Reverse image search: find visually similar images or trace where an image comes from, using Model Studio's image_search tool. Billed to your Model Studio plan (~$10/1k web searches in Singapore) — ask before bulk use.
Inputs: image_url (required), query, max_output_tokens.
text_to_image_searchText-to-image search (Model Studio)A
Find images on the web from a text description using Model Studio's web_search_image tool. Use for visual answers, illustration hunting and image recommendations. Billed to your Model Studio plan (~$10/1k web searches in Singapore) — ask before bulk use.
Inputs: query (required), max_output_tokens.
web_extractWeb extractor (Model Studio)A
Fetch one or more URLs through Model Studio's web_extractor tool and return the extracted content, summarized for a given goal. Use when a page must be read rather than searched. Billed to your Model Studio plan (~$10/1k web searches in Singapore) — ask before bulk use.
Inputs: urls (required), prompt, max_output_tokens.
web_searchWeb search (Model Studio)A
Search the live web through Alibaba Cloud Model Studio's built-in web_search tool. Returns a synthesized answer with source links. Use for news, prices, releases and anything after your training cutoff. Billed to your Model Studio plan (~$10/1k web searches in Singapore) — ask before bulk use.
Inputs: query (required), max_output_tokens.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a distinct role: web_search (query the web), web_extract (read specific URLs), code_interpreter (execute Python), image_search (reverse image lookup), and text_to_image_search (find images from a description). The only mild confusion is between image_search and text_to_image_search, but the descriptions clarify that one is reverse lookup and the other is description-based discovery.
Naming is mostly snake_case with verb_noun structure (web_search, web_extract, image_search). Minor deviations exist: code_interpreter is a noun with no verb, and text_to_image_search adds a direction word, but the set remains readable and predictable.
Five tools is a well-scoped set for the server's purpose of exposing Model Studio's built-in capabilities. Each tool maps to a distinct underlying capability, with no redundant or filler entries.
The surface covers the core Model Studio tools: search, extract, code execution, reverse image lookup, and text-to-image search. Minor gaps could include browsing/crawling or structured data extraction, but agents can work around these with the existing search and extract tools.
Maintenance
Related MCP Connectors
30+ web-access and AI APIs behind one key: search, scraping, browsers, voice, OCR and LLMs.
AI agent tools: web search, browser, 400+ LLMs, image gen, TTS, phone verify. Pay-per-use.
Web search, browser automation, scraping, crawling and CAPTCHA solving for AI agents.
Web search, page reading, HTML to PDF, file upload and flight search for AI agents, paid in USDC.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceExposes Qwen AI Token Plan's harness tools (web search, web extraction, code interpreter, text-to-image, and image-to-image search) as MCP tools. It enables agents to perform real-time web searches, extract webpage content, execute code in a sandbox, and search images by text or image queries.-
- FlicenseNot gradedqualityAmaintenanceEnables coding-plan users to run web searches that return organic results plus related queries, and to analyze images from URLs or local files using an AI vision model driven by text prompts. It plugs these tools into MCP clients such as Claude Desktop, Cursor, Windsurf, and OpenAI Agents to support code development workflows.-
- FlicenseNot gradedqualityAmaintenanceEnables MCP clients such as Claude Desktop, Cursor, and Windsurf to perform web searches and analyze images through MiniMax APIs, returning structured search results and AI-generated answers about images from URLs or local files. It is tailored for coding-plan users working in code development workflows.-
- FlicenseNot gradedqualityAmaintenanceEnables coding-plan users to perform AI-powered web searches and analyze images through MCP clients, returning structured search results and prompt-based image understanding for code development workflows.-