WhatsMeow上下文协议服务器

提供WhatsMeow库的完整上下文分析服务,结合Go AST解析和领域知识库,适用于WhatsApp开发场景。

  • by jobasfernandes
  • TypeScript
  • 本地部署
  • 5 星标
  • 更新于
在 GitHub 查看 jobasfernandes/mcp-whatsmeow

使用说明

MCP WhatsMeow上下文

MCP(模型上下文协议)服务器,用于提供完整的库上下文 WhatsMeow (Go/WhatsApp)到AI助理。

仓库 tulir/whatsmeow 在第一次运行时自动下载。

功能

此服务器组合 AST Go 分析 com 域名知识库 为了提供有关WhatsMeow / WhatsApp的完整上下文:

AST(Go Parser)分析

  • 接口 - 有字段和方法
  • 结构体 - 带输入字段和标签
  • 类型 类型别名和定义
  • 函数 参数和返回
  • 方法 接收器和签名
  • 常量 - iota, 字符串, 常见错误
  • 变量 - 导出和配置

领域知识(v2.0)

  • 16个知识库 完全参考类型,方法和模式治愈
  • Wae 2 e原型浏览器 超过 13000 种 protobuf 类型的动态导航
  • 40个代码示例 从API_WHATSMEOW提取的生产
  • 指南 准媒体、群组、通话、聊天e连接

可用工具 (38 tools)

AST 工具

工具 描述
whatsmeow_extrair_tipos 提取通过AST导出的声明
whatsmeow_buscar_tipo 按确切名称查找定义
whatsmeow_buscar_fuzzy 寻找近似匹配。
whatsmeow_listar_exports 按模块和类别分组的所有导出列表
whatsmeow_categorias 列出特定类别的符号。
whatsmeow_constantes 导出的常量和变量列表
whatsmeow_hierarquia 显示类型关系(嵌入式/使用式)
whatsmeow_estatisticas 图书馆详细统计。
whatsmeow_dependencias 分析模块/包之间的依赖关系
whatsmeow_interfaces 列出所有导出的接口
whatsmeow_funcoes 导出的函数和方法列表

内容工具

工具 描述
whatsmeow_buscar_contexto 按主题/域排名搜索语义
whatsmeow_resumo_modulo 摘要一个包含文件,类别和关键符号的模块。
whatsmeow_topicos 实用主题地图(配对,事件,消息,媒体等)

仓库工具

工具 描述
whatsmeow_estrutura 列出库的文件结构
whatsmeow_ler_arquivo 阅读特定文件的内容
whatsmeow_check_updates 在GitHub上查看更新
whatsmeow_update 更新本地仓库。
whatsmeow_status 显示仓库的当前状态
whatsmeow_self_update 检查/更新软件包 mcp-whatsmeow 没有npm

域工具

工具 描述
whatsmeow_messages 对所有消息类型(文本,图像,按钮,民意调查等)的完整参考 waE2E 结构
whatsmeow_interactive 具有 AdditionalNodes 和 FutureProofMessage 的交互式消息结构(按钮、列表、模板)
whatsmeow_jid JID/LID 格式、特殊 JID、实用功能和迁移 @lid
whatsmeow_events 完整的50多个事件系统,包括Go结构类型和类别

参考工具

工具 描述
whatsmeow_client_methods 按类别(消息传递、群组、媒体等)组织的 60+ 种客户端方法
whatsmeow_chat 聊天操作(存在,消失定时器,广播,状态)
whatsmeow_connection 连接/身份验证参考 (QR, PairPhone, Noise, reconnect, keepalive)
whatsmeow_guides 媒体、群组、呼叫和映射的完整指南

知识工具

工具 描述
whatsmeow_newsletter 新闻通讯/渠道操作 (14+ 方法、GraphQL ID、类型、列表)
whatsmeow_privacy 隐私设置,阻止列表和消失定时器。
whatsmeow_appstate 应用程序状态同步(HKDF密钥、补丁、LTHash、构建器、索引、合并)
whatsmeow_media 处理媒体(8种媒体类型,E2E加密,CDN,上传/下载)
whatsmeow_groups 群组管理(22+ 种方法、社区、权限)
whatsmeow_store 存储/持久性(11个接口,sqlstore,信号协议,设备)
whatsmeow_history 历史同步(下载、zlib、消息解析、推送名称)

waE2E Proto 工具

工具 描述
whatsmeow_proto 浏览/搜索原型 waE2E (13000+ 类别声明)
whatsmeow_proto_type 原始类型的完整定义(fields, docs, nested types)

示例工具

工具 描述
whatsmeow_examples 40 个生产代码示例(发件人、会话、事件、媒体、组、连接、高级)

支持的类别

interface   - Interfaces Go
struct      - Structs Go
type        - Type aliases
function    - Funções exportadas
method      - Métodos com receivers
const       - Constantes (iota, valores)
variable    - Variáveis exportadas

安装

选项1:通过npx(推荐)

{
  "servers": {
    "whatsmeow-context": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcp-whatsmeow"]
    }
  }
}

选项2:全局安装

npm install -g mcp-whatsmeow
{
  "servers": {
    "whatsmeow-context": {
      "type": "stdio",
      "command": "mcp-whatsmeow"
    }
  }
}

选项3:本地仓库

git clone https://github.com/jobasfernandes/mcp-whatsmeow.git
cd mcp-whatsmeow
npm install
npm run build
{
  "servers": {
    "whatsmeow-context": {
      "type": "stdio",
      "command": "node",
      "args": ["d:/caminho/para/mcp-whatsmeow/dist/index.js"]
    }
  }
}

环境变量

变量 描述 Default
WHATSMEOW_PATH 到 WhatsMeow 仓库的路径 (root with go.mod) 自动下载em ~/.mcp-whatsmeow/
AUTO_UPDATE_ENABLED 启用自动更新检查 true
AUTO_UPDATE_INTERVAL 检查间隔(ms) 3600000 (1小时)
GITHUB_TOKEN 代币做GitHub临时限速 -

使用范例

从模块提取类型

whatsmeow_extrair_tipos({ modulo: "types" })
whatsmeow_extrair_tipos({ modulo: "proto", apenas_kind: "struct" })

搜索特定类型

whatsmeow_buscar_tipo({ nome: "Client" })
whatsmeow_buscar_tipo({ nome: "SendMessageParams" })

模糊和语义搜索

whatsmeow_buscar_fuzzy({ query: "send message" })
whatsmeow_buscar_contexto({ query: "qr pairing", limite: 10 })

摘要和主题

whatsmeow_resumo_modulo({ modulo: "root", destaque: 15 })
whatsmeow_topicos({ topico: "newsletter" })

查看信件类型

whatsmeow_messages()
whatsmeow_messages({ type: "buttons" })
whatsmeow_messages({ category: "interactive" })

互动消息

whatsmeow_interactive()
whatsmeow_interactive({ type: "buttons" })
whatsmeow_interactive({ type: "list" })

事件系统

whatsmeow_events()
whatsmeow_events({ category: "appstate" })
whatsmeow_events({ event: "Message" })

编号 JID/LID

whatsmeow_jid()
whatsmeow_jid({ topic: "lid" })
whatsmeow_jid({ topic: "utilities" })

客户端方法

whatsmeow_client_methods()
whatsmeow_client_methods({ category: "messaging" })
whatsmeow_client_methods({ method: "SendMessage" })

参考指南

whatsmeow_guides({ topic: "media" })
whatsmeow_guides({ topic: "groups" })
whatsmeow_connection({ topic: "qr" })
whatsmeow_chat({ topic: "presence" })

专业知识

whatsmeow_newsletter()
whatsmeow_privacy({ topic: "blocklist" })
whatsmeow_appstate({ topic: "builders" })
whatsmeow_media({ topic: "encryption" })
whatsmeow_groups({ topic: "community" })
whatsmeow_store({ topic: "interfaces" })
whatsmeow_history({ topic: "download" })

浏览 waE2E Proto

whatsmeow_proto()
whatsmeow_proto({ category: "message" })
whatsmeow_proto({ search: "poll" })
whatsmeow_proto_type({ name: "InteractiveMessage" })
whatsmeow_proto_type({ name: "ImageMessage" })

生产代码示例

whatsmeow_examples()
whatsmeow_examples({ category: "senders" })
whatsmeow_examples({ id: "send-buttons" })
whatsmeow_examples({ search: "sticker" })

统计和分析

whatsmeow_estatisticas()
whatsmeow_dependencias()
whatsmeow_hierarquia({ nome: "Client" })

MCP 资源

URI 描述
whatsmeow://readme WhatsMeow 库的主要文档
whatsmeow://go-mod WhatsMeow 的 go.mod 档案
whatsmeow://statistics 图书馆的完整统计

技术

  • @模型上下文协议/sdk v1.26.0 - 官方 MCP SDK
  • 转到AST解析器 -基于Regex的Go代码解析器
  • 黄道带 v4.1.13 - 方案验证

地方 发展

npm install
npm run build
npm start