Attach your own capabilities to an agent — register a running MCP server into Bailian (custom MCP), and package the team's workflow for upload (Skills) — including runtime mechanics and versioning.
Overview
In the earlier pages the agent used "platform-given" capabilities: the built-in toolkit (getting started), marketplace MCP services (production). This page goes the other way — attaching what you already have: register your running MCP server into Bailian (custom MCP), and package your team's workflow for upload (Skills).
Scenario: Luming Press's review assistant
"Luming Press" is a fictional book publisher whose content-ops team processes a large volume of submissions monthly. They hold two ready-made assets:
- An editorial-standards knowledge base — long since built on Bailian knowledge indexing (RAG), exposing a standard MCP endpoint. The pain: only application-side code could query it; a Managed Agent could not.
- A manuscript health-check workflow — a senior editor's "three looks": heading hierarchy, paragraph length, absolutist wording. Previously a manual checklist; now wanted as automatic agent behavior.
| Tier | Source | Maintained by | Where covered |
|---|---|---|---|
Built-in toolkit builtin_toolkit | Platform (bash / file I/O / web_search etc.) | Bailian | Getting started |
Marketplace MCP type: official | MCP marketplace services | Bailian marketplace | Production, multi-agent |
Your own assets type: customer | Your MCP server, your Skill packages | You | This page |
Custom MCP: register an existing MCP server into Bailian
Marketplace and custom
Bailian's MCP management has two tabs: marketplace (Bailian-hosted, ready to use — WebSearch lives here) and custom (your own MCP servers or third-party services). Custom supports four registration types: plugin, script deployment, AI gateway, and Alibaba Cloud OpenAPI.
This page's focus: the MCP server is already running (Luming's knowledge-base RAG endpoint) and only needs "one registration entry in Bailian". Choose script deployment with the HTTP deployment form (installation mode http) — note this step only registers (tells Bailian the endpoint address and auth method); it deploys nothing and incurs no deployment fee.
Open Managed Agent → MCP, switch to the custom tab, and click 创建MCP服务 (Create MCP Service) in the top right. In the type selector, choose 脚本部署 (script deployment).
After choosing script deployment, the form's installation mode offers
npx / uvx / http. npx / uvx genuinely deploy the service to Function Compute and bill by call duration and count; http is pure registration — it registers an existing endpoint only; the deployment-mode and region fields collapse, and no deployment fee accrues.http as the installation mode.
Example: register a Bailian RAG knowledge base MCP endpoint
Luming's editorial-standards knowledge base is built on Bailian knowledge indexing; its MCP endpoint is a fixed workspace-level address. Fill in the service name and description, and register the connection config in the MCP服务配置 (MCP service config) JSON:
typetakesstreamableHttp(the MCP standard HTTP transport), a single URL, stateless calls;sseis also supported;${workspaceId}inurlis your Bailian workspace ID (visible top-right in the console, shaped likellm-xxxx);headerscarries auth — the RAG endpoint uses a plain API Key (Bearer). Note: the key entered at registration is stored in Bailian's MCP configuration and attached by the platform when the agent calls it — no need to keep another copy in the agent's system prompt or a vault.
This example also dispels a common misconception: "custom MCP" does not require writing an MCP server from scratch. Any already-running service exposing an MCP endpoint — your business system's API gateway, a third-party SaaS MCP interface, even another cloud product (like Bailian knowledge indexing) — can be registered this way. Bailian does "registration + proxied calls", not "hosted runtime".
API mounting: type: customer
Once registered, note the service's service ID (of the form mcp-xxxxxxxx; the ID row on the card in the MCP management list). Fill name with the service ID, not the display name — the name field of type: customer resolves by ID despite its name; filling a display name returns AGENT_010 MCP Server lookup error. The mcp_servers field is the same as marketplace services, just with type: "customer":
$AGENTSTUDIO_URL and $DASHSCOPE_API_KEY see the production page. Enabling tools works exactly as with marketplace services: add an mcp_toolkit to tools, set mcp_server_name to the same service ID (it must match mcp_servers[].name), and enable each tool in configs[ ] (forgetting per-tool enabling leaves the tool silently absent at runtime — the pit is covered in the production page).
One important difference — the two types validate at completely different times:
type: official (marketplace) | type: customer (custom) | |
|---|---|---|
| Validation at declaration | No existence check — a name absent from the marketplace still creates successfully | Mandatory check — an unregistered name fails with 400 at creation |
| Failure mode | Tool silently absent at runtime; the agent says it has no tools | Fails at creation: AGENT_010 "MCP Server 校验失败: 查询MCP详情异常" |
| Troubleshooting difficulty | High (no error; the tool is simply missing and hard to notice) | Low (fails at creation) |
Skills: package the team's workflow for upload
MCP solves "the agent can call your services"; Skills solve "the agent works by your process". A Skill is a zip package: a manual (SKILL.md) plus bundled resources (scripts, templates, reference files) — zipped, uploaded, reviewed, and attached to an agent. The full SKILL.md authoring spec is in Agent Skills.
Packaging
The zip is at most 10 MB and must have SKILL.md at the root. The front matter declares name and description — the agent decides when to invoke the skill from the description.
Luming's "manuscript health check" skill, two files:
SKILL.md (the manual):
The upload chain (API)
Step one: upload as a plain file first (POST /files, multipart), take the file_id:
status: checking).
Step two: create the skill with the file_id (POST /skills; the request body has exactly this one field):
nameanddescriptionare parsed server-side from SKILL.md — the request body has neither field. Whatever the front matter says is what the skill is called; SKILL.md'snamebecomes the directory name in the sandbox later.- The first version number is auto-assigned as "1.0".
checking → active (mountable) / rejected (not mountable; the version detail lists issues by file path) → deleted.
Review is not second-scale — scripted uploads should not assume "upload then immediately mount": either poll GET /skills/{skill_id} until active, or make upload an async pipeline (upload → notify → mount).
Step four: attach to the agent:
skills[ ] entry has three fields: type (customer), skill_id, and version (must lock exactly one existing version; latest is not supported). Mount-validation error samples:
- Mounting a
checking-state skill →400 AGENT_010 "Skill 不存在或正在接受安全扫描: skill_xxx@1.0" - Mounting an active skill with version
9.9→ the same 400 (the message joinsskill_id@version, pinpointing the mismatched pair)
Runtime: how a skill gets "used"
Send a problem manuscript (heading skips + banned words + overlong paragraphs) to the agent with the skill attached, and the event history shows the mechanism in full:
- Skills are not pre-injected into the system prompt. On receiving a message the model itself decides to call a hidden tool
activate_skillwith the skill name — the SKILL.md (the manual) enters the conversation context only then. The benefit is obvious: attach ten skills without bloating the system prompt — loaded on demand. - The zip is unpacked into the sandbox at
/root/workspace/skills/<skill-name>/(directory name = SKILL.md'sname), and scripts referenced by the manual run directly via bash. Paths in SKILL.md's body should be written relative to the skill directory (e.g. plainmanuscript_check.py); the agentcds there itself. - The manual decides behavior; the script decides facts. What the agent does with the script's JSON is "consolidate + judge": the heading "第一章 绪论" (Chapter 1 Introduction) mechanically triggers the banned word "第一" (first); the agent's handling — "a chapter-numbering word triggered the match; recommend confirming with the proofreader whether ordinal uses of '第一' are exempt". The script does the scanning; the model does the judgment — the boundary most worth thinking through when designing a skill.
Versioning
Upload a new version (POST /skills/{skill_id}/versions; the body again has only file_id):
- Version numbers auto-increment by 0.1:
1.0→1.1→1.2… (the creation response'sversionis null, but the version list shows the new one immediately); - New versions pass the same security scan (checking → active, same order of duration);
- Mount locking: after
1.1becomes active, an agent mounted on1.0is untouched (GET /agents showsskills[0].version == "1.0"). To move the agent to the new version you must explicitly update its configuration — the same philosophy as agent version locking (getting started, Advanced: Prompt Versioning and Rollback): running things are not disturbed by background changes; - Two actual behaviors of the current upgrade window (while the new version is under review, minutes in practice):
latest_versionadvances to1.1as soon as the new version enters checking, not after approval; and during that window, creating an agent mounted on the older active version1.0is rejected (400 "Skill does not exist or is undergoing a security scan: ...@1.0"), and already-mounted agents may error while running. It recovers once the window ends, without any configuration change. When planning upgrades, avoid creating new agents in this window, or wait until the new version is active; - The version list
GET /skills/{id}/versionssorts newest first; GET /skills/{id}/versions/{version}/contentreturns an OSS pre-signed download URL — you can retrieve the exact package you uploaded (an audit asset: skill content is traceable).
SKILL_v2.md) do not block the upload and still pass review — audit your package contents before uploading; the review does not catch them for you.
Operations and cleanup
- Skill deletion is a hard delete — contrast agents/deployments, which are archive-only. Think before deleting: agents mounted on the old version lose their reference.
- Custom MCP is managed in the console (no API); skills are fully API-managed (this page) — the management entry points are opposites; don't mix them up.
- The
GET /skillslist also shows the health of every skill in the workspace (marketplace ones included) — glance at it during inspections.
Summary
| Want | Use | Key action |
|---|---|---|
| Platform execution capability (bash / file I/O / web) | builtin_toolkit | Getting started |
| Public generic services (search, document processing…) | Marketplace MCP (type: official) | Production |
| Your own MCP server (knowledge base, business system) | Custom MCP (type: customer) | Console registration (script deployment → http mode, registration-only and free) → API mounting |
| The team's workflow (checklists, scripts, templates) | Custom Skill | Package zip → API upload → review (minutes) → mount with locked version |
Next steps
- Agent Skills: the SKILL.md authoring spec and field validation rules.
- Agent MCP: mounting and approval.
- Getting Started: Build a Data Analysis Agent: built-in toolkit usage.