{"id":32613804,"url":"https://github.com/rudra-ravi/wikipedia-mcp","last_synced_at":"2026-08-28T00:47:24.742Z","repository":{"id":281329863,"uuid":"944950963","full_name":"Rudra-ravi/wikipedia-mcp","owner":"Rudra-ravi","description":"A Model Context Protocol (MCP) server that retrieves information from Wikipedia to provide context to LLMs.","archived":false,"fork":false,"pushed_at":"2026-05-01T03:39:08.000Z","size":230,"stargazers_count":274,"open_issues_count":1,"forks_count":52,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-07-24T07:06:57.536Z","etag":null,"topics":["anthropic","llm","mcp-server","open-source","wikipedia","wikipedia-api","wikipedia-mcp","wikipedia-mcp-server"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/wikipedia-mcp/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rudra-ravi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":["Rudra-ravi"]}},"created_at":"2025-03-08T10:00:18.000Z","updated_at":"2026-07-22T03:23:45.000Z","dependencies_parsed_at":"2025-03-08T11:18:18.948Z","dependency_job_id":"5dec4851-4903-42f3-9bde-aa578687af9f","html_url":"https://github.com/Rudra-ravi/wikipedia-mcp","commit_stats":null,"previous_names":["rudra-ravi/wikipedia-mcp"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/Rudra-ravi/wikipedia-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rudra-ravi%2Fwikipedia-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rudra-ravi%2Fwikipedia-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rudra-ravi%2Fwikipedia-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rudra-ravi%2Fwikipedia-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rudra-ravi","download_url":"https://codeload.github.com/Rudra-ravi/wikipedia-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rudra-ravi%2Fwikipedia-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36947906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-22T15:14:58.755Z","status":"online","status_checked_at":"2026-08-27T02:00:07.166Z","response_time":96,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anthropic","llm","mcp-server","open-source","wikipedia","wikipedia-api","wikipedia-mcp","wikipedia-mcp-server"],"created_at":"2025-10-30T15:28:19.514Z","updated_at":"2026-08-28T00:47:24.734Z","avatar_url":"https://github.com/Rudra-ravi.png","language":"Python","funding_links":["https://github.com/sponsors/Rudra-ravi"],"categories":[],"sub_categories":[],"readme":"# Wikipedia MCP Server\n\n[![smithery badge](https://smithery.ai/badge/@Rudra-ravi/wikipedia-mcp)](https://smithery.ai/server/@Rudra-ravi/wikipedia-mcp)\n[![Listed on Spark](https://img.shields.io/badge/Listed%20on-Spark-blue)](https://spark.entire.vc/assets/vb-wikipedia-mcp)\n[![AgentSeal MCP](https://agentseal.org/api/v1/mcp/wikipedia-mcp/badge)](https://agentseal.org/mcp/wikipedia-mcp)\n\nA 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.\n\n\u003ca href=\"https://glama.ai/mcp/servers/@Rudra-ravi/wikipedia-mcp\"\u003e\n  \u003cimg width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/@Rudra-ravi/wikipedia-mcp/badge\" alt=\"Wikipedia Server MCP server\" /\u003e\n\u003c/a\u003e\n\n![image](https://github.com/user-attachments/assets/e41382f7-111a-4105-97f3-7851c906843e)\n\n## Overview\n\nThe 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.\n\n## Verified By\n\n[![MseeP.ai Security Assessment Badge](https://mseep.net/pr/rudra-ravi-wikipedia-mcp-badge.png)](https://mseep.ai/app/rudra-ravi-wikipedia-mcp)\n\n## Features\n\n- **Search Wikipedia**: Find articles matching specific queries with enhanced diagnostics\n- **Retrieve Article Content**: Get full article text with all information\n- **Article Summaries**: Get concise summaries of articles\n- **Section Extraction**: Retrieve specific sections from articles\n- **Link Discovery**: Find links within articles to related topics\n- **Related Topics**: Discover topics related to a specific article\n- **Multi-language Support**: Access Wikipedia in different languages by specifying the `--language` or `-l` argument when running the server (e.g., `wikipedia-mcp --language ta` for Tamil).\n- **Country/Locale Support**: Use intuitive country codes like `--country US`, `--country China`, or `--country TW` instead of language codes. Automatically maps to appropriate Wikipedia language variants.\n- **Language Variant Support**: Support for language variants such as Chinese traditional/simplified (e.g., `zh-hans` for Simplified Chinese, `zh-tw` for Traditional Chinese), Serbian scripts (`sr-latn`, `sr-cyrl`), and other regional variants.\n- **Optional caching**: Cache API responses for improved performance using --enable-cache\n- **Modern MCP Transport Support**: Supports `stdio`, `http`, and `streamable-http` (with legacy `sse` compatibility).\n- **Optional MCP Transport Auth**: Secure network transports with `--auth-mode static` or `--auth-mode jwt`.\n- **Google ADK Compatibility**: Fully compatible with Google ADK agents and other AI frameworks that use strict function calling schemas\n\n## Installation\n\n### Using pipx (Recommended for Claude Desktop)\n\nThe best way to install for Claude Desktop usage is with pipx, which installs the command globally:\n\n```bash\n# Install pipx if you don't have it\npip install pipx\npipx ensurepath\n\n# Install the Wikipedia MCP server\npipx install wikipedia-mcp\n```\n\nThis ensures the `wikipedia-mcp` command is available in Claude Desktop's PATH.\n\n### Installing via Smithery\n\nTo install wikipedia-mcp for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@Rudra-ravi/wikipedia-mcp):\n\n```bash\nnpx -y @smithery/cli install @Rudra-ravi/wikipedia-mcp --client claude\n```\n\n### From PyPI (Alternative)\n\nYou can also install directly from PyPI:\n\n```bash\npip install wikipedia-mcp\n```\n\n**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](#configuration-for-claude-desktop) section for details.\n\n### Using a virtual environment\n\n```bash\n# Create a virtual environment\npython3 -m venv venv\n\n# Activate the virtual environment\nsource venv/bin/activate\n\n# Install the package\npip install git+https://github.com/rudra-ravi/wikipedia-mcp.git\n```\n\n### From source\n\n```bash\n# Clone the repository\ngit clone https://github.com/rudra-ravi/wikipedia-mcp.git\ncd wikipedia-mcp\n\n# Create a virtual environment\npython3 -m venv wikipedia-mcp-env\nsource wikipedia-mcp-env/bin/activate\n\n# Install in development mode\npip install -e .\n```\n\n## Usage\n\n### Running the server\n\n```bash\n# If installed with pipx\nwikipedia-mcp\n\n# If installed in a virtual environment\nsource venv/bin/activate\nwikipedia-mcp\n\n# Specify transport protocol (default: stdio)\nwikipedia-mcp --transport stdio  # For Claude Desktop\nwikipedia-mcp --transport http --host 0.0.0.0 --port 8080 --path /mcp\nwikipedia-mcp --transport streamable-http --host 0.0.0.0 --port 8080 --path /mcp\nwikipedia-mcp --transport sse    # Legacy compatibility transport\n\n# Specify language (default: en for English)\nwikipedia-mcp --language ja  # Example for Japanese\nwikipedia-mcp --language zh-hans  # Example for Simplified Chinese\nwikipedia-mcp --language zh-tw    # Example for Traditional Chinese (Taiwan)\nwikipedia-mcp --language sr-latn  # Example for Serbian Latin script\n\n# Specify country/locale (alternative to language codes)\nwikipedia-mcp --country US        # English (United States)\nwikipedia-mcp --country China     # Chinese Simplified\nwikipedia-mcp --country Taiwan    # Chinese Traditional (Taiwan)  \nwikipedia-mcp --country Japan     # Japanese\nwikipedia-mcp --country Germany   # German\nwikipedia-mcp --country france    # French (case insensitive)\n\n# List all supported countries\nwikipedia-mcp --list-countries\n\n# Optional: Specify host/port/path for network transport (use 0.0.0.0 for containers)\nwikipedia-mcp --transport http --host 0.0.0.0 --port 8080 --path /mcp\n\n# Optional: Enable caching\nwikipedia-mcp --enable-cache\n\n# Optional: Use Personal Access Token to avoid rate limiting (403 errors)\nwikipedia-mcp --access-token your_wikipedia_token_here\n\n# Or set via environment variable\nexport WIKIPEDIA_ACCESS_TOKEN=your_wikipedia_token_here\nwikipedia-mcp\n\n# Optional: Secure incoming MCP network requests with static bearer token\nwikipedia-mcp --transport http --auth-mode static --auth-token your_mcp_token --host 0.0.0.0 --port 8080\n\n# Optional: Secure incoming MCP network requests with JWT validation\nwikipedia-mcp --transport http --auth-mode jwt --auth-jwks-uri https://issuer/.well-known/jwks.json --auth-issuer https://issuer\n\n# Security note: prefer http/streamable-http + auth-mode for exposed network transport.\n\n# Combine options\nwikipedia-mcp --country Taiwan --enable-cache --access-token your_wikipedia_token --transport http --path /mcp --port 8080\n\n### Docker/Kubernetes\n\nWhen running inside containers, bind the HTTP MCP server to all interfaces and map\nthe container port to the host or service:\n\n```bash\n# Build and run with Docker\ndocker build -t wikipedia-mcp .\ndocker run --rm -p 8080:8080 wikipedia-mcp --transport http --host 0.0.0.0 --port 8080 --path /mcp\n```\n\nKubernetes example (minimal):\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: wikipedia-mcp\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: wikipedia-mcp\n  template:\n    metadata:\n      labels:\n        app: wikipedia-mcp\n    spec:\n      containers:\n        - name: server\n          image: your-repo/wikipedia-mcp:latest\n          args: [\"--transport\", \"http\", \"--host\", \"0.0.0.0\", \"--port\", \"8080\", \"--path\", \"/mcp\"]\n          ports:\n            - containerPort: 8080\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: wikipedia-mcp\nspec:\n  selector:\n    app: wikipedia-mcp\n  ports:\n    - name: http\n      port: 8080\n      targetPort: 8080\n```\n```\n\n### Configuration for Claude Desktop\n\nAdd the following to your Claude Desktop configuration file:\n\n**Option 1: Using command name (requires `wikipedia-mcp` to be in PATH)**\n```json\n{\n  \"mcpServers\": {\n    \"wikipedia\": {\n      \"command\": \"wikipedia-mcp\"\n    }\n  }\n}\n```\n\n**Option 2: Using full path (recommended if you get connection errors)**\n```json\n{\n  \"mcpServers\": {\n    \"wikipedia\": {\n      \"command\": \"/full/path/to/wikipedia-mcp\"\n    }\n  }\n}\n```\n\n**Option 3: With country/language specification**\n```json\n{\n  \"mcpServers\": {\n    \"wikipedia-us\": {\n      \"command\": \"wikipedia-mcp\",\n      \"args\": [\"--country\", \"US\"]\n    },\n    \"wikipedia-taiwan\": {\n      \"command\": \"wikipedia-mcp\", \n      \"args\": [\"--country\", \"TW\"]\n    },\n    \"wikipedia-japan\": {\n      \"command\": \"wikipedia-mcp\",\n      \"args\": [\"--country\", \"Japan\"]\n    }\n  }\n}\n```\n\nTo find the full path, run: `which wikipedia-mcp`\n\n**Configuration file locations:**\n- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- Windows: `%APPDATA%/Claude/claude_desktop_config.json`\n- Linux: `~/.config/Claude/claude_desktop_config.json`\n\n\u003e **Note**: If you encounter connection errors, see the [Troubleshooting](#common-issues) section for solutions.\n\n## Documentation Index\n\n- CLI usage and options: see [`docs/CLI.md`](docs/CLI.md)\n- API and MCP tools/resources: see [`docs/API.md`](docs/API.md)\n- Architecture overview: see [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md)\n- User guide and troubleshooting: see [`docs/USER_GUIDE.md`](docs/USER_GUIDE.md)\n- Development guide: see [`docs/DEVELOPMENT.md`](docs/DEVELOPMENT.md)\n- Testing guide: see [`docs/TESTING.md`](docs/TESTING.md)\n\n## Available MCP Tools\n\nThe Wikipedia MCP server provides the following tools for LLMs to interact with Wikipedia:\n\nEach tool is also exposed with a `wikipedia_`-prefixed alias (for example, `wikipedia_get_article`) for improved cross-server discoverability.\n\n### `search_wikipedia`\n\nSearch Wikipedia for articles matching a query.\n\n**Parameters:**\n- `query` (string): The search term\n- `limit` (integer, optional): Maximum number of results to return (default: 10)\n\n**Returns:**\n- A list of search results with titles, snippets, and metadata\n\n### `get_article`\n\nGet the full content of a Wikipedia article.\n\n**Parameters:**\n- `title` (string): The title of the Wikipedia article\n\n**Returns:**\n- Article content including text, summary, sections, links, and categories\n\n### `get_summary`\n\nGet a concise summary of a Wikipedia article.\n\n**Parameters:**\n- `title` (string): The title of the Wikipedia article\n\n**Returns:**\n- A text summary of the article\n\n### `get_sections`\n\nGet the sections of a Wikipedia article.\n\n**Parameters:**\n- `title` (string): The title of the Wikipedia article\n\n**Returns:**\n- A structured list of article sections with their content\n\n### `get_links`\n\nGet the links contained within a Wikipedia article.\n\n**Parameters:**\n- `title` (string): The title of the Wikipedia article\n\n**Returns:**\n- A list of links to other Wikipedia articles\n\n### `get_coordinates`\n\nGet the coordinates of a Wikipedia article.\n\n**Parameters:**\n- `title` (string): The title of the Wikipedia article\n\n**Returns:**\n- A dictionary containing coordinate information including:\n  - `title`: The article title\n  - `pageid`: The page ID\n  - `coordinates`: List of coordinate objects with latitude, longitude, and metadata\n  - `exists`: Whether the article exists\n  - `error`: Any error message if retrieval failed\n\n### `get_related_topics`\n\nGet topics related to a Wikipedia article based on links and categories.\n\n**Parameters:**\n- `title` (string): The title of the Wikipedia article\n- `limit` (integer, optional): Maximum number of related topics (default: 10)\n\n**Returns:**\n- A list of related topics with relevance information\n\n### `summarize_article_for_query`\n\nGet a summary of a Wikipedia article tailored to a specific query.\n\n**Parameters:**\n- `title` (string): The title of the Wikipedia article\n- `query` (string): The query to focus the summary on\n- `max_length` (integer, optional): Maximum length of the summary (default: 250)\n\n**Returns:**\n- A dictionary containing the title, query, and the focused summary\n\n### `summarize_article_section`\n\nGet a summary of a specific section of a Wikipedia article.\n\n**Parameters:**\n- `title` (string): The title of the Wikipedia article\n- `section_title` (string): The title of the section to summarize\n- `max_length` (integer, optional): Maximum length of the summary (default: 150)\n\n**Returns:**\n- A dictionary containing the title, section title, and the section summary\n\n### `extract_key_facts`\n\nExtract key facts from a Wikipedia article, optionally focused on a specific topic within the article.\n\n**Parameters:**\n- `title` (string): The title of the Wikipedia article\n- `topic_within_article` (string, optional): A specific topic within the article to focus fact extraction\n- `count` (integer, optional): Number of key facts to extract (default: 5)\n\n**Returns:**\n- A dictionary containing the title, topic, and a list of extracted facts\n\n## Country/Locale Support\n\nThe 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.\n\n### Supported Countries and Regions\n\nUse `--list-countries` to see all supported countries:\n\n```bash\nwikipedia-mcp --list-countries\n```\n\nThis will display countries organized by language, for example:\n\n```\nSupported Country/Locale Codes:\n========================================\n    en: US, USA, United States, UK, GB, Canada, Australia, ...\n    zh-hans: CN, China\n    zh-tw: TW, Taiwan  \n    ja: JP, Japan\n    de: DE, Germany\n    fr: FR, France\n    es: ES, Spain, MX, Mexico, AR, Argentina, ...\n    pt: PT, Portugal, BR, Brazil\n    ru: RU, Russia\n    ar: SA, Saudi Arabia, AE, UAE, EG, Egypt, ...\n```\n\n### Usage Examples\n\n```bash\n# Major countries by code\nwikipedia-mcp --country US       # United States (English)\nwikipedia-mcp --country CN       # China (Simplified Chinese)\nwikipedia-mcp --country TW       # Taiwan (Traditional Chinese)\nwikipedia-mcp --country JP       # Japan (Japanese)\nwikipedia-mcp --country DE       # Germany (German)\nwikipedia-mcp --country FR       # France (French)\nwikipedia-mcp --country BR       # Brazil (Portuguese)\nwikipedia-mcp --country RU       # Russia (Russian)\n\n# Countries by full name (case insensitive)\nwikipedia-mcp --country \"United States\"\nwikipedia-mcp --country China\nwikipedia-mcp --country Taiwan  \nwikipedia-mcp --country Japan\nwikipedia-mcp --country Germany\nwikipedia-mcp --country france    # Case insensitive\n\n# Regional variants\nwikipedia-mcp --country HK       # Hong Kong (Traditional Chinese)\nwikipedia-mcp --country SG       # Singapore (Simplified Chinese)\nwikipedia-mcp --country \"Saudi Arabia\"  # Arabic\nwikipedia-mcp --country Mexico   # Spanish\n```\n\n### Country-to-Language Mapping\n\nThe server automatically maps country codes to appropriate Wikipedia language editions:\n\n- **English-speaking**: US, UK, Canada, Australia, New Zealand, Ireland, South Africa → `en`\n- **Chinese regions**: \n  - CN, China → `zh-hans` (Simplified Chinese)\n  - TW, Taiwan → `zh-tw` (Traditional Chinese - Taiwan)\n  - HK, Hong Kong → `zh-hk` (Traditional Chinese - Hong Kong)\n  - SG, Singapore → `zh-sg` (Simplified Chinese - Singapore)\n- **Major languages**: JP→`ja`, DE→`de`, FR→`fr`, ES→`es`, IT→`it`, RU→`ru`, etc.\n- **Regional variants**: Supports 140+ countries and regions\n\n### Error Handling\n\nIf you specify an unsupported country, you'll get a helpful error message:\n\n```bash\n$ wikipedia-mcp --country INVALID\nError: Unsupported country/locale: 'INVALID'. \nSupported country codes include: US, USA, UK, GB, CA, AU, NZ, IE, ZA, CN. \nUse --language parameter for direct language codes instead.\n\nUse --list-countries to see supported country codes.\n```\n\n## Language Variants\n\nThe 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.\n\n### Supported Language Variants\n\n#### Chinese Language Variants\n- `zh-hans` - Simplified Chinese\n- `zh-hant` - Traditional Chinese  \n- `zh-tw` - Traditional Chinese (Taiwan)\n- `zh-hk` - Traditional Chinese (Hong Kong)\n- `zh-mo` - Traditional Chinese (Macau)\n- `zh-cn` - Simplified Chinese (China)\n- `zh-sg` - Simplified Chinese (Singapore)\n- `zh-my` - Simplified Chinese (Malaysia)\n\n#### Serbian Language Variants\n- `sr-latn` - Serbian Latin script\n- `sr-cyrl` - Serbian Cyrillic script\n\n#### Kurdish Language Variants\n- `ku-latn` - Kurdish Latin script\n- `ku-arab` - Kurdish Arabic script\n\n#### Norwegian Language Variants\n- `no` - Norwegian (automatically mapped to Bokmål)\n\n### Usage Examples\n\n```bash\n# Access Simplified Chinese Wikipedia\nwikipedia-mcp --language zh-hans\n\n# Access Traditional Chinese Wikipedia (Taiwan)\nwikipedia-mcp --language zh-tw\n\n# Access Serbian Wikipedia in Latin script\nwikipedia-mcp --language sr-latn\n\n# Access Serbian Wikipedia in Cyrillic script\nwikipedia-mcp --language sr-cyrl\n```\n\n### How Language Variants Work\n\nWhen you specify a language variant like `zh-hans`, the server:\n1. Maps the variant to the base Wikipedia language (e.g., `zh` for Chinese variants)\n2. Uses the base language for API connections to the Wikipedia servers\n3. Includes the variant parameter in API requests to get content in the specific variant\n4. Returns content formatted according to the specified variant's conventions\n\nThis approach ensures optimal compatibility with Wikipedia's API while providing access to variant-specific content and formatting.\n\n## Example Prompts\n\nOnce the server is running and configured with Claude Desktop, you can use prompts like:\n\n### General Wikipedia queries:\n- \"Tell me about quantum computing using the Wikipedia information.\"\n- \"Summarize the history of artificial intelligence based on Wikipedia.\"\n- \"What does Wikipedia say about climate change?\"\n- \"Find Wikipedia articles related to machine learning.\"\n- \"Get me the introduction section of the article on neural networks from Wikipedia.\"\n- \"What are the coordinates of the Eiffel Tower?\"\n- \"Find the latitude and longitude of Mount Everest from Wikipedia.\"\n- \"Get coordinate information for famous landmarks in Paris.\"\n\n### Using country-specific Wikipedia:\n- \"Search Wikipedia China for information about the Great Wall.\" (uses Chinese Wikipedia)\n- \"Tell me about Tokyo from Japanese Wikipedia sources.\"\n- \"What does German Wikipedia say about the Berlin Wall?\"\n- \"Find information about the Eiffel Tower from French Wikipedia.\"\n- \"Get Taiwan Wikipedia's article about Taiwanese cuisine.\"\n\n### Language variant examples:\n- \"Search Traditional Chinese Wikipedia for information about Taiwan.\"\n- \"Find Simplified Chinese articles about modern China.\"\n- \"Get information from Serbian Latin Wikipedia about Belgrade.\"\n\n## MCP Resources\n\nThe server also provides MCP resources (similar to HTTP endpoints but for MCP):\n\n- `search/{query}`: Search Wikipedia for articles matching the query\n- `article/{title}`: Get the full content of a Wikipedia article\n- `summary/{title}`: Get a summary of a Wikipedia article\n- `sections/{title}`: Get the sections of a Wikipedia article\n- `links/{title}`: Get the links in a Wikipedia article\n- `coordinates/{title}`: Get the coordinates of a Wikipedia article\n- `summary/{title}/query/{query}/length/{max_length}`: Get a query-focused summary of an article\n- `summary/{title}/section/{section_title}/length/{max_length}`: Get a summary of a specific article section\n- `facts/{title}/topic/{topic_within_article}/count/{count}`: Extract key facts from an article\n\n## Development\n\n### Local Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/rudra-ravi/wikipedia-mcp.git\ncd wikipedia-mcp\n\n# Create a virtual environment\npython3 -m venv venv\nsource venv/bin/activate\n\n# Install the package in development mode\npip install -e .\n\n# Install development and test dependencies\npip install -r requirements-dev.txt\n\n# Run the server\nwikipedia-mcp\n```\n\n### Project Structure\n\n- `wikipedia_mcp/`: Main package\n  - `__main__.py`: Entry point for the package\n  - `server.py`: MCP server implementation\n  - `wikipedia_client.py`: Wikipedia API client\n  - `api/`: API implementation\n  - `core/`: Core functionality\n  - `utils/`: Utility functions\n- `tests/`: Test suite\n  - `test_basic.py`: Basic package tests\n  - `test_cli.py`: Command-line interface tests\n  - `test_server_tools.py`: Comprehensive server and tool tests\n\n## Testing\n\nThe project includes a comprehensive test suite to ensure reliability and functionality.\n\n### Test Structure\n\nThe test suite is organized in the `tests/` directory with the following test files:\n\n- **`test_basic.py`**: Basic package functionality tests\n- **`test_cli.py`**: Command-line interface and transport tests\n- **`test_server_tools.py`**: Comprehensive tests for all MCP tools and Wikipedia client functionality\n\n### Running Tests\n\n#### Run All Tests\n```bash\n# Install test dependencies\npip install -r requirements-dev.txt\n\n# Run all tests\npython -m pytest tests/ -v\n\n# Run tests with coverage\npython -m pytest tests/ --cov=wikipedia_mcp --cov-report=html\n```\n\n#### Run Specific Test Categories\n```bash\n# Run only unit tests (excludes integration tests)\npython -m pytest tests/ -v -m \"not integration\"\n\n# Run only integration tests (requires internet connection)\npython -m pytest tests/ -v -m \"integration\"\n\n# Run specific test file\npython -m pytest tests/test_server_tools.py -v\n```\n\n### Test Categories\n\n#### Unit Tests\n- **WikipediaClient Tests**: Mock-based tests for all client methods\n  - Search functionality\n  - Article retrieval\n  - Summary extraction\n  - Section parsing\n  - Link extraction\n  - Related topics discovery\n- **Server Tests**: MCP server creation and tool registration\n- **CLI Tests**: Command-line interface functionality\n\n#### Integration Tests\n- **Real API Tests**: Tests that make actual calls to Wikipedia API\n- **End-to-End Tests**: Complete workflow testing\n\n### Test Configuration\n\nThe project uses `pytest.ini` for test configuration:\n\n```ini\n[pytest]\nmarkers =\n    integration: marks tests as integration tests (may require network access)\n    slow: marks tests as slow running\n\ntestpaths = tests\naddopts = -v --tb=short\n```\n\n### Continuous Integration\n\nAll tests are designed to:\n- Run reliably in CI/CD environments\n- Handle network failures gracefully\n- Provide clear error messages\n- Cover edge cases and error conditions\n\n### Adding New Tests\n\nWhen contributing new features:\n\n1. Add unit tests for new functionality\n2. Include both success and failure scenarios\n3. Mock external dependencies (Wikipedia API)\n4. Add integration tests for end-to-end validation\n5. Follow existing test patterns and naming conventions\n\n## Troubleshooting\n\n### Common Issues\n\n#### Claude Desktop Connection Issues\n\n**Problem**: Claude Desktop shows errors like `spawn wikipedia-mcp ENOENT` or cannot find the command.\n\n**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.\n\n**Solutions**:\n\n1. **Use full path to the command** (Recommended):\n   ```json\n   {\n     \"mcpServers\": {\n       \"wikipedia\": {\n         \"command\": \"/home/username/.local/bin/wikipedia-mcp\"\n       }\n     }\n   }\n   ```\n   \n   To find your exact path, run: `which wikipedia-mcp`\n\n2. **Install with pipx for global access**:\n   ```bash\n   pipx install wikipedia-mcp\n   ```\n   Then use the standard configuration:\n   ```json\n   {\n     \"mcpServers\": {\n       \"wikipedia\": {\n         \"command\": \"wikipedia-mcp\"\n       }\n     }\n   }\n   ```\n\n3. **Create a symlink to a global location**:\n   ```bash\n   sudo ln -s ~/.local/bin/wikipedia-mcp /usr/local/bin/wikipedia-mcp\n   ```\n\n#### Other Issues\n\n- **Article Not Found**: Check the exact spelling of article titles\n- **Rate Limiting**: Wikipedia API has rate limits; consider adding delays between requests\n- **Large Articles**: Some Wikipedia articles are very large and may exceed token limits\n\n## Troubleshooting Search Issues\n\nIf you're experiencing empty search results, use the new diagnostic tools:\n\n### 1. Test Connectivity\n\nUse the `test_wikipedia_connectivity` tool to check if you can reach Wikipedia's API:\n\n```json\n{\n  \"tool\": \"test_wikipedia_connectivity\"\n}\n```\n\nThis returns diagnostics including:\n- Connection status (`success` or `failed`)\n- Response time in milliseconds\n- Site/host information when successful\n- Error details when connectivity fails\n\n### 2. Enhanced Search Error Information\n\nThe `search_wikipedia` tool now returns detailed metadata:\n\n```json\n{\n  \"tool\": \"search_wikipedia\",\n  \"arguments\": {\n    \"query\": \"Ada Lovelace\",\n    \"limit\": 10\n  }\n}\n```\n\nExample response:\n\n```json\n{\n  \"query\": \"Ada Lovelace\",\n  \"results\": [...],\n  \"count\": 5,\n  \"status\": \"success\",\n  \"language\": \"en\"\n}\n```\n\nWhen no results are found, you receive:\n\n```json\n{\n  \"query\": \"nonexistent\",\n  \"results\": [],\n  \"status\": \"no_results\",\n  \"count\": 0,\n  \"language\": \"en\",\n  \"message\": \"No search results found. This could indicate connectivity issues, API errors, or simply no matching articles.\"\n}\n```\n\n### 3. Common Search Issues and Solutions\n\n- **Empty results**: Run the connectivity test, verify query spelling, try broader terms.\n- **Connection errors**: Check firewall or proxy settings, ensure `*.wikipedia.org` is reachable.\n- **API limits**: Requests with `limit \u003e 500` are automatically capped; negative values reset to the default (10).\n\n### 4. Debugging with Verbose Logging\n\nLaunch the server with debug logging for deeper insight:\n\n```bash\nwikipedia-mcp --log-level DEBUG\n```\n\nThis emits the request parameters, response status codes, and any warnings returned by the API.\n\n## Understanding the Model Context Protocol (MCP)\n\nThe Model Context Protocol (MCP) is not a traditional HTTP API but a specialized protocol for communication between LLMs and external tools. Key characteristics:\n\n- Uses stdio for local integrations and streamable HTTP for network integrations (`sse` retained for legacy compatibility)\n- Designed specifically for AI model interaction\n- Provides standardized formats for tools, resources, and prompts\n- Integrates directly with Claude and other MCP-compatible AI systems\n\nClaude Desktop acts as the MCP client, while this server provides the tools and resources that Claude can use to access Wikipedia information.\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Connect with the Author\n\n- 🌐 Portfolio: [ravikumar-dev.me](https://ravikumar-dev.me)\n- 📝 Blog: [Medium](https://medium.com/@Ravikumar-e)\n- 💼 LinkedIn: [in/ravi-kumar-e](https://linkedin.com/in/ravi-kumar-e)\n- 🐦 Twitter: [@Ravikumar_d3v](https://twitter.com/Ravikumar_d3v) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudra-ravi%2Fwikipedia-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudra-ravi%2Fwikipedia-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudra-ravi%2Fwikipedia-mcp/lists"}