Wikipedia MCP Server

Wikipedia MCP Server

Provides access to Wikipedia through 10 tools including search, article retrieval, summarization, and fact extraction, with multi-language support and robust error handling.

Category
Visit Server

README

Wikipedia MCP Server

A Model Context Protocol (MCP) server providing access to Wikipedia through 10 tools: search, retrieve articles, summarize content, extract facts, get coordinates, and more.

Features

  • 100% Test Coverage - 31 test cases, full schema validation
  • Multi-language Support - Access different Wikipedia editions
  • Robust Error Handling - Graceful API error handling

Available Tools

Tool Description
search_wikipedia Search for articles matching a query
get_article Get complete article content
get_summary Get article summary
summarize_article_for_query Get query-focused summary
summarize_article_section Summarize specific sections
extract_key_facts Extract key facts from articles
get_related_topics Find related articles and categories
get_sections Get article structure and sections
get_links Get all links within an article
get_coordinates Get geographic coordinates

Installation

# Install with uvx
uvx --from git+https://github.com/yourusername/wikipedia-mcp-server wikipedia-mcp-server

# Or local development
git clone https://github.com/yourusername/wikipedia-mcp-server.git
cd wikipedia-mcp-server && uv sync

Usage

Claude Desktop Configuration

{
  "mcpServers": {
    "wikipedia": {
      "command": "uvx", 
      "args": ["--from", "git+https://github.com/yourusername/wikipedia-mcp-server", "wikipedia-mcp-server"]
    }
  }
}

Testing

uv run python test_server.py  # 31 tests, 100% pass rate

Example Usage

Search:

{"tool": "search_wikipedia", "arguments": {"query": "AI"}}

Get Article:

{"tool": "get_article", "arguments": {"title": "Python (programming language)"}}

Extract Facts:

{"tool": "extract_key_facts", "arguments": {"title": "Marie Curie", "topic_within_article": "Nobel Prize"}}

🎯 Parameter and Type Handling Rules

This server follows specific design patterns for handling parameters and data types to ensure consistency and predictability.

Input Parameter Design

Schema Pattern: All input parameters are marked as required in JSON schemas

{
  "required": ["title", "query", "max_length"]
}

Handler Pattern: Functions can have optional parameters with defaults

async def summarize_article_for_query(
    title: str, 
    query: str, 
    max_length: int = 250  # Default provided in handler
) -> Dict[str, Any]:

Benefits:

  • Clear Client Expectations: MCP clients must provide all documented parameters
  • Implementation Flexibility: Handlers can use sensible defaults when appropriate
  • Future Extensibility: Schema can be expanded without breaking existing implementations

Output Type Design

Nullable Fields: Use ["type", "null"] only when data genuinely might not exist

{
  "coordinates": { "type": ["array", "null"] },  // May not exist for non-geographic articles
  "pageid": { "type": ["number", "null"] },      // May be null if article doesn't exist
  "error": { "type": ["string", "null"] }        // Null on success, string on error
}

Non-Nullable Collections: Always return empty arrays instead of null

{
  "links": { "type": "array" },     // Returns [] if no links found
  "facts": { "type": "array" },     // Returns [] if no facts extracted
  "sections": { "type": "array" }   // Returns [] if no sections found
}

Non-Nullable Strings: Always return empty strings instead of null

{
  "summary": { "type": "string" },  // Returns "" if no summary available
  "text": { "type": "string" },      // Returns "" if no content available
  "title": { "type": "string" }     // Always present, never null
}

Design Principles

  1. Semantic Nullability: Only use null when it represents "this data doesn't exist" rather than "this data is empty"
  2. Predictable Types: Arrays are always arrays, strings are always strings (unless explicitly nullable)
  3. Client Safety: Clients can safely iterate arrays and concatenate strings without null checks
  4. Clear Intent: Nullable fields have explicit semantic meaning (coordinates for non-places, errors on success, etc.)

Examples

Geographic Data (nullable when appropriate):

{
  "title": "Programming",           // Always string
  "coordinates": null,              // Null - programming isn't a place
  "pageid": 12345,                 // Number when article exists
  "error": null                    // Null on success
}

Content Collections (empty when no data):

{
  "title": "Stub Article",         // Always string  
  "links": [],                     // Empty array - no links found
  "facts": [],                     // Empty array - no facts extracted
  "summary": ""                    // Empty string - no summary available
}

This design ensures type safety, predictable behavior, and clear semantic meaning across all tools.

Development

Dependencies: mcp>=1.6.0, wikipedia-api>=0.6.0, requests>=2.31.0, jsonschema>=4.0.0

# Local development
git clone repo && cd wikipedia-mcp-server
uv sync && uv run python test_server.py

Production-ready Wikipedia MCP server with 100% test coverage.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured