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

@zcsk/wework-mcp

v0.2.0

Published

企业微信 MCP 服务器

Readme

@zcsk/wework-mcp

企业微信 MCP 服务器,支持获取审批功能。

快速开始

通过 npx 运行(推荐)

npx @zcsk/wework-mcp

全局安装

npm install -g @zcsk/wework-mcp
wework-mcp

作为依赖使用

npm install @zcsk/wework-mcp
# 或
pnpm add @zcsk/wework-mcp

配置

在运行目录创建 .env 文件:

WEWORK_CORP_ID=your_corp_id
WEWORK_CORP_SECRET=your_corp_secret
WEWORK_BASE_URL=https://qyapi.weixin.qq.com

或通过环境变量设置:

export WEWORK_CORP_ID=your_corp_id
export WEWORK_CORP_SECRET=your_corp_secret
npx @zcsk/wework-mcp

功能特性

  • ✅ 获取审批模板详情
  • ✅ 获取审批单详情
  • ✅ 获取审批数据列表(支持分页)
  • ✅ Token 自动缓存和刷新
  • ✅ 完整的 TypeScript 类型定义
  • ✅ 基于 Zod 的参数验证

MCP 工具

get_approval_template

获取审批模板详情,包括模板的控件结构、字段定义等信息。

参数:

  • template_id (string) - 审批模板 ID

示例:

{
  "template_id": "3Tka1eD6v6JfzhDMqPd3aMfFdxqWiEhB"
}

get_approval_detail

根据审批单号获取审批申请的详细信息。

参数:

  • sp_no (string) - 审批单号

示例:

{
  "sp_no": "202401010001"
}

get_approval_list

获取指定时间范围内的审批单列表。

参数:

  • start_time (number) - 开始时间(Unix 时间戳,秒)
  • end_time (number) - 结束时间(Unix 时间戳,秒)
  • cursor (number, 可选) - 分页游标,首次调用传 0
  • size (number, 可选) - 每页数量,默认 100,最大 100

示例:

{
  "start_time": 1704067200,
  "end_time": 1704153600,
  "cursor": 0,
  "size": 100
}

编程使用

基本使用

import { WeWorkMcpServer } from '@zcsk/wework-mcp';

const server = new WeWorkMcpServer('wework-mcp', '0.1.0');
await server.connectStdio();

自定义传输层

import { WeWorkMcpServer } from '@zcsk/wework-mcp';
import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';

const server = new WeWorkMcpServer();
const transport = new SSEServerTransport('/message', response);
await server.connect(transport);

访问底层 API

import { getWeWorkClient } from '@zcsk/wework-mcp';

const client = getWeWorkClient();
const template = await client.getTemplateDetail('template_id');
const detail = await client.getApprovalDetail('sp_no');
const list = await client.getApprovalList(startTime, endTime);

配置说明

| 环境变量 | 说明 | 必需 | 默认值 | |---------|------|------|--------| | WEWORK_CORP_ID | 企业 ID | 是 | - | | WEWORK_CORP_SECRET | 应用的凭证密钥 | 是 | - | | WEWORK_BASE_URL | API 基础 URL | 否 | https://qyapi.weixin.qq.com |

获取企业微信凭证

  1. 登录企业微信管理后台
  2. 进入「应用管理」
  3. 选择或创建一个应用
  4. 获取 AgentIdSecret(即 WEWORK_CORP_SECRET
  5. 在「企业信息」中获取「企业 ID」(即 WEWORK_CORP_ID

在 Claude Desktop 中使用

编辑 Claude Desktop 配置文件:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

添加配置:

{
  "mcpServers": {
    "wework": {
      "command": "npx",
      "args": ["@zcsk/wework-mcp"],
      "env": {
        "WEWORK_CORP_ID": "your_corp_id",
        "WEWORK_CORP_SECRET": "your_corp_secret"
      }
    }
  }
}

开发

# 克隆仓库
git clone https://github.com/zcsk/wework-mcp.git
cd wework-mcp

# 安装依赖
pnpm install

# 构建
pnpm build

# 开发模式
pnpm dev

# 运行测试
pnpm test

许可证

MIT