标题氛围分析 MCP 服务器
一个模型上下文协议服务器,用于分析美国主要出版物新闻标题中的情感。该服务器提供基于日期的标准接口和自然语言日期解析功能,方便用户使用。
特征
每次请求最多分析 100 条标题
美国各大新闻来源的头条新闻分布均匀
情绪评分采用 0-10 的等级(0 = 最负面,10 = 最正面)
自然语言日期解析(例如“昨天”、“上周五”)
详细的源分布信息
搜索结果中包含的示例标题
先决条件
Node.js v16 或更高版本
NewsAPI 密钥(从https://newsapi.org获取)
安装
克隆存储库:
git clone https://github.com/fred-em/headline-vibes.git
cd headline-vibes
安装依赖项:
npm install
构建服务器:
npm run build
在您的 MCP 设置文件中配置您的 NewsAPI 密钥:
{
"mcpServers": {
"headline-vibes": {
"command": "node",
"args": ["/path/to/headline-vibes/build/index.mjs"],
"env": {
"NEWS_API_KEY": "your-api-key-here"
},
"disabled": false,
"autoApprove": []
}
}
}
可用工具
分析标题
使用自然语言日期输入或特定日期分析情绪。
使用示例:
// Using natural language
{
"name": "analyze_headlines",
"arguments": {
"input": "yesterday"
}
}
// Or using specific dates
{
"name": "analyze_headlines",
"arguments": {
"input": "2025-02-11"
}
}
输入示例:
“上周五”
“3天前”
“3月10日”
“两周前”
“2025-02-11”(也支持 YYYY-MM-DD 格式)
响应格式
该工具以以下格式返回结果:
{
"score": "6.50", // Normalized sentiment score (0-10)
"synopsis": "Overall positive sentiment in today's headlines",
"headlines_analyzed": 100, // Number of headlines analyzed
"sources_analyzed": 12, // Number of unique sources
"source_distribution": { // Distribution of headlines by source
"Reuters": 10,
"Associated Press": 8,
"CNN": 9,
// ... etc
},
"sample_headlines": [ // Up to 5 sample headlines
"Example headline 1",
"Example headline 2",
// ... etc
]
}
新闻来源
该服务器从美国主要新闻来源获取头条新闻,包括:
美联社
路透社
美国有线电视新闻网
福克斯新闻
NBC新闻
ABC新闻
《华尔街日报》
《华盛顿邮报》
《今日美国》
彭博社
商业内幕
时间
错误处理
服务器针对常见问题提供了清晰的错误消息:
无效的日期格式
无法解析的自然语言查询
未找到指定日期的标题
NewsAPI 的 API 错误
发展
要在开发期间以监视模式运行服务器:
npm run watch
执照
麻省理工学院
Related MCP Servers
- Asecurity-licenseAqualityFetches and processes Hacker News discussions to prepare them for Claude to generate high-quality summaries, handling comment structure and metadata to help Claude understand the relative importance of different comments.Last updated -1MIT License
- Asecurity-licenseAqualityA server providing access to news articles from various categories including tech, data science, cybersecurity, and more, allowing retrieval and summarization of latest content.Last updated -13
- -securityAlicense-qualityTurkish sentiment anlaysis with MCPLast updated -1Apache 2.0
- AsecurityAlicenseAqualitySearch and retrieve news articles and trending keywords from Google News and Google Trends. Summarize articles and extract keywords using optional NLP and LLM Sampling to get concise insights.Last updated -560MIT License