custom-code-management
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCustom Code Management
自定义代码管理
Concepts
概念
Webflow custom code: register (store script) → apply (attach to site). Inline scripts only via MCP (max 10,000 chars).
Webflow自定义代码:注册(存储脚本)→ 应用(附加到站点)。仅可通过MCP添加内联脚本(最多10,000字符)。
Important note
重要提示
ALWAYS use Webflow MCP tools for all operations:
Use the following tools for all operations:
- with actions
data_scripts_tool/list_registered_scripts- List scriptslist_applied_scripts - with action
data_scripts_tool- Register inline script (noadd_inline_site_scripttags)<script> - with action
data_scripts_tool- Remove ALL scripts (no selective delete)delete_all_site_scripts - with action
data_sites_tool- List available siteslist_sites
所有操作请务必使用Webflow MCP工具:
所有操作请使用以下工具:
- 配合动作
data_scripts_tool/list_registered_scripts- 列出脚本list_applied_scripts - 配合动作
data_scripts_tool- 注册内联脚本(无需add_inline_site_script标签)<script> - 配合动作
data_scripts_tool- 移除所有脚本(不支持选择性删除)delete_all_site_scripts - 配合动作
data_sites_tool- 列出可用站点list_sites
Instructions
操作步骤
View Scripts
查看脚本
- Call with action
data_sites_toolif needed, then call both list tools in parallellist_sites - Display registration and application status
- 如有需要,调用并使用动作
data_sites_tool,然后并行调用两个列表工具list_sites - 显示脚本的注册和应用状态
Add Script
添加脚本
- Gather: name, code, location (header/footer)
- Validate: under 10,000 chars, no tags
<script> - Preview with character count, require "add" to confirm
- Call with action
data_scripts_toolwith displayName, sourceCode, version, location, canCopyadd_inline_site_script - Remind user to publish
- 收集信息:名称、代码、位置(页眉/页脚)
- 验证:字符数不超过10,000,无标签
<script> - 预览字符数,需用户确认输入**"add"**才可继续
- 调用并使用动作
data_scripts_tool,传入displayName、sourceCode、version、location、canCopy参数add_inline_site_script - 提醒用户发布站点
Remove Scripts
移除脚本
- List current scripts
- Warn: removes ALL scripts (no selective delete)
- Require "delete all" to confirm
- Remind user to publish
- 列出当前所有脚本
- 警告:此操作会移除所有脚本(不支持选择性删除)
- 需用户确认输入**"delete all"**才可继续
- 提醒用户发布站点
Constraints
限制条件
- Max 10,000 characters per script
- Do NOT include tags (Webflow adds them)
<script> - displayName + version must be unique
- Site-level only (no page-specific via MCP)
- Hosted scripts not available via MCP
- 每个脚本最多10,000字符
- 请勿包含标签(Webflow会自动添加)
<script> - displayName + version组合必须唯一
- 仅支持站点级脚本(MCP不支持页面级脚本)
- MCP不支持托管脚本
Response Format
响应格式
After adding a script, respond with the script name, location, and version. Suggest using the skill to publish changes.
safe-publish添加脚本后,返回脚本名称、位置和版本。建议使用技能发布更改。
safe-publish