Wikipedia MCP Server

Wikipedia MCP Server

Enables searching and retrieving Wikipedia content across multiple languages, including article summaries, sections, coordinates, and related topics.

Category
访问服务器

README

Wikipedia MCP Server for Vercel

A Model Context Protocol (MCP) server that provides Wikipedia information access through Vercel's serverless functions.

Features

This MCP server provides the following tools:

  • search_wikipedia - Search Wikipedia for articles matching a query
  • get_article - Get the full content of a Wikipedia article
  • get_summary - Get a concise summary of a Wikipedia article
  • get_sections - Get the sections of a Wikipedia article
  • get_coordinates - Get the geographic coordinates of a Wikipedia article
  • get_related_topics - Get topics related to a Wikipedia article

All tools support multi-language Wikipedia by specifying a language code (e.g., 'en', 'es', 'fr', 'ja', 'zh').

Prerequisites

  • Node.js 18.x or later
  • npm or yarn
  • A Vercel account (free tier works fine)

Local Development

  1. Install dependencies:

    npm install
    
  2. Run the development server:

    npm run dev
    
  3. Test the MCP server:

    The MCP endpoint will be available at http://localhost:3000/api/mcp

  4. Test with MCP Inspector:

    npx @modelcontextprotocol/inspector@latest http://localhost:3000
    

    Then:

    • Open http://127.0.0.1:6274 in your browser
    • Select "Streamable HTTP" from the dropdown
    • Enter http://localhost:3000/api/mcp as the URL
    • Click "Connect"
    • Test the tools under the "Tools" section

Deployment to Vercel

Option 1: Deploy via Vercel CLI

  1. Install Vercel CLI (if not already installed):

    npm i -g vercel
    
  2. Deploy to Vercel:

    vercel
    
  3. Follow the prompts:

    • Link to an existing project or create a new one
    • Confirm the settings
    • Deploy!
  4. Deploy to production:

    vercel --prod
    

Option 2: Deploy via GitHub

  1. Push your code to GitHub:

    git init
    git add .
    git commit -m "Initial commit"
    git branch -M main
    git remote add origin <your-github-repo-url>
    git push -u origin main
    
  2. Connect to Vercel:

    • Go to vercel.com
    • Click "Add New Project"
    • Import your GitHub repository
    • Vercel will auto-detect Next.js and configure everything
    • Click "Deploy"

Option 3: Deploy via Vercel Dashboard

  1. Create a new project in Vercel:

    • Go to vercel.com/new
    • Import your Git repository or upload your project
  2. Configure the project:

    • Framework Preset: Next.js
    • Root Directory: ./
    • Build Command: next build
    • Output Directory: .next
  3. Deploy!

Using Your Deployed MCP Server

After deployment, you'll get a URL like https://your-project.vercel.app

Configure in Claude Desktop (or other MCP clients)

Add this to your Claude Desktop configuration file:

Location of config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Configuration:

{
  "mcpServers": {
    "wikipedia": {
      "url": "https://your-project.vercel.app/api/mcp"
    }
  }
}

Configure in Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "wikipedia": {
      "url": "https://your-project.vercel.app/api/mcp"
    }
  }
}

Configure in Windsurf

Add to mcp_config.json:

{
  "mcpServers": {
    "wikipedia": {
      "serverUrl": "https://your-project.vercel.app/api/mcp"
    }
  }
}

Example Queries

Once connected, you can ask your AI assistant:

  • "Search Wikipedia for information about quantum computing"
  • "Get me a summary of the article about Claude Shannon"
  • "What are the geographic coordinates of Mount Everest?"
  • "Find related topics to artificial intelligence on Wikipedia"
  • "Search Japanese Wikipedia for information about Tokyo" (the server will handle the language parameter)

API Endpoints

  • GET/POST/DELETE /api/mcp - Main MCP endpoint
  • GET / - Info page about available tools

Tool Parameters

search_wikipedia

  • query (string, required): The search term
  • limit (number, optional): Maximum results (1-50, default: 10)
  • language (string, optional): Wikipedia language code (default: 'en')

get_article

  • title (string, required): Article title
  • language (string, optional): Wikipedia language code (default: 'en')

get_summary

  • title (string, required): Article title
  • language (string, optional): Wikipedia language code (default: 'en')

get_sections

  • title (string, required): Article title
  • language (string, optional): Wikipedia language code (default: 'en')

get_coordinates

  • title (string, required): Article title
  • language (string, optional): Wikipedia language code (default: 'en')

get_related_topics

  • title (string, required): Article title
  • limit (number, optional): Maximum results (1-50, default: 10)
  • language (string, optional): Wikipedia language code (default: 'en')

Architecture

This MCP server is built using:

  • Next.js 15 - React framework for production
  • mcp-handler - Official MCP handler package for Vercel
  • Wikipedia API - MediaWiki Action API for Wikipedia data
  • Vercel Functions - Serverless functions with Fluid Compute

Performance & Scaling

The server leverages Vercel's Fluid Compute features:

  • Optimized Concurrency - Efficient request handling
  • Dynamic Scaling - Scales based on demand
  • Minimal Idle Time - Pay only for what you use

Troubleshooting

MCP client can't connect

  • Verify your MCP endpoint URL is correct: https://your-project.vercel.app/api/mcp
  • Check that the deployment is successful in Vercel dashboard
  • Try accessing the root URL to see if the server is running

Tools not showing up

  • Restart your MCP client (Claude Desktop, Cursor, etc.)
  • Check the MCP client logs for connection errors
  • Verify the configuration file syntax is correct

Wikipedia API errors

  • Most errors are due to incorrect article titles (they're case-sensitive)
  • Some articles may not exist in the specified language
  • Rate limiting may occur with excessive requests

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

MIT License - feel free to use this in your own projects!

Credits

Based on the wikipedia-mcp Python implementation by Rudra-ravi, adapted for Vercel deployment using TypeScript and the mcp-handler package.

Resources

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选