WOL MCP服务器
MCP服务器,为LLM提供对 守望台在线图书馆(WOL).
特性
- 操作员高级搜索
- 文档检索(始终使用Markdown)
- 浏览出版物类型
- 多语言支持(动态WOL语言配置)
- 强大的错误处理和重试逻辑
安装
# Clone and install dependencies
git clone https://github.com/LeomaiaJr/wol-mcp-server.git
cd wol-mcp
npm install
# Build the server
npm run build可用工具
wol_search
使用运算符和分页搜索守望台在线库。
参数:
- 查询(字符串,必填)
- useOperators(布尔值,默认值:true)
- 范围(“sen”|“par”|“art”,默认值:“par)
- 出版物(数组;见下表)
- 语言(字符串,默认值:“en”)
- 排序(“occ”|“new”|“old”,默认值:“occ)
- 页面(整数,默认值:1)
- limit(整数,1-100,默认值:10)--仅适用于文档结果
搜索运算符:
- &或+(AND),|或/(or)!(NOT)、&&或++(相邻)、“…”(短语)、\*(通配符)、?(单个字符),(…)(组)
wol_get-document
检索特定文档的完整内容(始终是Markdown)。
参数:
- url(字符串,必填)——完整的WOL文档url
输出包括:标题、出版物、URL、可选日期/卷/期、副标题、类似材料,然后是文章内容。圣经引用链接(/wol/bc)以明文形式内联。
wol_browse_publications
按类型浏览可用出版物。
参数:
- type(string)--可选筛选器
- 语言(字符串,默认值:“en”)
- year(整数)--可选年份过滤器
出版物类型(常见): w, g, bk, bi, it, dx, yb, syr, sgbk, mwb, km, brch, bklt, es, trct, kn, pgm, ca-copgm, ca-brpgm, co-pgm, manual, gloss, web
可用资源
wol://publications
列出所有可用的出版物类型及其说明。
wol://operators
搜索运算符和示例的详细信息。
wol://languages
支持多种语言访问。
开发(Cloudflare员工)
# Install dependencies
npm install
# Run locally (wrangler dev)
npm start
# Local MCP endpoint: http://localhost:8787/sse
# Optional: open MCP Inspector in another terminal and connect to the local endpoint
npx @modelcontextprotocol/inspector@latest
# Type check
npm run type-check
# Deploy to Cloudflare
npx wrangler deploy部署到Cloudflare Workers(远程MCP)
Cloudflare Workers允许您运行可通过HTTP/SSE访问的远程MCP服务器。此仓库的服务器当前通过以下方式启动 stdio (子流程)使用 StdioServerTransport。要远程公开它,请部署一个基于Workers的MCP服务器,该服务器实现HTTP/SSE传输并连接相同的工具。下面是两条实用的路径。
选项A——快速部署(无身份验证模板)
- 从Cloudflare的authless远程MCP模板创建新的Workers项目:
npm create cloudflare@latest -- wol-mcp-worker --template=cloudflare/ai/demos/remote-mcp-authless
cd wol-mcp-worker- 在当地发展:
npm start
# Server runs at http://localhost:8787/sse- 部署(Wrangler已在您的计算机上通过身份验证):
npx wrangler@latest deploy- 使用MCP检查器进行连接:
npx @modelcontextprotocol/inspector@latest
open http://localhost:5173
# Enter your server URL, e.g. http://localhost:8787/sse or https://..workers.dev/sse- 与本地代理一起使用:
{
"mcpServers": {
"wol-remote": {
"command": "npx",
"args": ["mcp-remote", "https://..workers.dev/sse"]
}
}
}选项B——添加身份验证(OAuth)
从Cloudflare的GitHub OAuth示例开始部署:
npm create cloudflare@latest -- wol-mcp-github-auth --template=cloudflare/ai/demos/remote-mcp-github-oauth
cd wol-mcp-github-auth
npx wrangler@latest deploy按照指南注册OAuth应用程序并设置密钥(GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET).请参阅:Cloudflare“构建远程MCP服务器”指南。
移植此服务器的工具
- 此回购是
stdio-只有。工人无法运行stdio子流程,因此您无需部署dist/index.js直接。 - 通过移动WOL工具处理程序来重用逻辑(例如。,
WOLService)进入Workers项目,并在那里注册等效工具。 - Cloudflare Workers在其模板中支持MCP HTTP/SSE开箱即用传输。实现调用与此仓库中相同方法的工具
wol_search,wol_get_document,以及wol_browse_publications处理人员。
笔记:
- 规范参考:MCP传输(stdio和流式HTTP)。Workers模板公开了一个
/sse与MCP客户端兼容的端点。 - 对于尚未原生支持远程MCP的客户端,请使用
mcp-remote如上所示。
配置
环境变量
NODE_ENV-环境(开发/生产)LOG_LEVEL-日志记录级别(错误/警告/信息/调试)
服务可用性
目前,没有强制执行服务器端速率限制。WOL的上游可用性偶尔会导致临时停机(例如502/503),这些停机表现为 SERVICE_UNAVAILABLE 错误。
例子
基本搜索
Query: "Jesus Christ"
Result: Exact phrase search across all publications操作员高级搜索
Query: (Jesus | Christ) & Jehovah & !Trinity
Result: Documents containing (Jesus OR Christ) AND Jehovah but NOT Trinity出版物特定搜索
Query: prayer
Publications: ["w", "g"] // Watchtower and Awake! only
Result: Prayer-related articles from these magazines多语言搜索
Query: "reino de Dios"
Language: "es"
Result: Spanish content about God's Kingdom贡献
- 分叉存储库
- 创建要素分支:
git checkout -b feature/new-feature - 进行更改并添加测试
- 承诺:
git commit -am 'Add new feature' - 推:
git push origin feature/new-feature - 提交拉取请求
许可证
MIT许可证-有关详细信息,请参阅许可证文件。
免责声明
这是一个用于访问守望台在线库的非官方MCP服务器。它不隶属于耶和华见证人或守望台圣经和传单协会,也不受其认可。
