MCP-EXP
Experimental MCP server that integrates OpenAI and Serper APIs for news search, sentiment analysis, and email delivery.
README
MCP-EXP 项目
项目简介
MCP-EXP 是一个基于 MCP (Model Context Protocol) 框架的实验项目,集成了 OpenAI API 和 Serper API,用于实现热点新闻搜索、情感分析以及邮件发送等功能。
功能特点
- 热点新闻搜索:通过 Serper API 搜索指定关键词的最新新闻
- 情感分析:利用 OpenAI API 对新闻内容进行情感分析
- 邮件发送:自动将分析结果发送到指定邮箱
- 客户端-服务器架构:基于 MCP 框架实现异步通信
快速开始
环境要求
- Python 3.10 或更高版本
- uv 包管理器(推荐)或 pip
安装步骤
-
克隆仓库
git clone https://github.com/HugoWw/MCP-EXP.git cd mcp-exp -
安装依赖
使用 uv(推荐):
uv sync或使用 pip:
pip install -e . -
配置环境变量
创建 .env 文件并添加以下配置:
# OpenAI API 配置 OPENAI_API_KEY=your_openai_api_key BASE_URL=your_api_base_url MODEL=your_model_name # Serper API 配置(用于谷歌新闻搜索) SERPER_API_KEY=your_serper_api_key # 邮件配置(用于发送结果) EMAIL_HOST=smtp.example.com EMAIL_PORT=465 EMAIL_USER=your_email@example.com EMAIL_PASSWORD=your_email_password
运行项目
python client.py
启动脚本后根据提示输入内容,比如:
分析下小米yu7的热点新闻,并发送邮件给xxx@example.com
使用示例
新闻搜索与分析流程
- 客户端连接到服务器
- 调用新闻搜索工具获取热点新闻
- 对新闻进行情感分析
- 生成分析报告并保存
- 发送分析报告到指定邮箱
主要工具接口
项目提供了以下主要工具接口(可在 MCP 交互中使用):
search_google_news:搜索指定关键词的新闻analyze_sentiment:分析新闻的情感倾向send_email:发送邮件
生成的结果
生成的报告会存放到sentiment_reports目录下,如:该工程生成的示例报告
注意事项
根据实际项目情况修改和调整内容,(如 OpenAI API 密钥、Base URL、 SERPER_API_KEY等)为实际值。 SERPER_API_KEY可到Serper官网注册账户获取,邮箱的话可以去163去获取,模型可以去阿里的百练平台获取。
许可证
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.