MCP Server Practice

MCP Server Practice

site icon
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 个人资料抓取和天气数据检索。

核心功能

  1. LinkedIn Profile Scraper
  2. 使用 Fresh LinkedIn Profile Data API 获取 LinkedIn 个人资料数据。
  3. 通过 get_profile 工具提供数据抓取功能。

  4. Weather Data Service

  5. 使用 National Weather Service (NWS) API 获取天气警报和预报。
  6. 提供 get_alertsget_forecast 工具,分别用于获取天气警报和预报。

适用场景

  • LinkedIn Profile Scraper
  • 自动化抓取 LinkedIn 个人资料数据,用于数据分析、招聘等场景。

  • Weather Data Service

  • 实时获取天气警报和预报,用于天气预报应用、灾害预警等场景。

工具列表

  1. LinkedIn Profile Scraper
  2. get_profile:获取 LinkedIn 个人资料数据。

  3. Weather Data Service

  4. get_alerts:获取指定美国州的天气警报。
  5. get_forecast:获取指定经纬度的天气预报。

常见问题解答

  • 依赖安装失败:确保 Python 版本为 3.7+,并使用 pip install httpx python-dotenv mcp 安装依赖。
  • API 密钥问题:确保在 .env 文件中正确设置 RAPIDAPI_KEY

使用教程

使用依赖

  1. 确保已安装 Python 3.7+。
  2. 安装依赖: bash pip install httpx python-dotenv mcp

安装教程

  1. 克隆仓库: bash git clone https://github.com/mybarefootstory/MCP-Server-Practice-2.git cd MCP-Server-Practice-2
  2. 设置环境变量:
  3. 在根目录创建 .env 文件。
  4. 添加 RapidAPI 密钥: RAPIDAPI_KEY=your_rapidapi_key_here

调试方式

  1. 运行 LinkedIn Profile Scraper: bash python linkedin_profile_scraper.py
  2. 运行 Weather Data Service: bash python weather_data_service.py
  3. 使用工具:
  4. LinkedIn Profile Scraper:调用 get_profile 工具。
  5. Weather Data Service:调用 get_alertsget_forecast 工具。

许可证

None