openwiki-mcp
openwiki-mcp
MCP 服务器,将 OpenWiki (OpenChamber) 文档生成功能作为 模型上下文协议工具暴露,使官方、未修改的 OpenCode(或任何 MCP 主机)能够生成和更新仓库 wiki。
完全独立于 opencode 源代码树 —— openwiki 本身被解析为
外部包(npm 安装或分段离线包),代理凭据通过环境变量传递,从不存储。
工具
工具 | 映射到代理 | 注释 |
| — (仅本地) | 检查 |
|
| 首次 wiki 生成。可选的 |
|
| 基于差异的刷新;仅重新生成过时的页面。 |
Related MCP server: Minecraft Wiki MCP Server
前提条件
Node.js >= 22(MCP 服务器和代理子进程均在
node下运行)openwiki 包安装:
npm install -g openwiki # online machine, or# offline machine: copy a prepared bundle and point at it set OPENWIKI_PACKAGE_ROOT=D:\path\to\staged\bundle\node_modules\openwikiOPENWIKI_PACKAGE_ROOT可以直接指向包根目录,也可以指向包含node_modules/openwiki的布局。分段离线包不需要 连接点或符号链接技巧——Node 通过正常的node_modules遍历来解析代理的裸导入。
代理模型配置
服务器将以下变量传递(从不存储)到代理子进程中:
环境变量(服务器端) | 含义 |
|
|
| 模型 ID,例如 |
| 指向本地 OpenAI 兼容网关,以将真实密钥保留在代理环境之外 |
| openai-compatible 提供商的密钥 |
|
|
| 可选;指向 openwiki 安装的显式路径 |
每次调用的 modelId/language/userMessage 工具参数会覆盖该次运行的
环境设置。
注册到 OpenCode
添加到您的 opencode.json / opencode.jsonc:
{
"mcp": {
"openwiki": {
"type": "local",
"command": ["node", "D:/path/to/openwiki-mcp/dist/index.js"],
"environment": {
"OPENWIKI_PACKAGE_ROOT": "D:/path/to/staged/bundle/node_modules/openwiki",
"OPENWIKI_PROVIDER": "openai-compatible",
"OPENWIKI_MODEL_ID": "gpt-5",
"OPENAI_COMPATIBLE_BASE_URL": "http://127.0.0.1:4096/v1"
}
}
}
}然后这三个工具会作为普通工具出现在每个 OpenCode 对话中。
开发
npm install
npm run build # tsc -> dist/
npm test # node --test (status inspection unit tests)
npm run dev # run the server via tsx (dev)冒烟测试:
node scripts/smoke.mjs <dir> status # local inspection only
node scripts/smoke.mjs <dir> init "note" # full agent run (needs model env)手动 MCP 协议检查:
@'
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":1,"method":"tools/list"}
'@ | node dist/index.js设计说明
src/openwiki/resolve.ts— 包解析:OPENWIKI_PACKAGE_ROOT,然后require.resolve("openwiki/package.json")。src/openwiki/worker.mjs— 适配器工作进程:从 stdin 读取一个作业,通过绝对路径导入 代理入口,将 NDJSON 进度信息输出到 stdout。从 opencode 分支的packages/openwiki适配器移植,并保持独立。src/openwiki/run.ts— 将工作进程生成为 MCP 服务器的子进程,因此 挂起的代理绝不会拖垮 MCP 主机。src/status.ts— 本地状态检查(无模型成本)。v0.1 将
generate映射到代理的init命令,匹配 openwiki 0.3.x 其中init是首次生成命令,update是刷新命令。
This server cannot be deployed
Maintenance
Related MCP Connectors
- FlowdexOAuthdk.flowdex
Read and write your team's shared, AI-readable wiki from any MCP client.
Hosted markdown project wikis your team's AI assistants read, search, and update over MCP.
One wiki for all your agents: pages read and written over MCP, a link graph, and broken-link checks.
- hiveWikiOAuthai.hivewiki
Shared project wiki for AI agents: read and write pages, next actions, and activity logs over MCP.
Related MCP Servers
- AlicenseBqualityCmaintenanceMCP server for codewiki.google — AI-powered wiki documentation for open-source repositories. Search repos, fetch wiki content, and ask questions about any repo.349 npm17MIT
- AlicenseAqualityDmaintenanceEnables searching and retrieving Minecraft Wiki content in multiple formats (wikitext, HTML, markdown) through MCP tools, with batch retrieval and health monitoring.51MIT
- FlicenseAqualityDmaintenanceMCP server for managing GitHub wiki pages programmatically, enabling create, read, update, delete, and list operations via git cloning and pushing.51-
- AlicenseNot gradedqualityCmaintenanceMCP server to query a Git-hosted Wiki, offering tools to list, search, and read Markdown documents via Codex or VS Code.MIT