Nodemw MCP 服务器

xiedadatim/nodemw-mcp-server
Hosted
0 Stars 52 次浏览 更新于 2026-08-23

一个为 nodemw(Node.js MediaWiki API 客户端)构建的 Model Context Protocol (MCP) 服务器。它提供了读取和写入操作来与 MediaWiki 服务器交互。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "nodemw": {
      "args": [
        "-y",
        "@xiedada/nodemw-mcp-server@latest"
      ],
      "command": "npx",
      "env": {
        "NODEMW_MCP_MW_PASS": "secret",
        "NODEMW_MCP_MW_USER": "editor",
        "NODEMW_MCP_SERVER": "mywiki.example.com"
      }
    }
  }
}

该服务需要配置环境变量:NODEMW_MCP_MW_PASS、NODEMW_MCP_MW_USER、NODEMW_MCP_SERVER

可用工具 (33 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

get-article 6 个参数

Retrieve the content of a wiki article

该工具无需必填参数,直接调用即可

search 2 个参数 需填 1 项

Search for wiki pages by keyword

必填参数:keyword

get-pages-in-category 1 个参数 需填 1 项

Get all pages in a category

必填参数:category

get-categories 1 个参数

Get all categories matching a prefix

该工具无需必填参数,直接调用即可

get-users 3 个参数

Get all users matching a prefix

该工具无需必填参数,直接调用即可

get-all-pages 1 个参数

Get all non-redirect pages from the wiki

该工具无需必填参数,直接调用即可

get-pages-in-namespace 1 个参数 需填 1 项

Get all non-redirect pages in a specific namespace

必填参数:namespace

get-pages-by-prefix 1 个参数 需填 1 项

Get pages starting with a specific prefix

必填参数:prefix

get-pages-transcluding 1 个参数 需填 1 项

Get all pages that transclude (include) a specific template

必填参数:template

get-article-revisions 2 个参数

Get all revisions of a wiki article

该工具无需必填参数,直接调用即可

get-article-categories 2 个参数

Get all categories that an article belongs to

该工具无需必填参数,直接调用即可

get-article-properties 2 个参数

Get page properties (page_props table data) for a wiki article

该工具无需必填参数,直接调用即可

get-article-info 3 个参数

Get detailed information about one or more articles

该工具无需必填参数,直接调用即可

get-user-contribs 5 个参数

Get contributions made by a specific user. Pagination: the response includes total (matching edits found) and displayed (returned in this batch). If displayed < total, more results exist — use the timestamp of the LAST returned contribution as the start parameter for the next page. Repeat until displayed < limit to get all results.

该工具无需必填参数,直接调用即可

whoami

Get information about the currently logged in user

该工具无需必填参数,直接调用即可

whois 2 个参数

Get information about a specific user

该工具无需必填参数,直接调用即可

whoare 2 个参数

Get information about multiple wiki users

该工具无需必填参数,直接调用即可

get-images 2 个参数

Get list of images starting from a specific name

该工具无需必填参数,直接调用即可

get-images-from-article 1 个参数 需填 1 项

Get all images embedded in a specific article

必填参数:title

get-image-usage 1 个参数 需填 1 项

Get all pages that use a specific image

必填参数:filename

get-image-info 1 个参数 需填 1 项

Get detailed information about an image file

必填参数:filename

get-log 3 个参数 需填 1 项

Get log entries of a specific type (e.g. delete, block, move). Pagination: the response includes total (matching entries found) and displayed (returned in this batch). If displayed < total, more results exist — use the timestamp of the LAST returned entry as the start parameter for the next page.

必填参数:type

expand-templates 2 个参数 需填 1 项

Expand templates in wikitext

必填参数:text

parse 2 个参数 需填 1 项

Parse wikitext to HTML

必填参数:text

get-recent-changes 2 个参数

Get recent changes on the wiki. Pagination: the response includes total (matching changes found) and displayed (returned in this batch). If displayed < total, more results exist — use the timestamp of the LAST returned change as the start parameter for the next page.

该工具无需必填参数,直接调用即可

get-site-info 1 个参数 需填 1 项

Get site information from MediaWiki

必填参数:properties

get-site-stats

Get site statistics

该工具无需必填参数,直接调用即可

get-mediawiki-version

Get MediaWiki version running on the server

该工具无需必填参数,直接调用即可

get-query-page 1 个参数 需填 1 项

Get results from a query page (e.g. Ancientpages, Lonelypages, Wantedpages)

必填参数:name

get-external-links 1 个参数 需填 1 项

Get all external links from an article

必填参数:title

get-backlinks 1 个参数 需填 1 项

Get all backlinks to a specific page

必填参数:title

get-article-by-revision 1 个参数 需填 1 项

Retrieve the content of a wiki article by a specific revision ID, without needing the page title or ID

必填参数:revision

get-article-with-lineno 5 个参数

Retrieve a wiki article with line numbers. Like a code editor: each line is numbered starting from 1. Useful for precise line-based editing with replace-some-lines — the content returned here can be copy-pasted directly into old_lines without any escaping. Supports offset/limit for reading specific line ranges.

该工具无需必填参数,直接调用即可

服务介绍

Nodemw MCP Server

一个为 nodemw(Node.js MediaWiki API 客户端)构建的 Model Context Protocol (MCP) 服务器。

快速开始


# Install

npm install

npm run build



# Connect as guest

node dist/index.js zh.minecraft.wiki



# Connect with credentials

node dist/index.js -u myuser -p mypass mywiki.example.com

CLI 用法


nodemw-mcp-server [options] [server]

参数说明

参数 简写 说明
[server] (位置参数) 目标 MediaWiki 服务器,如 en.wikipedia.org
--server -s 同上,显式形式
--path API 脚本路径(默认:自动检测;先尝试 /w,再尝试根路径)
--user -u 登录用户名
--pass -p 登录密码
--dry-run 模拟运行模式(不实际进行编辑)

示例


# Guest access, auto-detect API path

nodemw-mcp-server zh.minecraft.wiki



# Authenticated, explicit API path

nodemw-mcp-server -u editor -p secret --path /w mywiki.example.com



# With full URL

nodemw-mcp-server -s https://en.wikipedia.org



# Dry-run mode for safe testing

nodemw-mcp-server --dry-run -u editor -p secret mywiki.example.com

环境变量

所有设置都可以通过环境变量进行配置。命令行参数优先级更高。

变量 等效于
NODEMW_MCP_SERVER --server / 位置参数
NODEMW_MCP_ENDPOINT_PATH --path
NODEMW_MCP_MW_USER --user / -u
NODEMW_MCP_MW_PASS --pass / -p

使用配置文件


{

  "mcpServers": {

    "nodemw": {

      "command": "npx",

      "args": ["@xiedada/nodemw-mcp-server"],

      "env": {

        "NODEMW_MCP_SERVER": "mywiki.example.com",

        "NODEMW_MCP_MW_USER": "editor",

        "NODEMW_MCP_MW_PASS": "secret"

      }

    }

  }

}

可用工具

读取操作(29个工具)

get-article, search, get-pages-in-category, get-categories, get-users, get-all-pages, get-pages-in-namespace, get-pages-by-prefix, get-pages-transcluding, get-article-revisions, get-article-categories, get-article-properties, get-article-info, get-user-contribs, whoami, whois, whoare, get-images, get-images-from-article, get-image-usage, get-image-info, get-log, expand-templates, parse, get-recent-changes, get-site-info, get-site-stats, get-mediawiki-version, get-external-links, get-backlinks, get-query-page

写入操作(12个工具,需要认证)

edit, append, prepend, move, delete, protect, purge, send-email, upload, upload-by-url, add-flow-topic, create-account

开发


npm run build        # Build dist/index.js

npm run dev          # Watch mode

npm run clean        # Remove dist/

npm test             # Run tests

许可证

Copyright (c) 2026 Xie Youtian

以源代码和二进制形式重新分发和使用,无论是否修改,都必须满足以下条件:

1. 源代码的重新分发必须保留上述版权声明、此条件列表以及以下免责声明。

2. 二进制形式的重新分发必须在文档和/或其他随分发提供的材料中复制上述版权声明、此条件列表以及以下免责声明。

本软件按“原样”提供,版权持有者和贡献者不作任何明示或暗示的保证,包括但不限于适销性和特定用途适用性的保证。在任何情况下,版权持有者或贡献者均不对因使用本软件而引起的直接、间接、附带、特殊、示例性或后果性损害(包括但不限于替代商品或服务的采购、使用损失、数据丢失或利润损失,或业务中断)承担责任,无论这些损害是基于合同、严格责任还是侵权行为(包括疏忽或其他原因)造成的,即使已被告知发生此类损害的可能性。| `--dry-run` | | 干运行模式(不执行实际编辑) |

示例


# 游客访问,自动检测 API 路径

nodemw-mcp-server zh.minecraft.wiki



# 认证访问,手动指定 API 路径

nodemw-mcp-server -u editor -p secret --path /w mywiki.example.com



# 使用完整 URL

nodemw-mcp-server -s https://en.wikipedia.org



# 干运行模式,安全测试

nodemw-mcp-server --dry-run -u editor -p secret mywiki.example.com

环境变量

所有设置都可以通过环境变量配置,CLI 参数优先级更高。

变量 等效参数
NODEMW_MCP_SERVER --server / 位置参数
NODEMW_MCP_ENDPOINT_PATH --path
NODEMW_MCP_MW_USER --user / -u
NODEMW_MCP_MW_PASS --pass / -p

配合配置文件使用


{

  "mcpServers": {

    "nodemw": {

      "command": "npx",

      "args": ["@xiedada/nodemw-mcp-server"],

      "env": {

        "NODEMW_MCP_SERVER": "mywiki.example.com",

        "NODEMW_MCP_MW_USER": "editor",

        "NODEMW_MCP_MW_PASS": "secret"

      }

    }

  }

}

可用工具

读取操作(29 个工具)

get-articlesearchget-pages-in-categoryget-categoriesget-usersget-all-pagesget-pages-in-namespaceget-pages-by-prefixget-pages-transcludingget-article-revisionsget-article-categoriesget-article-propertiesget-article-infoget-user-contribswhoamiwhoiswhoareget-imagesget-images-from-articleget-image-usageget-image-infoget-logexpand-templatesparseget-recent-changesget-site-infoget-site-statsget-mediawiki-versionget-external-linksget-backlinksget-query-page

写入操作(12 个工具,需要认证)

editappendprependmovedeleteprotectpurgesend-emailuploadupload-by-urladd-flow-topiccreate-account

开发


npm run build        # 构建 dist/index.js

npm run dev          # 监视模式

npm run clean        # 删除 dist/

npm test             # 运行测试

许可协议

版权所有 (c) 2026 Xie Youtian

在遵守以下条件的前提下,允许以源代码和二进制形式重新分发和使用,无论是否修改:

1. 源代码的再分发必须保留上述版权声明、此条件列表以及以下免责声明。

2. 二进制形式的再分发必须在随附的文档和/或其他材料中重现上述版权声明、此条件列表以及以下免责声明。

本软件由版权所有者和贡献者“按原样”提供,任何明示或暗示的保证,包括但不限于适销性和特定用途适用性的默示保证,均不予承担。在任何情况下,版权所有者或贡献者均不对因使用本软件而引起的任何直接、间接、偶发、特殊、惩戒性或后果性损害(包括但不限于替代商品或服务的采购、使用损失、数据丢失或利润损失,或业务中断)负责,无论这些损害是如何引起的,也无论责任理论是合同、严格责任还是侵权(包括疏忽或其他原因),即使已被告知此类损害的可能性。

相关 MCP 服务