# @executor-js/plugin-mcp 中文文档

规范地址：https://npmcn.com/package/%40executor-js/plugin-mcp/

版本：1\.6\.11
npm 元数据更新时间：2026-10-22T23:15:04.836Z
中文译文更新时间：2026-11-14T03:27:12.344Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40executor-js/plugin-mcp
原文对照：https://npmcn.com/package/%40executor-js/plugin-mcp/?lang=original
项目主页：https://github.com/UsefulSoftwareCo/executor/tree/main/packages/plugins/mcp
源码仓库：https://github.com/UsefulSoftwareCo/executor

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：1.3 MB，134 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：9 个
- peer 依赖：react ^19\.1\.0，effect 4\.0\.0-beta\.59，@effect/atom-react 4\.0\.0-beta\.59，@tanstack/react-router ^1\.170\.41
- 首次发布：2026-04-09T21:39:10.341Z
- 最新版本发布：2026-10-22T23:15:04.502Z
- 近 30 天下载量：397258（2026-10-14 至 2026-11-12，npm 官方下载统计）
- 已发布版本数：80（近 12 个月 80 个）

## 中文简介

登记册 [示范背景协议](https://modelcontextprotocol.io/) 服务器作为执行器的工具集成。 既支持stdio发射服务器,也支持远程(HTTP)服务器,带有可选的OAuth.

## 安装

```sh
npm install @executor-js/plugin-mcp
```

也可以使用：`pnpm add @executor-js/plugin-mcp`、`yarn add @executor-js/plugin-mcp`、`bun add @executor-js/plugin-mcp`

## README

# @ executor-js/ plugin- mcp

登记册 [示范背景协议](https://modelcontextprotocol.io/) 服务器作为执行器的工具集成。 既支持stdio发射服务器,也支持远程(HTTP)服务器,带有可选的OAuth.

## 安装

```sh
bun add @executor-js/sdk @executor-js/plugin-mcp
# or
npm install @executor-js/sdk @executor-js/plugin-mcp
```

## 使用量

```ts
import { createExecutor } from "@executor-js/sdk";
import { mcpPlugin } from "@executor-js/plugin-mcp";

const executor = await createExecutor({
  onElicitation: "accept-all",
  // Stdio integrations spawn a local subprocess — only enable for trusted
  // single-user contexts. See "Stdio environment" below for what they receive.
  plugins: [mcpPlugin({ dangerouslyAllowStdioMCP: true })] as const,
});

const scope = executor.scopes[0]!.id;

// Remote MCP server
await executor.mcp.addIntegration({
  scope,
  transport: "remote",
  name: "Context7",
  endpoint: "https://mcp.context7.com/mcp",
});

// Stdio MCP server (requires `dangerouslyAllowStdioMCP: true` above)
await executor.mcp.addIntegration({
  scope,
  transport: "stdio",
  name: "My Server",
  command: "npx",
  args: ["-y", "@my/mcp-server"],
});

// Every MCP tool is now part of the unified catalog
const tools = await executor.tools.list();

const result = await executor.tools.invoke("context7.searchLibraries", {
  query: "effect-ts",
});
```

## 结构环境

Stdio 服务器不继承 `process.env`它收到MCP SDK的安全名单(`HOME`, (中文(简体) ), `LOGNAME`, (中文(简体) ), `PATH`, (中文(简体) ), `SHELL`, (中文(简体) ), `TERM`, (中文(简体) ), `USER`; Windows 上的等效Windows),外加一个代理和CA变量的简短授权列表—— `HTTP_PROXY`, (中文(简体) ), `HTTPS_PROXY`, (中文(简体) ), `NO_PROXY`他们的小写拼写, `NODE_EXTRA_CA_CERTS`, (中文(简体) ), `SSL_CERT_FILE`,以及 `SSL_CERT_DIR` ——所以公司代理背后的服务器仍然可以到达网络. 没有别的东西可以旅行,所以在宿主环境里一个秘密就留在那里. 通过集成给服务器更多的信息,首先是 API 密钥 `env`,在关键相撞上获胜。 在 Windows 上,碰撞的解决不敏感,因为操作系统处理 `Path` 财务报告和审定财务报表 `PATH` 作为一个变量.

## 有效使用

如果你在继续发展 `@executor-js/sdk/core` (原始效果项),从它的插件导入此插件 `/core` 子路径转而返回效果形状的插件 `Effect.Effect<...>`\- 返回方法,而不是混合包装:

```ts
import { mcpPlugin } from "@executor-js/plugin-mcp/core";
```

## 状态

预`1.0`. API在β释放之间仍然可能改变. 部分 [执行器单曲](https://github.com/UsefulSoftwareCo/executor)。 。 。 .

## 许可证

麻省理工学院

## 常见问题

### @executor-js/plugin-mcp 是什么？

登记册 示范背景协议 服务器作为执行器的工具集成。 既支持stdio发射服务器,也支持远程\(HTTP\)服务器,带有可选的OAuth\.

### 如何安装 @executor-js/plugin-mcp？

在项目目录运行 npm install @executor-js/plugin-mcp，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：effect（4\.0\.0-beta\.59）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @executor-js/plugin-mcp 支持 TypeScript 吗？

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

### @executor-js/plugin-mcp 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @executor-js/plugin-mcp 可以商用吗？

@executor-js/plugin-mcp 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @executor-js/plugin-mcp 的下载量有多少？

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

### @executor-js/plugin-mcp 还在维护吗？

最新版本 1\.6\.11 发布于 2026/10/23（22 天前）；至今共发布 80 个版本，其中过去 12 个月发布了 80 个；首次发布于 2026/04/10。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

