@frontmcp/protocol

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

Internal FrontMCP package: the single re-export point for @modelcontextprotocol/sdk types, server, client and transports

原始使用文档
文档目录5 节
  1. Install
  2. What it exports
  3. Protocol 2026-07-28
  4. Contributing
  5. License

@frontmcp/protocol

FrontMCP's single point of contact with the upstream @modelcontextprotocol/sdk: it re-exports the MCP protocol types, server, client and transports that the other @frontmcp/* packages use. The client and its transports come from the @frontmcp/protocol/client subpath, so a server, or a browser or Worker bundle of one, doesn't load them. This is an internal package, published only so those packages can depend on it. Don't import it from application code: import MCP types from @frontmcp/sdk, and use McpClient from @frontmcp/testing when a test needs a raw client.

npm License

Install

You don't install it yourself: @frontmcp/sdk depends on it. It needs Node.js 24 or later.

What it exports

AreaContents
Protocol typesEverything in @modelcontextprotocol/sdk/types.js: requests, results, notifications, schemas, McpError
Protocol 2026-07-28MCP_20260728_META, MCP_20260728_ERROR_CODES, CacheableResult, DiscoverResult, InputRequiredResult, …
ServerMcpServer, StreamableHTTPServerTransport, WebStandardStreamableHTTPServerTransport, StdioServerTransport
Client (@frontmcp/protocol/client)Client, StreamableHTTPClientTransport, SSEClientTransport, StdioClientTransport
OtherInMemoryTransport, Transport, RequestHandlerExtra, AuthInfo

The browser build swaps in browser versions of the server and Streamable HTTP modules through the package's imports map. The stdio transports need Node.js: in a browser or worker build they throw when constructed.

Protocol 2026-07-28

@modelcontextprotocol/sdk 1.29 supports protocol revisions up to 2025-11-25, so the types of revision 2026-07-28 are defined here. They only add to the earlier types, because a FrontMCP server serves both revisions on the same endpoint. See Protocol versions for what the revision changed and how FrontMCP picks one per request.

Contributing

Source: libs/protocol. Issues and pull requests are welcome; see CONTRIBUTING.md.

Inside the monorepo, this is the only package that imports @modelcontextprotocol/sdk. Import MCP types from @frontmcp/protocol instead of the upstream package, and when a type you need is missing, re-export it from src/types.ts (or src/types-20260728.ts for the newer revision). That way, upgrading or replacing the upstream package touches only this package.

License

Apache-2.0. See LICENSE.

版本与发布记录

@frontmcp/protocol 共发布 98 个版本,首次发布于 2026/03/17;过去 12 个月发布了 98 个版本。最新版本附带 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/protocol 的常见问题

@frontmcp/protocol 是什么?

Internal FrontMCP package: the single re-export point for @modelcontextprotocol/sdk types, server, client and transports

如何安装 @frontmcp/protocol?

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

@frontmcp/protocol 支持 TypeScript 吗?

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

@frontmcp/protocol 支持 ESM 还是 CommonJS?

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

@frontmcp/protocol 需要什么版本的 Node.js?

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

@frontmcp/protocol 可以商用吗?

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

@frontmcp/protocol 的下载量有多少?

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

@frontmcp/protocol 还在维护吗?

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