How to Use the MediaWiki MCP in LangChain
Feed live wiki data directly into your LangChain reasoning loops and write page updates based on chain outputs.
Works with every AI agent you already use
…and any MCP-compatible client
Connect MediaWiki MCP to LangChain
Create your Vinkius account to connect MediaWiki to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Chain MediaWiki search queries with LangChain
This MediaWiki MCP Server lets your LangChain agent run full-text searches across your wiki using `search_pages` and then instantly fetch contents with `get_page_revisions`. The agent takes the search results, passes them through your prompt template, and determines if a page requires modification. Once the chain decides on an edit, it requests a CSRF token using `get_tokens` and writes the update directly via `edit_page`. You can trace this entire multi-step decision process in LangSmith to see exactly how the agent formulated its wiki updates.
Map category structures in LangChain
This MediaWiki toolset enables your LangChain chains to traverse complex category hierarchies using `list_category_members` and `get_page_categories`. Your agent reads the category tree, identifies missing links, and plans directory structures without human intervention. By feeding these category lists into a routing chain, the agent decides which branch of your LangChain pipeline should handle the document. This approach replaces hardcoded MediaWiki API scripts with dynamic, context-aware content sorting inside LangChain.
Track wiki changes in LangChain loops
This MediaWiki MCP Server integration feeds recent edits straight into your LangChain agentic workflows using `list_recent_changes`. The agent monitors this real-time MediaWiki feed to trigger specific downstream tasks, like notifying Slack or updating a vector database when a page changes. It retrieves the exact metadata with `get_page_info` and checks who made the modification using `get_user_info`. You get a completely automated monitoring loop that connects MediaWiki activity directly to your custom LangChain chains.
Set up MediaWiki MCP in LangChain
Prerequisites
- Python 3.10+ installed
-
langchain-mcp-adapters+langgraphpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChainBaseToolobjects. - 2
Connect via HTTP transport
Use
MultiServerMCPClientwith"transport": "http"pointing to your Vinkius endpoint. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Create a ReAct agent
Pass the discovered tools to
create_react_agent()from LangGraph. The agent automatically routes MediaWiki tool calls through the MCP protocol. - 4
Run with any LLM
Swap
ChatOpenAIforChatAnthropic,ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"mediawiki-mcp": {
"transport": "http",
"url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
}
}) as client:
tools = client.get_tools()
agent = create_react_agent(
ChatOpenAI(model="gpt-4o"),
tools,
)
result = await agent.ainvoke({
"messages": "List recent MediaWiki transactions"
})
print(result["messages"][-1].content) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by MediaWiki. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about MediaWiki MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the MediaWiki MCP today
We host it, we monitor it, we maintain it. You just paste one token.