Get the FREE Ultimate OpenClaw Setup Guide →

mediawiki-api

A Model Context Protocol (MCP) server that allows LLMs to interact with MediaWiki installations through the MediaWiki API as a bot user.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio entanglr-mediawiki-api-mcp uv run mediawiki-api-mcp \
  --env MEDIAWIKI_API_URL="http://mediawiki.test/api.php" \
  --env MEDIAWIKI_API_BOT_PASSWORD="YourBotPassword" \
  --env MEDIAWIKI_API_BOT_USERNAME="YourUserName@YourBotName" \
  --env MEDIAWIKI_API_BOT_USER_AGENT="MediaWiki-MCP-Bot/1.0 (your.email@mediawiki.test)"

How to use

This MCP server provides a set of wiki_ tools that enable an LLM to interact with a MediaWiki installation via the MediaWiki API as a bot user. The tools cover common wiki operations such as retrieving page content, editing pages, moving pages, deleting or undeleting pages, and performing searches. The tools are organized with the wiki_ prefix (e.g., wiki_page_get, wiki_page_edit, wiki_search, wiki_opensearch, wiki_meta_siteinfo). You can invoke these tools through the MCP interface exposed by the server, allowing automated workflows or chat-based assistants to perform content management tasks on a connected MediaWiki site. The server handles authentication, CSRF tokens, error handling, and returns results in MCP-friendly responses for easy consumption by large language models. To run locally, start the server using the provided uv command and then issue tool calls via the MCP client as documented in your integration flow.

How to install

Prerequisites:

  • Python 3.8+ (recommended 3.10+)
  • Git
  • Access to install Python dependencies (pip/uv)

Installation steps:

  1. Clone the repository and switch to the main branch:
git clone https://github.com/entanglr/mediawiki-api-mcp.git
cd mediawiki-api-mcp
git checkout main
  1. Create and activate a Python environment (optional but recommended):
python3 -m venv venv
# On macOS/Linux
source venv/bin/activate
# On Windows
venv\Scripts\activate.bat
  1. Install dependencies via UV (as per the project docs):
uv install
  1. Set up environment variables (examples shown in the README):
export MEDIAWIKI_API_URL="http://mediawiki.test/api.php"
export MEDIAWIKI_API_BOT_USERNAME="YourUserName@YourBotName"
export MEDIAWIKI_API_BOT_PASSWORD="YourBotPassword"
export MEDIAWIKI_API_BOT_USER_AGENT="MediaWiki-MCP-Bot/1.0 (your.email@mediawiki.test)"  # Optional
  1. Run the server (see the Usage section for alternative starting methods):
uv run mediawiki-api-mcp

Optional: verify installation by running the direct Python module if preferred:

python -m mediawiki_api_mcp.server

Additional notes

Notes and tips:

  • Ensure bot credentials have the minimum required permissions for the operations you plan to perform (read for reads; edit/move/delete as needed).
  • Keep bot passwords secure and avoid committing them to version control; use environment management or secret stores in production.
  • The server uses an asynchronous design; non-blocking I/O is leveraged for API calls to MediaWiki.
  • If you change the MediaWiki API URL, update MEDIAWIKI_API_URL accordingly and restart the server.
  • For Claude Desktop integration, you can embed the MCP config snippet in your claude_desktop_config.json to streamline startup connections.
  • Review the individual wiki_ tool docs (docs/tools/wiki_*.md) for tool-specific parameters and expected outputs.

Related MCP Servers

Sponsor this space

Reach thousands of developers