Alibabacloud Mcp Core Script Generate logo

Alibabacloud Mcp Core Script Generate

Organization
aliyun
alibabacloud-mcp-core-script-generate

Generate Alibaba Cloud MCP Core RunScript-compatible Python scripts from natural-language cloud operation requests. Use when the user explicitly asks for RunScript scripts, MCP Core scripts, or sandbox-compatible cloud automation code. For standard SDK Python code with imports and credentials, use `alibabacloud-sdk-usage` instead.

Overview

Publisheraliyun
Repositoryalibabacloud-agent-toolkit
Skill namealibabacloud-mcp-core-script-generate
Stars
29
Forks
13
Bundled files
2
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by aliyun on GitHub. Read the source before you install it.

Installation

Install the Alibabacloud Mcp Core Script Generate AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/aliyun/alibabacloud-agent-toolkit/tree/main/plugins/alibabacloud-core/skills/alibabacloud-mcp-core-script-generate
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/aliyun/alibabacloud-agent-toolkit.git /tmp/alibabacloud-agent-toolkit
mkdir -p .claude/skills
cp -r /tmp/alibabacloud-agent-toolkit/plugins/alibabacloud-core/skills/alibabacloud-mcp-core-script-generate .claude/skills/alibabacloud-mcp-core-script-generate
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Alibabacloud Mcp Core Script Generate in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Alibabacloud Mcp Core Script Generate on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Alibabacloud Mcp Core Script Generate is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Alibaba Cloud Script Generator

Turn a natural-language Alibaba Cloud request into one RunScript-compatible Python script. The script must use await call_cli(...), assign the final value to result, and pass check_sandbox.py validation before output. Do not execute the script unless the user asks.

Scope Check Before You Start

  • RunScript sandbox scripts (this skill): generates call_cli()-based Python for the RunScript sandbox — no SDK imports, no credentials, no local execution.
  • SDK project code → alibabacloud-sdk-usage: generates typed/generic SDK code with imports, credential providers, and dependency management for user projects.
  • Operational patterns (batch ops, audits, rotations) → alibabacloud-find-skills first.

Workflow

  1. Split the request into atomic cloud operations. For each operation, you must call at least one of the following methods to discover API parameters before writing any code:

    Method A — MCP tools (preferred): call AlibabaCloud___SearchApis with a natural language description, then AlibabaCloud___GetApiDefinition with the confirmed product, action, and version. Batch search calls in one parallel round.

    Method B — HTTP metadata (when MCP tools return errors): The endpoint https://next.api.aliyun.com/meta/v1/products/{product}/versions/{version}/api-docs.json contains all API definitions for a product. If WebFetch cannot extract the target API (response too large), download the full JSON with curl and extract the target API's parameters array using python3 -c "import json,sys; ..." or grep.

    You must actually execute one of these methods — reading about them is not sufficient. Only if your tool call returns an error may you fall back to best-known parameter names, adding: # WARNING: API parameters not verified — confirm before use.

  2. Generate one Python script body following the Sandbox Contract and Script Patterns below. Only whitelisted modules may be imported. When multiple tool calls are needed, batch them in parallel. Never repeat the same tool call with the same arguments.

  3. Write to /tmp/aliyun-runscript.py and validate with the local sandbox checker (<SKILL_DIR>/scripts/check_sandbox.py):

    bash
    cat > /tmp/aliyun-runscript.py <<'PYEOF'
    <script body here>
    PYEOF
    python3 <SKILL_DIR>/scripts/check_sandbox.py /tmp/aliyun-runscript.py
  4. If validation fails, read the → fix suggestion for each violation, fix ONLY the listed issues, and re-validate. Maximum 3 rounds. If violations persist, show them to the user.

  5. After validation passes, output only the Python script body — no Markdown fences, headings, or explanatory text unless the user asks.

Sandbox Contract

All rules below are enforced by scripts/check_sandbox.py (local pre-check) and remote validation. See references/runscript-contract.md for full definitions with examples.

CategoryRule
ImportsOnly whitelisted modules may be imported: asyncio, collections, csv, dataclasses, datetime, decimal, enum, fractions, functools, itertools, json, math, re, statistics, string, time, typing, uuid. Do NOT import random, os, subprocess, requests, or any module not in this list. call_cli is pre-injected — do NOT import or define it.
API callsUse ONLY call_cli(product, version, action, params). Pre-injected. No SDK clients, no HTTP requests, no subprocess. Parameter values must be plain strings/numbers — do NOT pass aliyun ... CLI command strings as parameter values.
Param valuesParameter values must be plain strings/numbers — do NOT pass aliyun ... CLI command strings as parameter values. Query APIs to fetch exact values when unsure.
OutputAssign final data to result (dict or list). No print().
ConcurrencyParallel API calls must use asyncio.gather(return_exceptions=True). Thread/process-based concurrency (threading, multiprocessing, concurrent.futures) is not in the whitelist and will fail validation.
Forbiddenos, subprocess, socket, requests, eval, exec, compile, getattr, setattr, globals, input, breakpoint, __import__, threading, multiprocessing, concurrent.futures, dunder chains.
Blocked APIsCredential-returning APIs (ram.ListAccessKeys, sts.AssumeRole, kms.GetSecretValue). CLI meta products (configure, plugin, ossutil).
Structurecall_cli must be reachable from module-level execution. Do NOT wrap all calls in an uninvoked async def — either write await call_cli(...) at top level, or define a function and call it: async def main(): ... \n await main().
NumbersDo NOT use leading zeros in numeric literals (e.g., 01, 010). Write 1, 10 instead. IP addresses and CIDR blocks must be strings: "10.0.0.0/8", not bare numbers.
StringsUse f-strings or .format() only with constant format strings. Do NOT build call_cli arguments dynamically via str.format(variable) or % formatting with non-constant args.
Sleeptime.sleep() argument MUST be ≤ 30. For longer waits, use a loop: for _ in range(N): time.sleep(30).
Output formatOutput ONLY Python code. Do NOT output prose, explanations, or markdown before or after the code. If you must add context, use Python comments inside the script — but avoid comments unless absolutely necessary.
OtherWrite/delete/update ops execute directly — the RunScript runtime intercepts write operations and presents them to the user for approval (HITL) before execution. The script itself should not add confirmation prompts.

Script Patterns

Sequential (dependent calls):

python
vpc = await call_cli(product="Vpc", version="2016-04-28", action="CreateVpc", params={"RegionId": region_id, "CidrBlock": "10.0.0.0/8"})
vsw = await call_cli(product="Vpc", version="2016-04-28", action="CreateVSwitch", params={"VpcId": vpc["VpcId"], "CidrBlock": "10.0.0.0/16", "ZoneId": "cn-hangzhou-a"})
result = {"VpcId": vpc["VpcId"], "VSwitchId": vsw["VSwitchId"]}

Pagination (list tasks):

python
items, page = [], 1
while True:
    resp = await call_cli(product="Ecs", version="2014-05-26", action="DescribeInstances", params={"RegionId": region_id, "PageNumber": page, "PageSize": 100})
    batch = resp.get("Instances", {}).get("Instance", [])
    items.extend(batch)
    if len(batch) < 100:
        break
    page += 1
result = items

Parallel (independent calls):

python
responses = await asyncio.gather(*[
    call_cli(product="Ecs", version="2014-05-26", action="DescribeInstances", params={"RegionId": rid})
    for rid in region_ids
], return_exceptions=True)
result = {rid: r if isinstance(r, dict) else {"error": str(r)} for rid, r in zip(region_ids, responses)}

Guardrails

  • Do not execute the generated script unless the user explicitly asks.
  • Do not use any MCP server except the local alibabacloud-core server for API discovery.
  • Do not generate boilerplate, redundant error handling, or unused imports.
  • Always validate before output. Do not skip validation.
  • If the request is ambiguous but not dangerous, use placeholders instead of asking. Use the pre-injected runtime variable (e.g. region_id) or a string placeholder like "<your-vpc-name>".

References

  • references/runscript-contract.md — full rule definitions and additional patterns. Read only when validation fails repeatedly.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Alibabacloud Mcp Core Script Generate AI skill do?

Generate Alibaba Cloud MCP Core RunScript-compatible Python scripts from natural-language cloud operation requests. Use when the user explicitly asks for RunScript scripts, MCP Core scripts, or sandbox-compatible cloud automation code. For standard SDK Python code with imports and credentials, use `alibabacloud-sdk-usage` instead.

Why use Alibabacloud Mcp Core Script Generate on TypingMind?

Because you install it once and use it with any model. Alibabacloud Mcp Core Script Generate is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Alibabacloud Mcp Core Script Generate in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/aliyun/alibabacloud-agent-toolkit/tree/main/plugins/alibabacloud-core/skills/alibabacloud-mcp-core-script-generate. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Alibabacloud Mcp Core Script Generate?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Alibabacloud Mcp Core Script Generate?

As many as you like. As long as a model supports skills, you can use Alibabacloud Mcp Core Script Generate with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Alibabacloud Mcp Core Script Generate AI skill free?

Yes. It is published on GitHub by aliyun under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇