维基百科文章转换工具

一个基于FastMCP服务器的工具,用于提取维基百科文章内容并将其转换为Markdown格式。

  • by Ayesha0300
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 ayesha0300/mcp-server-projects

使用说明

🧠 MCP维基阅读器

一个简单的MCP工具,用于使用FastMCP服务器提取维基百科文章内容并将其转换为Markdown。内置于 uv 用于快速和现代的Python包管理。

🚀 特性

  • 通过URL获取维基百科文章
  • 使用BeautifulSoup解析其主要内容
  • 将HTML内容转换为Markdown
  • 使用自定义MCP错误类型进行稳健的错误处理

📂 项目结构

src/ └── mcp_wiki/└── server.py#用于维基百科文章阅读的MCP工具实现

标记语言 复制 编辑

🛠 需求

  • Python 3.10+
  • uv 用于管理依赖关系
  • MCP框架(FastMCP、McpError等)

安装依赖项:

uv pip install -r requirements.txt
You can also use uv venv and uv pip for full environment isolation.

▶️ Running the Server
To start the MCP server, run:

bash
Copy
Edit
mcp dev src/mcp_wiki/server.py
This will launch the FastMCP server on:

🔗 http://127.0.0.1:6274

Registered as the wiki tool, the server exposes the following method:

python
Copy
Edit
read_wikipedia_article("https://en.wikipedia.org/wiki/Python_(programming_language)")
📦 Package Info
This project uses uv – a super fast Python package manager:

Speedy installation and resolution

Native support for pyproject.toml

Great for modern Python workflows

📝 License
MIT License

yaml
Copy
Edit

---

Let me know if you'd like this saved as a file (`README.md`) or if you want to auto-generate the `requirements.txt` based on your code.