用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Theorvane/type-mcp-api-agent-skill --skill api-to-typemcp命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | api-to-typemcp |
| description | Use when turning supplied API sources into a safe TypeMCP project. |
| version | 0.2.7 |
| category | integration |
| license | MIT |
| metadata | {"hermes":{"tags":["mcp","api","openapi","swagger","code-generation","type-mcp"],"related_skills":[]},"openclaw":{"requires":{"bins":"[Truncated]"},"envVars":["[Truncated]","[Truncated]"]}} |
This released skill is a complete, bundled generator delivery unit. Its bundled skill engine is in scripts/, its controlled TypeScript output templates are in templates/, and its public TypeMCP runtime constraints are in references/type-mcp-runtime.md.
Generated projects use the current published @theorvane/type-mcp@0.4.0 release line and only its public package exports; they never copy TypeMCP source or use local, file:, git:, link:, or private runtime APIs. The npm registry gitHead and GitHub Release v0.4.0 both resolve to 4141d25c287e57a76b905bd6f77c4681ab335378.
Use this skill with a supplied local OpenAPI 3.x / Swagger 2.0 JSON/YAML file, supplied Swagger UI HTML, or supplied Markdown/HTML API reference. Do not use it to crawl a bare origin, infer undocumented operations, make mutating calls by default, or publish without explicit final confirmation.
The engine reads only the user-supplied source and files bundled with this skill. It writes only the caller-created output directory and the optional TYPE_MCP_APPROVAL_STATE_DIR; it never modifies an upstream API or publishes a repository without the separate explicit gates below.
The engine invokes python3. Optional generated-project verification additionally invokes npm and node, uses a fresh temporary workspace, passes a credential-scrubbed environment, disables inherited npm proxy settings and lifecycle scripts, and installs exactly the generated package-lock.json graph with npm ci. That install requires outbound access to the npm registry; the generator itself performs no network fetch or crawling, and the smoke test targets only a caller-provided local test upstream.
This verifier is process containment, not a claim of kernel or network isolation. Run it in a container, VM, or an equivalent host sandbox when the generated project or its dependency installation is untrusted.
Run the engine through its installed skill-relative path. Set SKILL_DIR to the directory containing this SKILL.md; create a controlled temporary output directory yourself and keep it empty.
SKILL_DIR="/absolute/path/to/api-to-typemcp"
SOURCE="/absolute/path/to/supplied-openapi.json"
OUTPUT="$(mktemp -d -t api-to-typemcp-output.XXXXXX)"
STATE="$(mktemp -d -t api-to-typemcp-state.XXXXXX)"
export TYPE_MCP_APPROVAL_STATE_DIR="$STATE"
# 1. Inspect and build the exact secret-free manifest.
python3 "$SKILL_DIR/scripts/api_to_typemcp.py" inspect --file "$SOURCE" --json
python3 "$SKILL_DIR/scripts/api_to_typemcp.py" manifest --file "$SOURCE" --json > manifest.json
DIGEST="$(python3 -c 'import json; print(json.load(open("manifest.json"))["digest"])')"
# 2. Review the manifest, then explicitly approve precisely that digest.
python3 "$SKILL_DIR/scripts/api_to_typemcp.py" approve \
--file "$SOURCE" --manifest-digest "$DIGEST"
# 3. Render only after approval, with an exact digest confirmation.
python3 "$SKILL_DIR/scripts/api_to_typemcp.py" generate \
--file "$SOURCE" --output "$OUTPUT" \
--confirm-manifest-digest "$DIGEST"
For supplied Markdown or HTML, add an explicit origin; no page is fetched or crawled:
python3 "$SKILL_DIR/scripts/api_to_typemcp.py" manifest \
--file "/absolute/path/to/reference.md" \
--base-url "https://api.example.test" --json
Swagger UI discovery is performed by inspect in-memory and returns only an explicit configured spec reference. The user must separately supply that structured spec; do not fetch it automatically.
approve issues a HMAC-protected, digest-bound, single-use receipt. A changed, expired, tampered, or already-consumed receipt stops generate.--replace is explicitly supplied. Symlinks and .. traversal are rejected.GET/HEAD/OPTIONS are read operations. POST/PUT/PATCH/DELETE are protected writes and require exact known IDs in TYPE_MCP_ALLOW_PROTECTED_OPERATIONS before URL, query, headers, body, authentication, or dispatch. Unknown methods deny.npm ci --ignore-scripts with inherited proxy settings disabled, then typecheck, test, build, and run a local MCP stdio smoke test. Use a container, VM, or equivalent host sandbox when the project or dependency graph is untrusted..env, copy secret values, silently replace a server name, or mutate an undetected/unsupported client; provide a portable mcpServers.json export instead.Only use this after generated-project verification succeeds. Read-only discovery covers Hermes, Claude Code, Codex, Cursor, VS Code/Copilot, Gemini CLI, and OpenCode. This release has verified native config adapters for Codex, Cursor, VS Code/Copilot, Gemini CLI, and OpenCode, plus official CLI adapters for Hermes (hermes mcp add then hermes mcp test) and Claude Code (claude mcp add --transport stdio then claude mcp list). Hermes and Claude Code configuration files are never guessed or edited directly. If either CLI is missing or its add/verification action fails, the adapter removes a just-added server when possible and reports the target as failed; use portable export instead.
# 1. The assistant asks: "프로젝트만 생성할까요, 아니면 생성 후 에이전트에 탑재할까요?"
# 2. For install, inspect and show a secret-free plan before any config write.
python3 "$SKILL_DIR/scripts/api_to_typemcp.py" install-plan \
--project "$OUTPUT" --targets "cursor,gemini-cli"
# 3. Review the preview, then explicitly issue the plan-bound one-time confirmation.
PLAN_DIGEST="...shown by install-plan..."
python3 "$SKILL_DIR/scripts/api_to_typemcp.py" install-approve --plan-digest "$PLAN_DIGEST"
# 4. Apply only the unchanged approved plan. Native registration is fail-closed
# unless the selected client already has a detected regular config file. Each
# target gets a 0600 backup; a later target failure restores earlier targets,
# and every write is reread/parsed before success is reported.
python3 "$SKILL_DIR/scripts/api_to_typemcp.py" install-apply \
--project "$OUTPUT" --targets "cursor,gemini-cli" --confirm-plan-digest "$PLAN_DIGEST"
For no-write portability, use install-export --project "$OUTPUT"; it writes only
$OUTPUT/agent-install/mcpServers.json, never an agent configuration. Preview and
receipts expose env_names only—never .env content or credential values.
Read references/type-mcp-runtime.md before modifying generated TypeScript. The default generated standard ESM path uses the public ESM/NodeNext decorator import:
import { McpServer, McpTool } from "@theorvane/type-mcp";
Use only McpServer, McpTool, createMcpServer, serveStdioServer, zod, and an explicit InstanceResolver from the public contract. Legacy decorators are a separate, opt-in compatibility surface for CommonJS/Node16 projects that enable experimentalDecorators:
import { McpServer, McpTool } from "@theorvane/type-mcp/legacy";
These are distinct entrypoints with distinct decorator semantics. Do not change the generator templates to the legacy/CommonJS path; generated projects remain standard ESM consumers and never copy runtime source.
@theorvane/type-mcp@0.4.0 release line only and includes a reviewed package-lock.json; confirm registry provenance before changing this version.npm ci --ignore-scripts/typecheck/test/build/MCP smoke passes; external sandboxing is used for untrusted dependency installation.