基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/fitchmultz/pi-mcp-adapter --skill mcp-scripting命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | mcp-scripting |
| description | Write mcp_script JavaScript for discovering, inspecting, and calling MCP tools. |
For multi-call MCP work, write ordinary JavaScript with loops, filtering, chaining, fan-out, or other logic between calls. Run that source with mcp_script; it is the primary MCP orchestration surface. For a single MCP search, describe, status check, auth action, or tool call, use mcp instead.
Write the source naturally, then pass it as mcp_script's code argument:
const { items } = await tools.search({ query: "search issues", server: "github" });
const candidate = items[0];
if (!candidate) return { error: "No matching tool" };
const details = await tools.describe({ path: candidate.path });
if (details.error) return details;
const result = await tools.call(details.path, { query: "is:open label:bug" });
if (!result.ok) return result;
emit({ tool: details.path, completed: true });
return result.data?.structuredContent ?? result.data;
await tools.search({ query, server?, limit?, offset? }). limit defaults to 12 and is capped at 100.await tools.describe({ path }).tools.call(path, args).Calls resolve to { ok: true, data } or { ok: false, error }; handle failed calls instead of expecting them to stop the script. Successful data is the raw MCP result: tool calls usually return { content, structuredContent? }, while resource reads return { contents }. Prefer structuredContent when present, and only parse a text block when that server documents JSON text. emit(value) adds user-visible output before the final return value. console output is captured too.
tools is a non-enumerable proxy: Object.keys(tools) throws. Always use tools.search for discovery. When a known flat path is a valid identifier, direct calls such as tools.github_search_issues(args) are supported; use bracket syntax for hyphenated names: tools["server_tool-name"](args). search, call, describe, and promise/serialization names (then, catch, finally, toJSON, toString, valueOf) are reserved on the proxy; if a flat path collides with one, call it via tools.call("exact-path", args).
tools.search and tools.describe are asynchronous and must be awaited. The default script timeout is 30 seconds; the worker is terminated at the deadline, including for infinite loops. Every invocation still uses normal lazy connection, authentication, output guarding, and approval gates. Raw call results are cloned into the worker so scripts can reduce them before the model-facing guard; request scoped data instead of unnecessarily large payloads. Result details contain a concise calls trace with every search, describe, and call operation; each entry includes its query or path, outcome, and duration.
Use plain JavaScript loops and Promise utilities for composition. The sandbox has no Node, filesystem, or network globals such as process, Buffer, or fetch. Fluent helpers such as tools.find(...).one(), tools.parallel(...), and tools.retry(...) are not provided.