Get the FREE Ultimate OpenClaw Setup Guide →

py-3rdparty-mediawiki

Wrapper for pywikibot and mwclient MediaWiki API librarties with improvements for 3rd party wikis and mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio wolfgangfahl-py-3rdparty-mediawiki python -m py3rdparty_mediawiki \
  --env MW_API_URL="URL of the MediaWiki API to connect to (e.g., https://example.org/w/api.php)" \
  --env MW_PASSWORD="Password for authenticated access (optional)" \
  --env MW_USERNAME="Username for authenticated access (optional)"

How to use

py-3rdparty-mediawiki is a Python-based MCP server that provides tools to interact with third-party MediaWiki installations via the mwclient-based capabilities exposed by the package. It enables querying, fetching, and manipulating content from external MediaWiki instances, with helpers that simplify common tasks such as retrieving page content, parsing revisions, or listing categories. The server is designed to be run as an MCP endpoint and can be invoked to perform scripted interactions against a target MediaWiki API. After starting the server, you can leverage the included command-line interface or library API to perform operations such as obtaining page HTML or wikitext, resolving redirects, or iterating over pages in a category.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • Access to install Python packages (pip)

Installation steps:

  1. Prepare a Python virtual environment (optional but recommended): python -m venv env source env/bin/activate # On Windows use: env\Scripts\activate

  2. Install the package from PyPI: pip install py-3rdparty-mediawiki

  3. Verify installation and learn usage: python -m py3rdparty_mediawiki --help

  4. (Optional) Run via pipx for isolated exposure: pipx install py-3rdparty-mediawiki pipx run py3rdparty_mediawiki --help

  5. Start the MCP server using the configured command: (the exact invocation depends on how your MCP orchestrates servers; typically you would rely on the mcp_config above to standardize startup)

Notes:

  • If you plan to use authenticated access to a protected MediaWiki instance, set MW_API_URL, MW_USERNAME, and MW_PASSWORD environment variables before running the server.

Additional notes

Environment variables and configuration:

  • MW_API_URL: The API endpoint of the target MediaWiki instance. Example: https://example.org/w/api.php
  • MW_USERNAME / MW_PASSWORD: Credentials for authenticated interactions if required by the target API.
  • Ensure network access to the target MediaWiki API from the MCP host.

Common issues:

  • Incorrect API URL or missing API access permissions can lead to authentication or 403 errors.
  • Some MediaWiki installations require CSRF tokens for write operations; ensure the client handles token management if you perform edits.
  • If the module name differs in your environment, adjust the -m argument to point to the correct Python module exposing the CLI.

Configuration options:

  • The package typically exposes a CLI and/or library APIs to fetch content, parse revisions, and interact with pages. Review the help output (python -m py3rdparty_mediawiki --help) to learn available commands and arguments.
  • When running inside an MCP, keep sensitive credentials in environment variables or a secure secrets store rather than hard-coding them.

Related MCP Servers

Sponsor this space

Reach thousands of developers