wikipedia
Provides tools for searching Wikipedia and retrieving page content, enabling AI agents to access Wikipedia knowledge.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wikipediaSearch Wikipedia for the history of artificial intelligence"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🚀 FastAPI + FastMCP + LangChain Wikipedia Agent
An AI-powered Wikipedia research agent demonstrating how FastAPI, FastMCP, LangChain, and LangGraph can work together to build a modular tool-using AI application.
The project exposes Wikipedia capabilities through an MCP (Model Context Protocol) server and allows a LangChain/LangGraph agent to automatically discover and use those tools.
🏗️ Architecture
┌──────────────────────┐
│ User │
│ Natural Language │
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ FastAPI │
│ Application API │
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ LangChain Agent │
│ LangGraph │
└──────────┬───────────┘
│
MCP Protocol
│
▼
┌──────────────────────┐
│ FastMCP │
│ MCP Server │
└──────────┬───────────┘
│
┌──────────┴───────────┐
▼ ▼
┌──────────────┐ ┌──────────────┐
│ Wikipedia │ │ Wikipedia │
│ Search │ │ Page │
└──────────────┘ └──────────────┘Related MCP server: MCP Wikipedia Server
✨ Features
🤖 LLM-powered Wikipedia research
🔌 Model Context Protocol (MCP) integration
⚡ FastAPI application layer
🧠 LangChain agent integration
🔄 LangGraph ReAct agent
🔎 Wikipedia search tool
📄 Wikipedia page retrieval tool
🔗 MCP tool discovery
📡 stdio-based MCP communication
🧩 Modular architecture that can easily support additional tools
🛠️ Tech Stack
Technology | Purpose |
Python | Core programming language |
FastAPI | API/application layer |
FastMCP | MCP server and tool implementation |
LangChain | LLM and tool integration |
LangGraph | Agent workflow |
Requests | Wikipedia API requests |
Wikipedia REST API | External knowledge source |
🔧 MCP Tools
The FastMCP server exposes two tools.
search_wikipedia
Searches Wikipedia for a given topic.
@mcp.tool
def search_wikipedia(query: str):
...Example:
Search Wikipedia for Albert EinsteinThe agent can automatically decide to call:
search_wikipedia("Albert Einstein")get_wikipedia_page
Retrieves the content of a specific Wikipedia page.
@mcp.tool
def get_wikipedia_page(title: str):
...Example:
Get the Wikipedia page for Artificial IntelligenceThe agent can call:
get_wikipedia_page("Artificial Intelligence")🔄 How MCP Works in This Project
The MCP server runs using:
mcp.run(transport="stdio")The LangChain client connects to the MCP server:
client = MultiServerMCPClient(
{
"wikipedia": {
"command": "python",
"args": ["server.py"],
"transport": "stdio",
}
}
)The client then discovers the available MCP tools:
tools = await client.get_tools()These tools are passed to the LangGraph agent:
agent = create_react_agent(
model,
tools
)The LLM can then decide which tool to use based on the user's request.
⚙️ Installation
1. Clone the repository
git clone https://github.com/YOUR_USERNAME/langchain-mcp-wikipedia.gitcd langchain-mcp-wikipedia2. Create a virtual environment
Windows:
python -m venv venv
venv\Scripts\activateLinux/macOS:
python3 -m venv venv
source venv/bin/activate3. Install dependencies
pip install -r requirements.txt🔐 Environment Variables
Create a .env file:
OPENAI_API_KEY=your_openai_api_key🧠 Why MCP?
Traditional tool integration often tightly couples an LLM application with individual APIs.
MCP provides a standardized way to expose capabilities as tools.
LLM
│
▼
LangChain / LangGraph
│
▼
MCP Client
│
▼
MCP Server
│
├── Wikipedia
├── Search
├── Database
├── APIs
└── Custom ToolsThis separation makes tools reusable across different AI applications and agents.
📌 Key Concepts Demonstrated
This project is useful for learning:
Model Context Protocol (MCP)
FastMCP
MCP servers
MCP clients
stdio transport
LangChain tool integration
LangGraph agents
ReAct agents
FastAPI
External API integration
LLM tool calling
Modular AI agent architecture
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityBmaintenanceA Model Context Protocol server that retrieves information from Wikipedia to provide context to LLMs, allowing users to search articles, get summaries, full content, sections, and links from Wikipedia.22285MIT
- FlicenseNot gradedqualityDmaintenanceA production-ready server that provides Wikipedia search and content retrieval tools through the Model Context Protocol, enabling AI assistants to search for articles, list sections, and retrieve specific content.
- AlicenseAqualityCmaintenanceEnables LLMs to search for keywords and fetch full page content from Wikipedia across various languages. It provides direct access to Wikipedia information through search and fetch tools.23MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to search, read, and explore Wikipedia articles via tools like summaries, categories, and random articles, with no API keys required.1MIT
Related MCP Connectors
Real-time Amazon, WIPO & PACER data for AI agents — 19 tools via the MCP protocol.
Web research for agents: quality-scored Google search, webpage extraction, and deep research.
LLM-ready web search + instant answers + URL-to-clean-text fetch for agents and RAG.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JOBIN456/wikipedia-mcp-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server