npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@page-mcp/protocol

v3.1.0

Published

Protocol types and constants for Page MCP

Readme

@page-mcp/protocol

Page MCP 的纯协议包。只在你需要共享 MCP / WebMCP / Page MCP 类型与常量,而不想引入运行时实现时使用。

这个包负责什么

  • 导出共享协议类型
  • 导出 MCP 原生方法常量
  • 定义 Page MCP 的协议扩展面
  • 不包含运行时代码

什么时候用它

以下场景使用 @page-mcp/protocol

  • 多个项目之间共享协议类型
  • 围绕 Page MCP 构建适配层
  • 只需要编译期协议契约,不需要 Host/Client/Transport

如果你需要真正运行的 host、client 或 transport,请使用 @page-mcp/core

安装

npm install @page-mcp/protocol

最小示例

import type {
  AnthropicMcpTool,
  PageMcpToolDefinition,
  McpRequest,
} from '@page-mcp/protocol';

const tool: PageMcpToolDefinition = {
  name: 'sum',
  description: 'Sum two numbers',
  execute: async (input) => Number(input.a) + Number(input.b),
};

const request: McpRequest = {
  id: '1',
  method: 'tools/list',
};

核心导出

  • AnthropicMcp*
    • 面向 MCP 的 tools、resources、prompts 与 JSON schema 类型
  • WebMcp*
    • WebMCP 的 tool 执行相关类型
  • PageMcp*
    • Page MCP 的协议扩展类型
  • MCP_METHODSMcp*
    • MCP 原生请求/响应与方法常量

不包含什么

这个包不包含:

  • PageMcpHost
  • PageMcpClient
  • transports
  • DOM/resource 解析
  • polyfill
  • 浏览器运行时辅助逻辑

与其他包的关系

  • @page-mcp/core
    • 运行时实现包
  • @page-mcp/webmcp-adapter
    • 浏览器适配层
  • 各框架包
    • 可能会消费或转导这些协议类型