
MCP Server Practice

2025.03.18
0
PythonLinkedIn 个人资料抓取天气数据检索内容生成位置服务
MCP-Server-Practice-2 是一个基于 Model Context Protocol (MCP) 框架的服务实现,主要用于 LinkedIn 个人资料抓取和天气数据检索。该项目通过 MCP 框架实现了 AI 服务之间的无缝集成和通信。
- **核心功能**:
- LinkedIn 个人资料抓取:通过 Fresh LinkedIn Profile Data API 获取 LinkedIn 个人资料数据。
- 天气数据服务:通过 National Weather Service (NWS) API 获取天气警报和预报。
- **适用场景**:
- 需要自动化抓取 LinkedIn 个人资料的场景。
- 需要实时获取天气警报和预报的场景。
View on GitHub
Overview
基本能力
产品定位
MCP-Server-Practice-2 是一个基于 Model Context Protocol (MCP) 框架的服务实现,主要用于 LinkedIn 个人资料抓取和天气数据检索。
核心功能
- LinkedIn Profile Scraper:
- 使用 Fresh LinkedIn Profile Data API 获取 LinkedIn 个人资料数据。
-
通过
get_profile
工具提供数据抓取功能。 -
Weather Data Service:
- 使用 National Weather Service (NWS) API 获取天气警报和预报。
- 提供
get_alerts
和get_forecast
工具,分别用于获取天气警报和预报。
适用场景
- LinkedIn Profile Scraper:
-
自动化抓取 LinkedIn 个人资料数据,用于数据分析、招聘等场景。
-
Weather Data Service:
- 实时获取天气警报和预报,用于天气预报应用、灾害预警等场景。
工具列表
- LinkedIn Profile Scraper:
-
get_profile
:获取 LinkedIn 个人资料数据。 -
Weather Data Service:
get_alerts
:获取指定美国州的天气警报。get_forecast
:获取指定经纬度的天气预报。
常见问题解答
- 依赖安装失败:确保 Python 版本为 3.7+,并使用
pip install httpx python-dotenv mcp
安装依赖。 - API 密钥问题:确保在
.env
文件中正确设置RAPIDAPI_KEY
。
使用教程
使用依赖
- 确保已安装 Python 3.7+。
- 安装依赖:
bash pip install httpx python-dotenv mcp
安装教程
- 克隆仓库:
bash git clone https://github.com/mybarefootstory/MCP-Server-Practice-2.git cd MCP-Server-Practice-2
- 设置环境变量:
- 在根目录创建
.env
文件。 - 添加 RapidAPI 密钥:
RAPIDAPI_KEY=your_rapidapi_key_here
调试方式
- 运行 LinkedIn Profile Scraper:
bash python linkedin_profile_scraper.py
- 运行 Weather Data Service:
bash python weather_data_service.py
- 使用工具:
- LinkedIn Profile Scraper:调用
get_profile
工具。 - Weather Data Service:调用
get_alerts
或get_forecast
工具。
许可证
None