跳到正文
Skillpedia
● 免费开源💻 本地🔓 无需 API 密钥办公与效率

MediaWiki MCP Server

让你的 AI 智能体读取、搜索和编辑任何 MediaWiki 维基上的页面,包括维基百科。

147 GitHub 星标作者 Professional Wiki许可证 MIT更新于 18天前

如何安装

这个 MCP 是本地的:在你的电脑上运行。

适用于电脑上安装的应用(Claude Desktop、Claude Code、Cursor、VS Code 等)。选择你的应用:

粘贴到终端:

claude mcp add mediawiki -- npx -y @professional-wiki/mediawiki-mcp-server

需要填写的内容

名称用途必填
CONFIGPath to your configuration file否
MCP_ALLOW_STATIC_FALLBACKSet to 'true' to allow HTTP startup when config.json has static credentials. Otherwise the server refuses to start, preventing silent shared-identity fallback for unauthenticated requests.否
MCP_CONTENT_MAX_BYTESByte cap for the content bodies and result blocks tools return (wikitext, rendered HTML, diffs, statement and row listings). An oversized response is truncated with a trailing marker describing what was left out.否
MCP_FILE_DATA_MAX_BYTESHard cap on the base64-encoded size of a get-file-data response. A transport/safety backstop; callers tune actual size with the tool's width parameter. Over-cap responses error rather than truncate.否
MCP_LOG_LEVELMinimum severity for logger output (stderr telemetry and sendLoggingMessage broadcast). Invalid values fail loudly on first log call.否
MCP_MAX_REQUEST_BODYMaximum HTTP request body size on the StreamableHTTP transport. Accepts size strings like 1mb or 512kb.否
MCP_METRICSSet to 'true' to expose Prometheus metrics at GET /metrics on the HTTP transport. Has no effect on the stdio transport.否
MCP_OAUTH_ALLOWED_REDIRECTSAdditional allowed redirect URIs for hosted-proxy client registration: comma-separated exact URIs (which must include a host) and https prefix patterns ending in /*. Loopback, claude.ai, and verified first-party clients (ChatGPT, Cursor, VS Code) are always allowed; unset means no additional clients.否
MCP_OAUTH_CIMD_ALLOWED_HOSTSComma-separated additional client_id document hosts trusted for CIMD (bare host or host:port). Verified first-party hosts are always trusted.否
MCP_OAUTH_CREDENTIALS_FILEOverride the default OAuth credentials store path. Default: ~/.config/mediawiki-mcp/credentials.json on Linux/macOS, %APPDATA%\mediawiki-mcp\credentials.json on Windows.否
MCP_OAUTH_NO_BROWSERSet to '1' to skip launching a browser during the OAuth dance and log the auth URL to stderr instead. Useful in headless environments and CI.否
MCP_OAUTH_PROXY_STORE_FILEPath to the hosted OAuth proxy's encrypted state file, which lets sign-ins survive restarts. Default: proxy-store.enc under the mediawiki-mcp config dir; /app/data/proxy-store.enc in the Docker image.否
MCP_PUBLIC_URLOverride the request-derived public URL used in the protected-resource discovery doc and WWW-Authenticate header. Set this when running behind a proxy that rewrites the request Host.否
MCP_SHUTDOWN_GRACE_MSMaximum milliseconds to wait for in-flight /mcp calls to drain on SIGTERM/SIGINT before exiting. Capped at 600000.否
MCP_TRANSPORTType of MCP server transport否
MCP_UPLOAD_MAX_BYTESMemory cap on the server-side fetch used by upload-file-from-url and update-file-from-url. Files larger than this are routed to the wiki's own copy-upload instead of being buffered by the server. Guards this server's memory, not the wiki's $wgMaxUploadSize.否
MCP_USER_AGENTReplaces the User-Agent header of every outbound request, which defaults to mediawiki-mcp-server/<version> (https://github.com/ProfessionalWiki/MediaWiki-MCP-Server). If you set it, give a name and an email or URL, e.g. 'ExampleBot/1.0 (bot@example.org)'.否
PORTPort used for StreamableHTTP transport否

好了!现在试试

重启应用,把下面任意一条请求粘贴到聊天里:

在维基中搜索与我们发布流程相关的页面。
显示安装页面的最近 10 次编辑。

简介

这个服务器将你的 AI 智能体连接到任何运行 MediaWiki 的维基。智能体可以搜索和阅读页面,比较修订版本,浏览分类和文件,并且在你登录后,创建、编辑、移动页面和上传文件。它可以同时处理多个维基,并为 NeoWiki、Semantic MediaWiki、Cargo、Bucket 和 Wikibase 提供额外的工具。

它能做什么

  • search-page: 对维基进行全文搜索
  • get-page: 获取页面
  • get-page-history: 列出最近的修订
  • compare-pages: 比较两个版本的差异
  • get-category-members: 列出某个分类中的页面
  • create-page: 创建页面(需要登录)
  • update-page: 编辑页面(需要登录)
  • upload-file: 上传文件(需要登录)

什么时候用

  • ›当你希望智能体在维基上查找某些内容时
  • ›当你维护一个维基,并希望获得编辑或移动页面的帮助时
  • ›当你希望比较某个页面的两个版本时

你需要准备

Node.js。只有在使用私有维基或需要登录的工具时,才需要 config.json 文件。写入操作使用 OAuth,你需要在浏览器中批准。

搭配的技能

⭐ Skillpedia MCP · 免费你的智能体自己找到合适的技能安装我们的 MCP,智能体需要时会在 15,000+ 个技能中搜索。免费安装 →

常见问题

它是免费的吗?

是的。该包发布在 npm 上,自述文件显示了开源许可证徽章。

我需要登录吗?

读取公开维基不需要。带锁形标记的工具需要认证。

它能同时处理多个维基吗?

可以。每个工具都接受一个可选的 wiki 参数,你在配置文件中列出维基。

我能阻止它做出修改吗?

可以。在将 readOnly 设置为 true 的维基上,写入工具会被拒绝。

它支持哪些扩展?

NeoWiki、Semantic MediaWiki、Bucket、Cargo 和 Wikibase 工具只会在安装了相应扩展的维基上注册。

它是 MediaWiki 官方做的吗?

不是。它由 Professional Wiki 制作。

如果不能用

  • ›使用私有维基时,请创建 config.json;如果它位于其他位置,请将 CONFIG 设置为它的路径。
  • ›如果在没有浏览器的服务器上进行 OAuth,请设置 MCP_OAUTH_NO_BROWSER=1,然后打开日志中显示的网址。
  • ›如果回复被截断,请提高 MCP_CONTENT_MAX_BYTES。

每周 5 个新技能,1 分钟读完。