home / mcp / wikipedia mcp server

Wikipedia MCP Server

A Model Context Protocol (MCP) server that retrieves information from Wikipedia to provide context to LLMs.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "rudra-ravi-wikipedia-mcp": {
      "command": "wikipedia-mcp",
      "args": [],
      "env": {
        "WIKIPEDIA_ACCESS_TOKEN": "your_wikipedia_token_here"
      }
    }
  }
}

You can run the Wikipedia MCP Server to provide real-time Wikipedia information to language models through a Model Context Protocol interface. It lets you search, retrieve, summarize, and link Wikipedia content so your AI assistants ground their responses in reliable, up-to-date sources.

How to use

To use the Wikipedia MCP Server, start the server locally and connect your MCP-compatible client (such as Claude Desktop) to it. The server exposes a set of tools that let you search for Wikipedia articles, fetch full content, obtain summaries, extract sections, and discover related topics. You can also request variant content by language or country to access the appropriate Wikipedia edition.

How to install

Prerequisites: Python 3.8+ and a working network connection. You will also need a way to run commands from your environment (shell access). The installation flow provides multiple options so you can choose what best fits your setup.

# Using pipx (Recommended for Claude Desktop usage)
# Install pipx if you don't have it
pip install pipx
pipx ensurepath

# Install the Wikipedia MCP server
pipx install wikipedia-mcp

# This makes the wikipedia-mcp command available in your PATH

Alternative installation methods are available if you prefer different tooling or package sources.

# Using Smithery for Claude Desktop auto-install
npx -y @smithery/cli install @Rudra-ravi/wikipedia-mcp --client claude

From PyPI (alternative method): you can install directly from PyPI and then run the server.

pip install wikipedia-mcp

Optional: set up a Python virtual environment to isolate dependencies.

python3 -m venv venv
source venv/bin/activate
pip install git+https://github.com/rudra-ravi/wikipedia-mcp.git

From source for development work: clone the repository, create a virtual environment, and install in editable mode.

git clone https://github.com/rudra-ravi/wikipedia-mcp.git
cd wikipedia-mcp
python3 -m venv wikipedia-mcp-env
source wikipedia-mcp-env/bin/activate
pip install -e .

Additional configuration and usage notes

When you run the server, you can enable caching to improve performance, and you may provide an access token to avoid rate limiting. You can choose transport options such as stdio, http, or streamable-http depending on your environment.

# Example run with HTTP transport and token (adjust as needed)
wikipedia-mcp --transport http --host 0.0.0.0 --port 8080 --path /mcp --enable-cache

# Optional: provide an access token to prevent rate limiting
wikipedia-mcp --access-token your_wikipedia_token_here

# Or set via environment variable
export WIKIPEDIA_ACCESS_TOKEN=your_wikipedia_token_here
wikipedia-mcp

If you expose the MCP server on a network, consider securing it with static bearer token or JWT validation for authenticity of incoming requests.

Troubleshooting tips

If you encounter connectivity or rate-limiting problems, verify your access token, check network access to wikipedia.org, and consider enabling the built-in cache to reduce repeated requests.

# Check connectivity to Wikipedia API (diagnostic steps you can perform in your environment)
curl https://en.wikipedia.org/w/api.php

# If you see rate limiting, try adding a small delay between requests or using an access token

Security and hosting considerations

For exposed deployments, use an authenticated transport and limit access to trusted clients. The server supports static bearer tokens and JWT validation to help you control who can issue MCP requests.

Available tools

search_wikipedia

Search Wikipedia for articles matching a query and return a list of results with titles, snippets, and metadata.

get_article

Retrieve the full content of a Wikipedia article, including text, summary, sections, links, and categories.

get_summary

Return a concise summary of a Wikipedia article.

get_sections

Extract and return the sections of a Wikipedia article in a structured format.

get_links

Get the links contained within a Wikipedia article.

get_coordinates

Fetch the coordinates associated with a Wikipedia article, including title, pageid, and coordinate data.

get_related_topics

Discover topics related to a given article based on links and categories.

summarize_article_for_query

Provide a focused summary of an article tailored to a specific query.

summarize_article_section

Generate a summary of a specific section within an article.

extract_key_facts

Extract key facts from an article, optionally focused on a topic within the article.