by Rudra-ravi
Provides real-time Wikipedia information to large language models via the Model Context Protocol, enabling factual grounding for AI assistants.
Retrieves and serves Wikipedia content—including full articles, summaries, sections, links, coordinates, and related topics—through a standardized MCP interface, allowing LLMs to access reliable, up‑to‑date knowledge without leaving the model environment.
pipx install wikipedia-mcp).wikipedia-mcp # defaults to stdio (Claude Desktop)
wikipedia-mcp --transport sse --host 0.0.0.0 --port 8080 # HTTP streaming
{
"mcpServers": { "wikipedia": { "command": "wikipedia-mcp" } }
}
--language zh-hans, --country US, --enable-cache.--country TW, --language sr-latn).--language or --country flag.Q: Which transport should I use?
A: Use stdio for Claude Desktop; use sse for HTTP streaming or container deployments.
Q: How do I install globally?
A: pipx install wikipedia-mcp ensures the command is in the system PATH.
Q: Can I run the server in Docker?
A: Yes. Build the image with docker build -t wikipedia-mcp . and run:
docker run --rm -p 8080:8080 wikipedia-mcp \
wikipedia-mcp --transport sse --host 0.0.0.0 --port 8080
Q: How do I enable caching?
A: Add the --enable-cache flag when starting the server.
Q: What if Claude Desktop cannot find the command?
A: Provide the full path to the executable in the configuration or install via pipx for a globally accessible command.
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.
--language or -l argument when running the server (e.g., wikipedia-mcp --language ta for Tamil).--country US, --country China, or --country TW instead of language codes. Automatically maps to appropriate Wikipedia language variants.zh-hans for Simplified Chinese, zh-tw for Traditional Chinese), Serbian scripts (sr-latn, sr-cyrl), and other regional variants.The best way to install for Claude Desktop usage is with pipx, which installs the command globally:
# Install pipx if you don't have it
pip install pipx
pipx ensurepath
# Install the Wikipedia MCP server
pipx install wikipedia-mcp
This ensures the wikipedia-mcp command is available in Claude Desktop's PATH.
To install wikipedia-mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @Rudra-ravi/wikipedia-mcp --client claude
You can also install directly from PyPI:
pip install wikipedia-mcp
Note: If you use this method and encounter connection issues with Claude Desktop, you may need to use the full path to the command in your configuration. See the Configuration section for details.
# 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
# Specify language (default: en for English)
wikipedia-mcp --language ja # Example for Japanese
wikipedia-mcp --language zh-hans # Example for Simplified Chinese
wikipedia-mcp --language zh-tw # Example for Traditional Chinese (Taiwan)
wikipedia-mcp --language sr-latn # Example for Serbian Latin script
# Specify country/locale (alternative to language codes)
wikipedia-mcp --country US # English (United States)
wikipedia-mcp --country China # Chinese Simplified
wikipedia-mcp --country Taiwan # Chinese Traditional (Taiwan)
wikipedia-mcp --country Japan # Japanese
wikipedia-mcp --country Germany # German
wikipedia-mcp --country france # French (case insensitive)
# List all supported countries
wikipedia-mcp --list-countries
# Optional: Specify host/port for SSE (use 0.0.0.0 for containers)
wikipedia-mcp --transport sse --host 0.0.0.0 --port 8080
# Optional: Enable caching
wikipedia-mcp --enable-cache
# Combine options
wikipedia-mcp --country Taiwan --enable-cache --transport sse --port 8080
### Docker/Kubernetes
When running inside containers, bind the SSE server to all interfaces and map
the container port to the host or service:
```bash
# Build and run with Docker
docker build -t wikipedia-mcp .
docker run --rm -p 8080:8080 wikipedia-mcp \
wikipedia-mcp --transport sse --host 0.0.0.0 --port 8080
Kubernetes example (minimal):
apiVersion: apps/v1
kind: Deployment
metadata:
name: wikipedia-mcp
spec:
replicas: 1
selector:
matchLabels:
app: wikipedia-mcp
template:
metadata:
labels:
app: wikipedia-mcp
spec:
containers:
- name: server
image: your-repo/wikipedia-mcp:latest
args: ["--transport", "sse", "--host", "0.0.0.0", "--port", "8080"]
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: wikipedia-mcp
spec:
selector:
app: wikipedia-mcp
ports:
- name: http
port: 8080
targetPort: 8080
### Configuration for Claude Desktop
Add the following to your Claude Desktop configuration file:
**Option 1: Using command name (requires `wikipedia-mcp` to be in PATH)**
```json
{
"mcpServers": {
"wikipedia": {
"command": "wikipedia-mcp"
}
}
}
Option 2: Using full path (recommended if you get connection errors)
{
"mcpServers": {
"wikipedia": {
"command": "/full/path/to/wikipedia-mcp"
}
}
}
Option 3: With country/language specification
{
"mcpServers": {
"wikipedia-us": {
"command": "wikipedia-mcp",
"args": ["--country", "US"]
},
"wikipedia-taiwan": {
"command": "wikipedia-mcp",
"args": ["--country", "TW"]
},
"wikipedia-japan": {
"command": "wikipedia-mcp",
"args": ["--country", "Japan"]
}
}
}
To find the full path, run: which wikipedia-mcp
Configuration file locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonNote: If you encounter connection errors, see the Troubleshooting section for solutions.
The Wikipedia MCP server provides the following tools for LLMs to interact with Wikipedia:
search_wikipediaSearch Wikipedia for articles matching a query.
Parameters:
query (string): The search termlimit (integer, optional): Maximum number of results to return (default: 10)Returns:
get_articleGet the full content of a Wikipedia article.
Parameters:
title (string): The title of the Wikipedia articleReturns:
get_summaryGet a concise summary of a Wikipedia article.
Parameters:
title (string): The title of the Wikipedia articleReturns:
get_sectionsGet the sections of a Wikipedia article.
Parameters:
title (string): The title of the Wikipedia articleReturns:
get_linksGet the links contained within a Wikipedia article.
Parameters:
title (string): The title of the Wikipedia articleReturns:
get_coordinatesGet the coordinates of a Wikipedia article.
Parameters:
title (string): The title of the Wikipedia articleReturns:
title: The article titlepageid: The page IDcoordinates: List of coordinate objects with latitude, longitude, and metadataexists: Whether the article existserror: Any error message if retrieval failedget_related_topicsGet 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:
summarize_article_for_queryGet a summary of a Wikipedia article tailored to a specific query.
Parameters:
title (string): The title of the Wikipedia articlequery (string): The query to focus the summary onmax_length (integer, optional): Maximum length of the summary (default: 250)Returns:
summarize_article_sectionGet a summary of a specific section of a Wikipedia article.
Parameters:
title (string): The title of the Wikipedia articlesection_title (string): The title of the section to summarizemax_length (integer, optional): Maximum length of the summary (default: 150)Returns:
extract_key_factsExtract key facts from a Wikipedia article, optionally focused on a specific topic within the article.
Parameters:
title (string): The title of the Wikipedia articletopic_within_article (string, optional): A specific topic within the article to focus fact extractioncount (integer, optional): Number of key facts to extract (default: 5)Returns:
The Wikipedia MCP server supports intuitive country and region codes as an alternative to language codes. This makes it easier to access region-specific Wikipedia content without needing to know language codes.
Use --list-countries to see all supported countries:
wikipedia-mcp --list-countries
This will display countries organized by language, for example:
Supported Country/Locale Codes:
========================================
en: US, USA, United States, UK, GB, Canada, Australia, ...
zh-hans: CN, China
zh-tw: TW, Taiwan
ja: JP, Japan
de: DE, Germany
fr: FR, France
es: ES, Spain, MX, Mexico, AR, Argentina, ...
pt: PT, Portugal, BR, Brazil
ru: RU, Russia
ar: SA, Saudi Arabia, AE, UAE, EG, Egypt, ...
# Major countries by code
wikipedia-mcp --country US # United States (English)
wikipedia-mcp --country CN # China (Simplified Chinese)
wikipedia-mcp --country TW # Taiwan (Traditional Chinese)
wikipedia-mcp --country JP # Japan (Japanese)
wikipedia-mcp --country DE # Germany (German)
wikipedia-mcp --country FR # France (French)
wikipedia-mcp --country BR # Brazil (Portuguese)
wikipedia-mcp --country RU # Russia (Russian)
# Countries by full name (case insensitive)
wikipedia-mcp --country "United States"
wikipedia-mcp --country China
wikipedia-mcp --country Taiwan
wikipedia-mcp --country Japan
wikipedia-mcp --country Germany
wikipedia-mcp --country france # Case insensitive
# Regional variants
wikipedia-mcp --country HK # Hong Kong (Traditional Chinese)
wikipedia-mcp --country SG # Singapore (Simplified Chinese)
wikipedia-mcp --country "Saudi Arabia" # Arabic
wikipedia-mcp --country Mexico # Spanish
The server automatically maps country codes to appropriate Wikipedia language editions:
enzh-hans (Simplified Chinese)zh-tw (Traditional Chinese - Taiwan)zh-hk (Traditional Chinese - Hong Kong)zh-sg (Simplified Chinese - Singapore)ja, DE→de, FR→fr, ES→es, IT→it, RU→ru, etc.If you specify an unsupported country, you'll get a helpful error message:
$ wikipedia-mcp --country INVALID
Error: Unsupported country/locale: 'INVALID'.
Supported country codes include: US, USA, UK, GB, CA, AU, NZ, IE, ZA, CN.
Use --language parameter for direct language codes instead.
Use --list-countries to see supported country codes.
The Wikipedia MCP server supports language variants for languages that have multiple writing systems or regional variations. This feature is particularly useful for Chinese, Serbian, Kurdish, and other languages with multiple scripts or regional differences.
zh-hans - Simplified Chinesezh-hant - Traditional Chinesezh-tw - Traditional Chinese (Taiwan)zh-hk - Traditional Chinese (Hong Kong)zh-mo - Traditional Chinese (Macau)zh-cn - Simplified Chinese (China)zh-sg - Simplified Chinese (Singapore)zh-my - Simplified Chinese (Malaysia)sr-latn - Serbian Latin scriptsr-cyrl - Serbian Cyrillic scriptku-latn - Kurdish Latin scriptku-arab - Kurdish Arabic scriptno - Norwegian (automatically mapped to Bokmål)# Access Simplified Chinese Wikipedia
wikipedia-mcp --language zh-hans
# Access Traditional Chinese Wikipedia (Taiwan)
wikipedia-mcp --language zh-tw
# Access Serbian Wikipedia in Latin script
wikipedia-mcp --language sr-latn
# Access Serbian Wikipedia in Cyrillic script
wikipedia-mcp --language sr-cyrl
When you specify a language variant like zh-hans, the server:
zh for Chinese variants)This approach ensures optimal compatibility with Wikipedia's API while providing access to variant-specific content and formatting.
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 articlecoordinates/{title}: Get the coordinates of a Wikipedia articlesummary/{title}/query/{query}/length/{max_length}: Get a query-focused summary of an articlesummary/{title}/section/{section_title}/length/{max_length}: Get a summary of a specific article sectionfacts/{title}/topic/{topic_within_article}/count/{count}: Extract key facts from an 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 and test dependencies
pip install -r requirements-dev.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 functionstests/: Test suite
test_basic.py: Basic package teststest_cli.py: Command-line interface teststest_server_tools.py: Comprehensive server and tool testsThe project includes a comprehensive test suite to ensure reliability and functionality.
The test suite is organized in the tests/ directory with the following test files:
test_basic.py: Basic package functionality teststest_cli.py: Command-line interface and transport teststest_server_tools.py: Comprehensive tests for all MCP tools and Wikipedia client functionality# Install test dependencies
pip install -r requirements-dev.txt
# Run all tests
python -m pytest tests/ -v
# Run tests with coverage
python -m pytest tests/ --cov=wikipedia_mcp --cov-report=html
# Run only unit tests (excludes integration tests)
python -m pytest tests/ -v -m "not integration"
# Run only integration tests (requires internet connection)
python -m pytest tests/ -v -m "integration"
# Run specific test file
python -m pytest tests/test_server_tools.py -v
The project uses pytest.ini for test configuration:
[pytest]
markers =
integration: marks tests as integration tests (may require network access)
slow: marks tests as slow running
testpaths = tests
addopts = -v --tb=short
All tests are designed to:
When contributing new features:
Problem: Claude Desktop shows errors like spawn wikipedia-mcp ENOENT or cannot find the command.
Cause: This occurs when the wikipedia-mcp command is installed in a user-specific location (like ~/.local/bin/) that's not in Claude Desktop's PATH.
Solutions:
Use full path to the command (Recommended):
{
"mcpServers": {
"wikipedia": {
"command": "/home/username/.local/bin/wikipedia-mcp"
}
}
}
To find your exact path, run: which wikipedia-mcp
Install with pipx for global access:
pipx install wikipedia-mcp
Then use the standard configuration:
{
"mcpServers": {
"wikipedia": {
"command": "wikipedia-mcp"
}
}
}
Create a symlink to a global location:
sudo ln -s ~/.local/bin/wikipedia-mcp /usr/local/bin/wikipedia-mcp
The 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.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by exa-labs
Provides real-time web search capabilities to AI assistants via a Model Context Protocol server, enabling safe and controlled access to the Exa AI Search API.
by perplexityai
Enables Claude and other MCP‑compatible applications to perform real‑time web searches through the Perplexity (Sonar) API without leaving the MCP ecosystem.
by MicrosoftDocs
Provides semantic search and fetch capabilities for Microsoft official documentation, returning content in markdown format via a lightweight streamable HTTP transport for AI agents and development tools.
by elastic
Enables natural‑language interaction with Elasticsearch indices via the Model Context Protocol, exposing tools for listing indices, fetching mappings, performing searches, running ES|QL queries, and retrieving shard information.
by graphlit
Enables integration between MCP clients and the Graphlit platform, providing ingestion, extraction, retrieval, and RAG capabilities across a wide range of data sources and connectors.
by mamertofabian
Fast cross‑platform file searching leveraging the Everything SDK on Windows, Spotlight on macOS, and locate/plocate on Linux.
by cr7258
Provides Elasticsearch and OpenSearch interaction via Model Context Protocol, enabling document search, index management, cluster monitoring, and alias operations.
by kagisearch
Provides web search and video summarization capabilities through the Model Context Protocol, enabling AI assistants like Claude to perform queries and summarizations.
by liuyoshio
Provides natural‑language search and recommendation for Model Context Protocol servers, delivering rich metadata and real‑time updates.