Wikipedia MCP Server

Wikipedia MCP Server

Provides comprehensive Wikipedia access for AI assistants via MCP Streamable HTTP transport, enabling search, article retrieval, summaries, section analysis, link discovery, and multi-language support.

Category
Visit Server

README

Wikipedia MCP Server

Deploy with Vercel

A Model Context Protocol (MCP) server that provides comprehensive Wikipedia access for AI assistants. Built in TypeScript, deployed on Vercel, and fully compatible with the MCP Streamable HTTP transport (protocol version 2025-03-26).

Features

  • šŸ” Advanced Search — find articles with relevance ranking
  • šŸ“„ Full Article Access — plain text extracts or complete wikitext
  • šŸ“ Smart Summaries — concise summaries tailored to a specific query
  • šŸ—‚ļø Section Analysis — extract and summarize individual sections
  • šŸ”— Link Discovery — internal links and related articles
  • šŸŒ Multi-language — 50+ language codes, 140+ country codes, resolved automatically
  • šŸ”€ Parallel Search — multi_search_wikipedia runs multiple queries simultaneously
  • šŸŽÆ Fact Extraction — structured key-fact lists from any article
  • šŸ“ Coordinates — lat/lon for geographic articles
  • ⚔ Streamable HTTP — full MCP transport support (POST + GET SSE + DELETE)
  • šŸ”’ Security hardened — input sanitization, tiered rate limiting, no Server header
  • šŸš€ Vercel ready — stateless serverless deployment, zero cold-start friction

Quick Start

1. Deploy

git clone https://github.com/YOUR_USERNAME/wikipedia-mcp-vercel.git
cd wikipedia-mcp-vercel
vercel

Or use the Deploy with Vercel button above.

2. Connect your AI client

The server implements MCP Streamable HTTP transport (2025-03-26).
Both the POST channel (client → server) and the GET SSE channel (server → client) are supported.

MCP endpoint: https://your-app.vercel.app/mcp

Claude Desktop

{
  "mcpServers": {
    "wikipedia": {
      "type": "http",
      "url": "https://your-app.vercel.app/mcp"
    }
  }
}

Claude Code / CLI

claude mcp add wikipedia --transport http https://your-app.vercel.app/mcp

Any MCP client (generic)

Configure the client with transport type streamable-http and the endpoint URL above.
The server uses stateless mode (no Mcp-Session-Id header), which is correct and expected for serverless deployments.

3. Environment variables (optional)

Variable Default Description
WIKIPEDIA_LANGUAGE en Wikipedia language code (e.g. ja, es, de)
WIKIPEDIA_COUNTRY US Country code → language mapping (e.g. JP, CN, LK)
ENABLE_CACHE false In-memory cache (useful for local dev)
WIKIPEDIA_BOT_USERNAME — Bot account username (Account@BotName)
WIKIPEDIA_BOT_PASSWORD — Bot account password
PORT 8000 Local dev port (ignored by Vercel)

Copy .env.example → .env for local development.

4. Verify

# Health check
curl https://your-app.vercel.app/health

# Test MCP initialize
curl -X POST https://your-app.vercel.app/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

MCP Tools

All 13 tools accept optional language (e.g. "ja") and country (e.g. "JP") parameters. When set, the query is sent as-is to that language's Wikipedia endpoint (e.g. ja.wikipedia.org). Wikipedia's own search can often match a short English title phrase to the correct local article, but there is no translation layer in this server.

Tool reference

Tool Description
search_wikipedia Search by keyword in one language
multi_search_wikipedia Run multiple searches across multiple languages in parallel
get_article Full article — plain text extract, or wikitext with full: true
get_summary Introductory summary only
get_sections Table of contents (section titles + levels)
get_links All internal wikilinks in an article
get_coordinates Latitude/longitude for geographic articles
get_related_topics Related articles via link graph
summarize_article_for_query Summary focused on a specific question
summarize_article_section Summary of one named section
extract_key_facts Bullet-list of key facts
test_wikipedia_connectivity API diagnostics + auth status
list_supported_countries All supported language and country codes

MCP Prompts

Three prompt templates are registered and available via prompts/list / prompts/get:

Prompt Description
search_in_native_language Query format guidance for non-English Wikipedia
wikipedia_usage_guide Full guide covering all tools and best practices
multilingual_research Step-by-step guide for cross-language research

REST API

Standard HTTP endpoints for non-MCP usage:

GET  /health
GET  /search/:query?limit=10
GET  /article/:title
GET  /summary/:title
GET  /sections/:title
GET  /links/:title
GET  /coordinates/:title
GET  /related/:title?limit=10
GET  /summary/:title/query/:query/length/:maxLength
GET  /summary/:title/section/:section/length/:maxLength
GET  /facts/:title?topic=...&count=5
GET  /test-connectivity
GET  /supported-countries
POST /tools/:toolName

Architecture

src/
ā”œā”€ā”€ server.ts               # Express app wiring
ā”œā”€ā”€ routes/
│   ā”œā”€ā”€ mcp.ts              # Streamable HTTP transport (POST + GET SSE + DELETE)
│   └── rest.ts             # REST endpoints
ā”œā”€ā”€ mcp-server.ts           # MCPServer helper — tool dispatch, language routing
ā”œā”€ā”€ handlers.ts             # Tool handler functions
ā”œā”€ā”€ toolRegistrations.ts    # SDK tool + prompt registration
ā”œā”€ā”€ toolDefinitions.ts      # JSON Schema definitions (for REST /mcp info)
ā”œā”€ā”€ prompts.ts              # Prompt template logic
ā”œā”€ā”€ wikipedia-client.ts     # Wikipedia Action API client
ā”œā”€ā”€ sanitize.ts             # Input sanitization
ā”œā”€ā”€ middleware.ts           # Rate limiting, Server header removal
ā”œā”€ā”€ utils.ts                # Shared helpers
└── types.ts                # TypeScript interfaces

Transport design

The server uses stateless Streamable HTTP — the correct mode for serverless platforms:

  • POST /mcp — receives JSON-RPC messages, returns JSON or SSE stream
  • GET /mcp — opens an SSE channel for server-initiated messages (clients reconnect on timeout)
  • DELETE /mcp — session termination (acknowledged; no server-side sessions to clean up)

A fresh McpServer + StreamableHTTPServerTransport instance is created for each request. All Wikipedia logic is handled by the shared, stateless MCPServer helper.


Development

npm install
npm run dev       # tsx watch mode on port 8000
npm run build     # tsc → dist/
npm start         # node dist/server.js
vercel dev        # local Vercel simulation

Bot authentication

For higher Wikipedia API rate limits, create a bot password:

  1. Log in to your Wikipedia account
  2. Go to Special:BotPasswords
  3. Create a new bot password
  4. Set WIKIPEDIA_BOT_USERNAME=YourAccount@BotName and WIKIPEDIA_BOT_PASSWORD=...

License

MIT

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