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

@zero-ai-bits/wiki-mcp

v1.0.0

Published

MCP Confluence Enhanced Service (TypeScript)

Readme

@zero-ai-bits/wiki-mcp

MCP Confluence Enhanced Service (TypeScript).

提供将企业内部 Confluence Wiki 知识库无缝接入 AI 上下文的能力。使大模型可以直接利用 CQL 高级语法检索内容、批量拉取文档,并自带基于 AST 的 HTML 转纯 Markdown 的超强文本降噪能力。

特性

  • 📝 智能文本降噪:内置 Markdown 转换引擎,消除 Confluence 复杂的 HTML 冗余标签,精简 Token 消耗
  • 🔎 高级 CQL 搜索:直接支撑原生的 Confluence CQL (Confluence Query Language),实现深度复杂的知识库检索
  • 📸 图片内容直读:支持一键下载 Wiki 附件图片(携带鉴权信息)并自动转码 Base64,赋予 AI 读图能力
  • 🛡️ 安全的企业鉴权:支持 Cookie、Basic Auth、Bearer Token、Personal Access Token(PAT) 等全体系鉴权
  • 🌲 树形结构追踪:支持快速获取某个页面的历史版本、附件列表、上级面包屑或所有的子页面列表

环境配置 (环境变量)

在启动本服务前,可以通过配置环境变量来定制服务行为:

  • CONFLUENCE_BASE_URL (必填): Confluence 服务的根地址(如 https://wiki.your-company.com
  • CONFLUENCE_API_PREFIX: API 路径前缀,默认 /rest/api
  • CONFLUENCE_AUTH_MODE: 鉴权模式,支持 cookie, basic, bearer, pat,默认 cookie
  • CONFLUENCE_COOKIE: 选用 cookie 鉴权时配置
  • CONFLUENCE_EMAIL / CONFLUENCE_API_TOKEN: 选用 basic 鉴权时配置
  • CONFLUENCE_BEARER_TOKEN: 选用 bearer 鉴权时配置
  • CONFLUENCE_PERSONAL_TOKEN: 选用 pat 鉴权时配置
  • CONFLUENCE_TIMEOUT_MS: 请求超时时间,默认 20000 毫秒(20秒)
  • CONFLUENCE_LOG_LEVEL: 日志打印级别,默认 info(支持 debug, info, warn, error
  • CONFLUENCE_MAX_CONTENT_LENGTH: 解析为 Markdown 时的防超长截断上限,默认 12000 字符

构建与运行

# 安装依赖
pnpm install

# 编译 TypeScript 源码并进行混淆加密
pnpm run build

# 启动服务
pnpm start

提供的 MCP Tools

该服务向 AI 暴露了以下标准工具接口:

  1. req_search_by_keyword: 按关键词搜索文档(支持各种复合条件过滤)
  2. req_advanced_search: 使用 CQL 进行高级搜索(完全自定义查询)
  3. req_get_by_id: 根据 pageId 获取单篇文档详情(自动将正文转为 Markdown)
  4. req_get_batch: 批量获取多篇文档的详情
  5. req_get_children: 获取指定页面的所有直接子页面
  6. req_get_ancestors: 获取指定页面的完整面包屑父级路径
  7. req_get_history: 获取指定页面的历史修订版本列表
  8. req_get_attachments: 获取指定页面下挂载的全部附件列表
  9. req_get_image_content: 下载 Wiki 中的图片并返回给模型用于多模态图像分析
  10. req_get_space_info: 获取空间 (Space) 的基本信息
  11. req_list_spaces: 分页获取所有可见空间列表
  12. req_stats: 获取接口服务的监控统计及运行时状态

IDE 配置示例 (Cursor / Cline / Windsurf / Claude Desktop 等)

要在 AI 辅助编程工具中使用本服务,请在对应 IDE 的 MCP 配置文件中添加如下配置(以 mcp_config.jsoncline_mcp_settings.json 为例):

{
  "mcpServers": {
    "wiki-mcp": {
      "command": "node",
      "args": [
        "/绝对路径/至/您的/wiki-mcp/build/index.js"
      ],
      "env": {
        "CONFLUENCE_BASE_URL": "https://wiki.your-company.com",
        "CONFLUENCE_AUTH_MODE": "cookie",
        "CONFLUENCE_COOKIE": "JSESSIONID=your-session-id-here"
      }
    }
  }
}

注意:请将 args 中的路径替换为 wiki-mcp 构建后的 build/index.js 实际所在绝对路径。