WikiEngine-MCP-Gateway
Facilitate programmatic interaction with MediaWiki and WikiBase endpoints via the Model Context Protocol (MCP) layer. Enables fetching and modification of wiki articles through standardized application interfaces.
Author

lucamauri
Quick Info
Actions
Tags
WikiEngineAdapter
A specialized Model Context Protocol (MCP) connector engineered for interfacing with the application programming interfaces (APIs) of MediaWiki installations and WikiBase repositories. This component abstracts backend complexities, permitting script-driven retrieval and modification of wiki page content within the MCP ecosystem.
Core Capabilities
- Retrieve the textual payload of any designated MediaWiki article.
- Overwrite or update the contents of a MediaWiki entry, supporting an optional explanatory revision summary.
- Customizable endpoint configuration to target diverse MediaWiki and WikiBase servers.
Prerequisites
- Execution environment requires Node.js version 16 or newer.
- TypeScript development toolchain is recommended.
- A functional MediaWiki deployment must permit API access.
Setup Procedure
-
Obtain the source code repository: bash git clone https://github.com/yourusername/mediawikiadapter.git cd mediawikiadapter
-
Install necessary project dependencies: bash npm install
-
Compile the project artifacts: bash npm run build
Operational Guide
Adapter Initialization Configuration
Customize the target API gateways during server setup:
javascript server.configure({ mediaWikiAPIBase: "https://my.mediawiki.instance/api.php", wikiBaseAPIBase: "https://my.wikibase.instance/api.php", });
Launching the MCP Orchestrator
Execute the primary server bootstrap file: bash node build/index.js
Exposed Utilities
retrieveArticleContent
Fetches the complete markup or content of a specified wiki document.
- Input Payload Specification:
{ "title": "string" }
- Response Payload Specification:
{ "content": "string" }
Operational Example:
javascript const result = await server.callResource("retrieveArticleContent", { title: "Main Page", }); console.log(result.content);
updateArticle
Applies modifications to an existing MediaWiki article.
- Input Payload Specification:
{ "title": "string", "content": "string", "summary": "string (optional)" }
- Response Payload Specification:
{ "success": "boolean" }
Operational Example:
javascript const operationStatus = await server.callTool("updateArticle", { title: "Main Page", content: "Revised content deployed.", summary: "Automated update via WikiEngineAdapter", }); console.log(operationStatus.success ? "Modification confirmed" : "Modification unsuccessful");
Development Workflow
Running in Debug Mode
Activate continuous compilation and execution for development: bash npm run dev
Code Quality Checks
Execute the static analysis tools: bash npm run lint
Validation Suites
Unit and integration tests can be executed via: bash npm test
Default Endpoints
The adapter utilizes the following default remote service locations:
- MediaWiki Gateway: https://en.wikipedia.org/w/api.php
- WikiBase Gateway: https://www.wikidata.org/w/api.php
Overrides can be implemented via the server.configure() mechanism.
Collaboration Guidelines
We encourage community contributions. Adhere to these steps for submission:
- Fork the primary repository.
- Establish a dedicated branch for your proposed feature or bug resolution.
- Submit a comprehensive pull request detailing the modifications made.
Licensing
This software package is distributed under the LGPL-3.0-or-later license terms. Consult the LICENSE file for comprehensive details.
Creator
Developed by Luca Mauri.
XMLHttpRequest (XHR) provides a client-side JavaScript API for issuing HTTP requests asynchronously from a browser to a server, enabling dynamic content retrieval post-page load. It is foundational to Asynchronous JavaScript and XML (Ajax) methodologies, contrasting with older methods like full page reloads via hyperlink navigation or form submission. The concept originated around 2000 within Microsoft Outlook development and was first deployed in Internet Explorer 5 (1999) using ActiveXObject identifiers. By Internet Explorer 7 (2006), the standard XMLHttpRequest identifier was universally adopted across major browser engines (Gecko 2002, Safari 1.2 2004, Opera 8.0 2005). The W3C standardized the interface in 2006, with Level 2 enhancements arriving in 2008, adding progress monitoring and cross-site request capabilities, later integrated back into the main specification. Development is currently maintained by WHATWG using Web IDL.
General usage involves object instantiation, method invocation (open to set parameters like type and endpoint, and send to dispatch the request), and setting up an event listener to handle state transitions. Upon reaching state 4 ("done"), the response data is available, typically in the responseText property. Advanced control includes setting custom headers, uploading payload data via send, streaming response parsing, and request abortion functionality.
