Skip to main content
Glama
danbunnell

Wikipedia MCP Server

by danbunnell

维基百科 MCP 服务器

这是一个 MCP(模型控制协议)服务器,为请求的主题提供维基百科内容。

设置

  1. 安装所需的依赖项:

pip install -r requirements.txt
  1. 启动服务器:

python src/server.py

服务器将在http://localhost:5000上运行。

Related MCP server: mediawiki-mcp-server

API 使用

使用 CLI 中的 API

/mcp发送一个 POST 请求,其 JSON 主体包含一个topic字段:

curl -X POST http://localhost:5000/mcp \ -H "Content-Type: application/json" \ -d '{"topic": "Python_(programming_language)"}'

使用 Cursor Composer 的 API

  1. 询问有关维基百科主题的问题

  2. Cursor 将显示一个建议的 MCP 请求,并请求您允许运行该工具

  3. 批准后,Cursor 将向 MCP 服务器执行请求

  4. 提示结果将基于所选模型对 MCP 服务器响应的分析

游标 API 示例

响应格式

成功响应:

{ "status": "success", "data": { "title": "Page Title", "content": "Page Content", "url": "Wikipedia URL" } }

错误响应:

{ "status": "error", "error": "Error message" }

测试

运行测试脚本来验证服务器是否正常工作:

python src/test_server.py
-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/danbunnell/mcp-wikipedia'

If you have feedback or need assistance with the MCP directory API, please join our Discord server