A Model Context Protocol (MCP) server that retrieves information from Wikipedia to provide context to Large Language Models (LLMs). This tool helps AI assistants access factual information from Wikipedia to ground their responses in reliable sources.
The Wikipedia MCP server provides real-time access to Wikipedia information through a standardized Model Context Protocol interface. This allows LLMs to retrieve accurate and up-to-date information directly from Wikipedia to enhance their responses.
To install wikipedia-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @Rudra-ravi/wikipedia-mcp --client claude
# Install pipx if you don't have it
sudo apt install pipx
pipx ensurepath
# Install the Wikipedia MCP server
pipx install git+https://github.com/rudra-ravi/wikipedia-mcp.git
# Create a virtual environment
python3 -m venv venv
# Activate the virtual environment
source venv/bin/activate
# Install the package
pip install git+https://github.com/rudra-ravi/wikipedia-mcp.git
# Clone the repository
git clone https://github.com/rudra-ravi/wikipedia-mcp.git
cd wikipedia-mcp
# Create a virtual environment
python3 -m venv wikipedia-mcp-env
source wikipedia-mcp-env/bin/activate
# Install in development mode
pip install -e .
# If installed with pipx
wikipedia-mcp
# If installed in a virtual environment
source venv/bin/activate
wikipedia-mcp
# Specify transport protocol (default: stdio)
wikipedia-mcp --transport stdio # For Claude Desktop
wikipedia-mcp --transport sse # For HTTP streaming
Add the following to your Claude Desktop configuration file:
{
"mcpServers": {
"wikipedia": {
"command": "wikipedia-mcp"
}
}
}
Location of the configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
The Wikipedia MCP server provides the following tools for LLMs to interact with Wikipedia:
search_wikipedia
Search Wikipedia for articles matching a query.
Parameters:
query
(string): The search termlimit
(integer, optional): Maximum number of results to return (default: 10)Returns:
get_article
Get the full content of a Wikipedia article.
Parameters:
title
(string): The title of the Wikipedia articleReturns:
get_summary
Get a concise summary of a Wikipedia article.
Parameters:
title
(string): The title of the Wikipedia articleReturns:
get_sections
Get the sections of a Wikipedia article.
Parameters:
title
(string): The title of the Wikipedia articleReturns:
get_links
Get the links contained within a Wikipedia article.
Parameters:
title
(string): The title of the Wikipedia articleReturns:
get_related_topics
Get topics related to a Wikipedia article based on links and categories.
Parameters:
title
(string): The title of the Wikipedia articlelimit
(integer, optional): Maximum number of related topics (default: 10)Returns:
Once the server is running and configured with Claude Desktop, you can use prompts like:
The server also provides MCP resources (similar to HTTP endpoints but for MCP):
search/{query}
: Search Wikipedia for articles matching the queryarticle/{title}
: Get the full content of a Wikipedia articlesummary/{title}
: Get a summary of a Wikipedia articlesections/{title}
: Get the sections of a Wikipedia articlelinks/{title}
: Get the links in a Wikipedia article# Clone the repository
git clone https://github.com/rudra-ravi/wikipedia-mcp.git
cd wikipedia-mcp
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install the package in development mode
pip install -e .
# Install development dependencies
pip install -r requirements.txt
# Run the server
wikipedia-mcp
wikipedia_mcp/
: Main package
__main__.py
: Entry point for the packageserver.py
: MCP server implementationwikipedia_client.py
: Wikipedia API clientapi/
: API implementationcore/
: Core functionalityutils/
: Utility functionsThe Model Context Protocol (MCP) is not a traditional HTTP API but a specialized protocol for communication between LLMs and external tools. Key characteristics:
Claude Desktop acts as the MCP client, while this server provides the tools and resources that Claude can use to access Wikipedia information.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
{
"mcpServers": {
"wikipedia": {
"env": {},
"args": [],
"command": "wikipedia-mcp"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.