@frontmcp/plugin-codecall

中文文档
1.12.2发布于 2026/11/15Apache-2.0TypeScriptESM + CJS构建来源已验证近 30 天下载 7673

FrontMCP 的 CodeCall 插件: 在搜索后放置许多工具, 描述、 引用和执行元工具, 并运行在沙盒中调用它们的脚本

中文使用文档
文档目录10 节
  1. 安装
  2. 使用量
  3. 工具代码Call添加
  4. 模式
  5. 选项
  6. 限制
  7. 文档
  8. 相关软件包
  9. 捐款
  10. 许可证

@ frontmcp/ 插件编码调用

一个用于服务器的FrontMCP插件,其工具比模型多,可以有用地读取. 而不是每一个工具 及其计划, tools/list 显示 CodeCall 的元工具。 模型以 codecall:search,读取 被它挑出来的 codecall:describe,并给他们打电话: codecall:invoke,或数个 请求与 codecall:execute,它运行着一个以 AgentScript 编写的短程序,一个限制的子集 JavaScript,位于服务器上的一个沙盒中. 脚本可以循环结果,过滤并加入结果,所以只有答案 回到模特儿身边.

npm License

安装

npm install @frontmcp/plugin-codecall @frontmcp/plugin-cache @frontmcp/sdk

需要节点.js 24或后. @frontmcp/plugin-cache 是一个 需要的对等依赖性: 在同一版本, 在此软件包旁边安装 。 CodeCall 注册缓存插件 自己,所以你不列出它 plugins保留 @frontmcp/sdk 同样版本.

对于 embedding: { strategy: 'ml' },同时安装 @huggingface/transformers,可选的对等依赖 vectoriadb,用于搜索的代码Call.

使用量

注册插件为 init(),在 plugins 一、导 言 @App 或 @FrontMcp数字 :

import { CodeCallPlugin } from '@frontmcp/plugin-codecall';
import { App, FrontMcp, Tool, ToolContext, z } from '@frontmcp/sdk';

@Tool({
  name: 'list_tickets',
  description: 'List support tickets',
  inputSchema: { status: z.enum(['open', 'closed']) },
})
class ListTickets extends ToolContext {
  async execute({ status }: { status: 'open' | 'closed' }) {
    return { tickets: [{ id: 'T-1', status, customerId: 'C-7' }] };
  }
}

@Tool({ name: 'get_customer', description: 'Get a customer by id', inputSchema: { id: z.string() } })
class GetCustomer extends ToolContext {
  async execute({ id }: { id: string }) {
    return { id, name: 'Ada', plan: 'pro' };
  }
}

@App({
  id: 'help-desk',
  name: 'Help Desk',
  tools: [ListTickets, GetCustomer],
  plugins: [CodeCallPlugin.init({ mode: 'codecall_only' })],
})
class HelpDeskApp {}

@FrontMcp({ info: { name: 'help-desk', version: '1.0.0' }, apps: [HelpDeskApp] })
export default class Server {}

tools/list 现在只显示 codecall:* 工具。 在一个应用程序上注册的 CodeCall 仍然隐藏每个应用程序的工具 (除非你设定) appIds及其工具搜索和调用每个应用程序的工具.

每个选项都是可选的 : CodeCallPlugin.init() 财务报告和审定财务报表 plugins: [CodeCallPlugin] 使用默认值. init() 检查 模块导入时的选项,并丢出一个 ZodError 命名错误.

工具代码Call添加

工具它会做什么
codecall:search查找简短查询的工具( E)queries: 1到10个短语.
codecall:describe返回工具的输入和输出计划,包括使用实例.
codecall:invoke调用一个工具并返回结果 .
codecall:execute运行调用工具的代理脚本程序.
codecall:searchSkills找到调用工具的技能.
codecall:searchKnowledge找到只是指示的技能.

每个模式都列出它们, 也没有 codecall:invoke 剧本也不能叫他们.

模式

mode单位 tools/list代码呼叫可以使用什么
'codecall_only' (默认)代码Call的工具和工具 codecall: { visibleInListTools: true }每一个工具,除了有 enabledInCodeCall: false
'codecall_opt_in'每一个工具,除了有 visibleInListTools: false只有工具为 codecall: { enabledInCodeCall: true }
'metadata_driven'每一个工具,除了有 visibleInListTools: false每一个工具,除了有 enabledInCodeCall: false

调用工具 CodeCall 的客户端 tools/list 获得 Tool "…" not found (单位:千美元)TOOL_NOT_FOUND) (中文(简体) ). 电话 通过 CodeCall 自己的工具或 this.callTool(),仍然达到它。 单位 codecall_only,工具 a 客户端或部件呼叫直接需要 visibleInListTools: true。 。 。 .

插件添加一个 codecall 字段改为 @Tool数字 :

@Tool({
  name: 'delete_customer',
  description: 'Delete a customer and all their tickets',
  inputSchema: { id: z.string() },
  codecall: { enabledInCodeCall: false, visibleInListTools: true },
})

选项

选项默认说明
mode'codecall_only'哪些工具 tools/list 显示,以及代码Call可以使用哪个。 见 模式。 。 。 .
appIds每个应用程序单位 codecall_only,只隐藏这些应用程序的工具 tools/list它并不限制密码搜索或呼叫.
includeTools(tool) => boolean返回的工具 false 无法从脚本中搜索、描述、引用或调用.
directCalls未设定{ enabled, allowedTools?, filter? },限制什么 codecall:invoke 可能会打电话.
vm{ preset: 'secure' }沙盒的极限: preset (单位:千美元)'locked_down', (中文(简体) ), 'secure', (中文(简体) ), 'balanced', (中文(简体) ), 'experimental', (中文(简体) ), timeoutMs, (中文(简体) ), maxSteps, (中文(简体) ), allowLoops还有其他.
embeddingTF-IDF (英语)怎么样 codecall:search 排序工具 : strategy (单位:千美元)'tfidf' 或者说 'ml', (中文(简体) ), modelName, (中文(简体) ), cacheDir, (中文(简体) ), useHNSW, (中文(简体) ), synonymExpansion。 。 。 .
sidecar{ enabled: false }允许脚本超过64 KB.
topK8每次查询的结果 codecall:search 电话不给自己的 topK。 。 。 .
maxDefinitions8大多数工具之一 codecall:describe 电话可以叫.
CodeCallPlugin.init({
  mode: 'codecall_opt_in',
  directCalls: { enabled: true, allowedTools: ['get_customer'] },
  vm: { preset: 'secure', timeoutMs: 3500 },
  embedding: { strategy: 'ml' },
});

限制

  • 脚本时间和呼叫. 在默认情况下 secure 预设,3.5秒后的脚本出错(vm.timeoutMs(中文(简体) ) 并且最多可调用5 000次的工具(vm.maxSteps) (中文(简体) ). 循环仅限于 for…of,以及 for (…; …; …) 与 vm.allowLoops: true。其他预设设定了其他限制.
  • 呼叫一个工具. 超过 vm.rapidEnumerationThreshold 调用( 默认 30) 到 2 个工具 秒停止脚本 [RAPID_ENUMERATION]; 电话通过 parallel() 计数。 每个工具值设定为 vm.rapidEnumerationOverrides (单位:千美元){ 'users:get': 100 }) (中文(简体) ). 沙盒的留言是"在5",但它只保留了 最后两秒钟的电话.
  • 嵌入型号. 与 embedding.strategy: 'ml',CodeCall装入本地模型(Xenova/all-MiniLM-L6-v2 以 默认),将其下载到 embedding.cacheDir 如果它不在的话。 当模型无法装入或使用时 (离线,没有缓存, @huggingface/transformers 缺少,或嵌入工具失败),CodeCall日志一 使用 TF- IDF 警告和搜索。 无法读取元数据的工具被跳过警告; 其他人留下来 可搜索 .

文档

捐款

资料来源: plugins/plugin-codecall问题 欢迎抽取请求;见 捐款额。 。 。 .

许可证

阿帕奇2.0 (英语). 见 自由主义。 。 。 .

版本与发布记录

@frontmcp/plugin-codecall 共发布 112 个版本,首次发布于 2026/01/09;过去 12 个月发布了 112 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.12.2latest2026/11/151 天前
1.12.12026/11/132 天前
1.12.02026/11/114 天前
1.12.0-rc.1rc2026/11/114 天前
1.11.32026/11/106 天前
1.11.22026/11/096 天前

其他发布通道:beta → 1.1.2-beta.1,rc → 1.12.0-rc.1。

关于 @frontmcp/plugin-codecall 的常见问题

@frontmcp/plugin-codecall 是什么?

FrontMCP 的 CodeCall 插件: 在搜索后放置许多工具, 描述、 引用和执行元工具, 并运行在沙盒中调用它们的脚本

如何安装 @frontmcp/plugin-codecall?

在项目目录运行 npm install @frontmcp/plugin-codecall,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@frontmcp/sdk(1.12.2)、@frontmcp/lazy-zod(1.12.2)、@frontmcp/plugin-cache(1.12.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@frontmcp/plugin-codecall 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@frontmcp/plugin-codecall 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@frontmcp/plugin-codecall 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=24.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@frontmcp/plugin-codecall 可以商用吗?

@frontmcp/plugin-codecall 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@frontmcp/plugin-codecall 的下载量有多少?

根据 npm 官方下载统计,@frontmcp/plugin-codecall 在 2026/10/16 – 2026/11/14 这 30 天内被下载 7,673 次,日均约 256 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@frontmcp/plugin-codecall 还在维护吗?

最新版本 1.12.2 发布于 2026/11/15(1 天前);至今共发布 112 个版本,其中过去 12 个月发布了 112 个;首次发布于 2026/01/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。