使用说明
📡 RSS MCP服务器
模块化模型上下文协议(MCP)服务器,用于通过Claude Desktop使用自然语言界面跟踪、过滤和呈现来自自定义RSS提要的PNT/GNSS新闻。
✨ 特性
- 🔗 本地MCP集成 -与Claude Desktop直接集成
- 📰 RSS源处理 -获取并解析多个RSS源
- 🏷️ 基于标签的过滤 -使用可配置标签进行内容过滤
- 💬 自然语言接口 -基于人工智能的RSS管理
- 📊 状态管理 -持续跟踪已读/未读文章
- 🔍 搜索功能 -基于关键字和标签的文章搜索
- 🛡️ 错误处理 -优雅的回退和错误恢复
🚀 快速开始
先决条件
- Python 3.10+
- 克劳德桌面
- 虚拟环境(推荐)
安装
# Clone the repository
cd rss-mcp-server
# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install mcp feedparser pyyaml httpx
配置
- 创建feeds.yaml (如果不存在):
- url: https://insidegnss.com/feed/
tags: [C-band, TrustPoint, GPSIA, LEO, PNT]
- url: https://spacenews.com/feed/
tags: [LEO, spoofing, spectrum]
- url: https://www.gpsworld.com/feed/
tags: [GNSS, spoof, jamming, M-code]
- 配置Claude桌面:
增添 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"rss-mcp-server": {
"command": "/path/to/your/project/.venv/bin/python",
"args": ["/path/to/your/project/main.py"],
"cwd": "/path/to/your/project"
}
}
}
⚠️ 用实际项目位置替换路径
- 重新启动克劳德桌面 完全(退出并重新打开)
测试
# Test server locally
python main.py
# Should output: "RSS MCP Server initialized successfully"
🤖 用法
与Claude Desktop集成后,使用自然语言命令:
"Update my RSS feeds"
"Show me articles about GPS jamming"
"Search for LEO satellite articles"
"Mark the first 5 articles as read"
"Find articles about spoofing"
"Show me 10 recent unread articles"
📡 MCP工具
| 工具 | 说明 | 参数 |
|---|---|---|
update_rss_feeds |
从所有订阅源获取最新文章 | 无 |
get_unread_articles |
获取未读文章 | limit (可选) |
mark_articles_read |
将文章标记为已读 | article_ids (可选) |
search_articles |
按关键字搜索文章 | query, tags (可选) |
📊 MCP资源
| 资源URI | 描述 |
|---|---|
rss://feeds/unread |
所有未读文章(JSON) |
rss://feeds/all |
所有文章(JSON) |
📁 项目结构
rss-mcp-server/
├── main.py # MCP server implementation
├── processor.py # RSS feed processing logic
├── state.py # State management for read/unread tracking
├── feeds.yaml # Feed configuration (direct list format)
├── state.json # Runtime state (auto-created)
├── requirements.txt # Python dependencies
├── README.md # This file
└── .venv/ # Virtual environment
⚙️ 配置详情
feeds.yaml格式
✅ 正确格式(直接列表):
- url: https://example.com/feed/
tags: [tag1, tag2, tag3]
- url: https://another.com/rss/
tags: [tag4, tag5]
❌ 格式不正确(带包装):
feeds: # Don't use this wrapper
- url: https://example.com/feed/
标签
标签用于:
- 搜索过程中的内容过滤
- 按主题对文章进行分类
- 增强搜索相关性
PNT/GNSS内容标签示例:
GPS,GNSS,PNTjamming,spoofing,interferenceLEO,MEO,satellitesmilitary,defense,civilianM-code,anti-jam,resilient
🔧 故障排除
常见问题
服务器未出现在Claude Desktop中:
- 验证
claude_desktop_config.json语法和路径 - 确保所有路径都是绝对路径
- 完全重新启动克劳德桌面
导入错误:
pip install mcp feedparser pyyaml httpx
feeds.yaml格式错误:
- 使用直接列表格式(以开头
-) - 不
feeds:需要包装 - 确保正确的YAML语法
文件权限错误:
- 确保的写入权限
state.json - 检查目录权限
调试步骤
- 本地测试:
python main.py - 检查依赖关系:
pip list | grep -E "(mcp|feedparser|pyyaml|httpx)" - 验证配置: 检查克劳德桌面日志
- 验证订阅源: 在浏览器中测试源URL
🧪 发展
运行测试
# Test RSS feed processing
python -c "from processor import RSSProcessor; import asyncio; asyncio.run(RSSProcessor().initialize())"
# Test state management
python -c "from state import StateManager; sm = StateManager(); print('State manager working')"
添加新订阅源
- 将源URL添加到
feeds.yaml - 配置适当的标签
- 重新启动MCP服务器
- 更新订阅源:“更新我的RSS订阅源”
调试
通过修改启用调试输出 main.py:
import sys
print("Debug info", file=sys.stderr)
📈 演出
- 订阅源更新:3-5次喂食约2-5秒
- 文章检索:对于典型查询,<1秒
- 状态持久性:读/未读更改时自动
- 内存使用:~10-20MB典型操作
🤝 贡献
- 分叉存储库
- 创建要素分支
- 通过测试进行更改
- 提交拉取请求
📄 许可证
MIT许可证-有关详细信息,请参阅许可证文件
🆘 支持
- 问题:使用日志创建GitHub问题
- 问题:标签@anil.govaraju
- 文档:请参阅Google Drive文档
🎯 用例
每日新闻简报:
"Update feeds and show me unread articles about GPS jamming and spoofing"
研究协助:
"Search for articles about LEO PNT systems published this week"
竞争情报:
"Find articles mentioning TrustPoint or military navigation systems"
内容策划:
"Show me all unread articles, then mark the first 10 as read"
📊 样本输出
当你搜索“GPS干扰”时,你会得到结构化的结果:
{
"count": 3,
"articles": [
{
"id": "251bc714...",
"title": "U.S. Army Taking a Layered Approach to PNT",
"link": "https://insidegnss.com/...",
"published": "2025-06-03T16:58:20",
"author": "Renee Knight",
"feed_tags": ["C-band", "TrustPoint", "GPSIA", "LEO", "PNT"],
"content": "...anti-jamming capabilities..."
}
]
}
最后更新时间: 2025年6月5日
状态: ✅ 生产就绪