Wikimedia MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Allows access to Wikipedia content programmatically through natural language queries, including searching content and titles, retrieving page content, finding language versions, getting featured content, and accessing historical events.

维基媒体 MCP 服务器

用于与维基媒体 API 交互的模型上下文协议 (MCP) 服务器。使用自然语言查询以编程方式访问维基百科和其他维基媒体项目内容。

特征

  • 搜索内容:对维基媒体页面内容进行全文搜索
  • 搜索标题:使用自动完成建议搜索页面标题
  • 获取页面:检索页面内容、标题、URL 和元数据
  • 语言版本:查找页面的其他语言版本
  • 精选内容:获取精选文章、阅读次数最多的页面和当天的图片
  • 历史事件:获取任意日期的事件、出生、死亡和节日

要求

  • Python 3.12+
  • uv 包管理器
  • MCP 服务器框架

安全

  • 所有用户输入都经过验证
  • 无需敏感数据或凭证
  • 由 Wikimedia API 处理的速率限制
  • 错误消息不会暴露内部细节

安装

Claude桌面配置

在 MacOS 上:

~/Library/Application Support/Claude/claude_desktop_config.json

在 Windows 上:

C:\Users\<username>\AppData\Roaming\Claude\claude_desktop_config.json

开发配置

{ "mcpServers": { "wikimedia": { "command": "uv", "args": [ "--directory", "C:\\MCP\\server\\community\\wikimedia", "run", "wikimedia" ] } } }

已发布的配置

{ "mcpServers": { "wikimedia": { "command": "uvx", "args": [ "wikimedia" ] } } }

工具

搜索内容

对维基媒体页面内容进行全文搜索。返回与查询匹配的片段。

  • query (必填):搜索词
  • limit (1-50,默认10):结果数量
  • project (默认“wikipedia”):维基媒体项目
  • language (默认“en”):语言代码

搜索标题

以查询开头搜索维基媒体页面标题。返回带有描述的建议。

  • query (必填):搜索前缀
  • limit (1-100,默认10):结果数量
  • project (默认“wikipedia”):维基媒体项目
  • language (默认“en”):语言代码

获取页面

获取维基媒体页面内容、标题、URL 和最后修改日期。

  • title (必填):页面标题
  • project (默认“wikipedia”):维基媒体项目
  • language (默认“en”):语言代码

获取语言

获取其他语言的维基媒体页面版本。

  • title (必填):页面标题
  • project (默认“wikipedia”):维基媒体项目
  • language (默认“en”):语言代码

获取特色

获取指定日期的维基媒体精选内容。返回精选文章、阅读量最高的页面以及当天的图片。

  • date (YYYY/MM/DD,默认今天):获取内容的日期
  • project (仅限“wikipedia”):必须是维基百科
  • language (en/de/fr/es/ru/ja/zh):支持的语言

获取此日

从维基媒体获取特定日期的历史事件。

  • date (MM/DD,默认为今天):获取事件的日期
  • type (默认“全部”):事件类型 - 全部/选定/出生/死亡/假期/事件
  • project (仅限“wikipedia”):必须是维基百科
  • language (en/de/fr/es/ru/ja/zh):支持的语言

示例用法

# Search for content about "artificial intelligence" result = await client.call_tool("search_content", { "query": "artificial intelligence", "limit": 5, "language": "en" }) # Get today's featured content result = await client.call_tool("get_featured", { "language": "en" }) # Get historical events for January 1st result = await client.call_tool("get_on_this_day", { "date": "01/01", "type": "all", "language": "en" })

贡献

欢迎贡献代码!欢迎提交 Pull 请求。对于重大变更,请先提交一个 issue 来讨论您想要修改的内容。

执照

MIT 许可证。详情请参阅LICENSE文件。

-
security - not tested
A
license - permissive license
-
quality - not tested

支持与 Wikimedia API 进行编程交互,提供搜索内容、检索页面信息和访问多种语言的历史事件等功能。

  1. Features
    1. Requirements
      1. Security
        1. Installation
          1. Claude Desktop Configuration
          2. Development Configuration
          3. Published Configuration
        2. Tools
          1. search_content
          2. search_titles
          3. get_page
          4. get_languages
          5. get_featured
          6. get_on_this_day
        3. Example Usage
          1. Contributing
            1. License
              ID: l6ihu97mw7