Token导航 LogoToken导航TokenDH.com
MCP Wikipedia Server logo
AI代理stdio官方级别未说明来源级核验

MCP Wikipedia Server

MCP Server

一个基于Model Context Protocol(MCP)的维基百科搜索和内容检索服务器,提供智能搜索、章节列表和内容获取功能,适用于AI助手集成和知识检索场景。

工具数

3

提示词数

0

GitHub Stars

0

资源数

0
内容提取PythonPython服务

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

kaman05010

提供方

kaman05010

最后核验

2026/5/17 20:22

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python example_client.py

详细介绍

MCP维基百科服务器

一个生产就绪的模型上下文协议(MCP)服务器,使用FastMCP和Python 3.11提供维基百科搜索和内容检索工具。

![Python 3.11](https://www.python.org/downloads/) ![MCP](https://modelcontextprotocol.io/) ![License](LICENSE)

🚀 快速开始

# 1. Set up environment (one-time setup)
./setup.sh

# 2. Start the server
source .venv311/bin/activate
cd src/mcp_server && python mcp_server.py

# 3. Test with example client
python example_client.py

🎯 特性

  • 维基百科搜索:通过智能搜索查找文章并获得全面的摘要
  • 章节列表:从任何维基百科文章中提取所有章节标题
  • 内容检索:获取具有适当格式的特定章节内容
  • MCP协议:AI助手集成的完全模型上下文协议兼容性
  • FastMCP框架:基于高效的FastMCP库构建,实现最佳性能
  • Python 3.11:具有最新功能和性能改进的现代Python

📚 文档

文档描述
📖 完整指南详细的设置、使用和开发说明
⚡ 快速参考常用命令和工具摘要
🔧 安装脚本自动化环境设置和验证
💡 客户端示例示例使用和集成示例

🛠️ 可用工具

工具目的示例用法
fetch_wikipedia_info搜索维基百科并获取文章摘要搜索“Python编程”
list_wikipedia_sections从文章中获取所有章节标题列出“机器学习”的章节
get_section_content检索特定部分内容从“人工智能”中获取“历史”部分

🏗️ 项目结构

MCPClientServer/
├── 📁 src/mcp_server/           # Core server implementation
│   ├── mcp_server.py           # Main MCP Wikipedia server
│   └── mcp_client.py           # Example MCP client
├── 📁 tests/                   # Comprehensive test suite
│   ├── test_server.py          # Unit tests (pytest)
│   ├── test_integration.py     # Integration tests
│   ├── test_performance.py     # Performance benchmarks
│   ├── test_mcp_compliance.py  # MCP protocol compliance
│   ├── quick_test.py           # Fast validation script
│   ├── run_tests.py            # Unified test runner
│   └── README.md               # Testing documentation
├── 📁 .venv311/               # Python 3.11 virtual environment
├── 🔧 setup.sh                # Automated setup script
├── 💡 example_client.py        # Usage examples and demos
├── 📖 GUIDE.md                # Complete documentation
├── ⚡ QUICK_REF.md             # Quick reference
├── 📄 pytest.ini              # Test configuration
├── 📄 requirements-test.txt    # Test dependencies
└── 📄 pyproject.toml          # Project configuration

🚦 先决条件

  • macOS (在苹果硅和英特尔上测试)
  • Python 3.11+ (建议通过pyenv安装)
  • Git (用于版本控制)

📦 安装选项

选项1:自动设置(推荐)

chmod +x setup.sh
./setup.sh

选项2:手动设置

# Set up Python 3.11 environment
pyenv install 3.11.10
pyenv local 3.11.10

# Create and activate virtual environment
python -m venv .venv311
source .venv311/bin/activate

# Install dependencies
pip install --upgrade pip
pip install wikipedia mcp fastmcp

🔌 集成示例

使用克劳德桌面(MCP客户端)

{
  "mcpServers": {
    "wikipedia": {
      "command": "python",
      "args": ["/path/to/MCPClientServer/src/mcp_server/mcp_server.py"],
      "env": {
        "PYTHONPATH": "/path/to/MCPClientServer/.venv311/lib/python3.11/site-packages"
      }
    }
  }
}

直接使用Python

from mcp_client import WikipediaClient

client = WikipediaClient()
result = await client.search_wikipedia("Artificial Intelligence")
print(result)

🧪 测试

快速测试

# Fast validation (10 seconds)
python tests/quick_test.py

# Comprehensive test suite (5 minutes)
python tests/run_tests.py

高级测试

# Install test dependencies
pip install -r requirements-test.txt

# Run specific test suites
python tests/run_tests.py --unit          # Unit tests only
python tests/run_tests.py --integration   # Integration tests only
python tests/run_tests.py --performance   # Performance benchmarks
python tests/run_tests.py --mcp          # MCP compliance tests

# Using pytest directly
python -m pytest tests/test_server.py -v --cov=src

测试套件概述

  • 单元测试:单个功能和组件测试
  • 集成测试:端到端工作流验证
  • 性能测试:响应时间和负载基准
  • MCP合规性:协议规范验证
  • 95%以上的代码覆盖率:全面的测试覆盖率

测试/README.md 获取完整的测试文档。

🐛 故障排除

问题解决方案
ModuleNotFoundError: No module named 'mcp'快跑 pip install mcp fastmcp 在活化环境中
Python version issues确保Python 3.11+ python --version
Server won't start检查端口是否可用,验证依赖关系
Wikipedia API errors检查互联网连接,尝试不同的搜索词

有关详细的故障排除,请参阅 GUIDE.md.

🤝 贡献

  1. 分叉存储库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 提交您的更改(git commit -m 'Add amazing feature')
  4. 推到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

📄 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

🔗 资源

🌟 支持

如果你觉得这个项目有帮助,请考虑给它一颗星⭐ 在GitHub上!

______________________________________________________________________

由以下材料制成❤️ 对于MCP社区

目录标签

目录标签

内容提取PythonPython服务维基百科API本地部署知识检索MCP协议

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP