MCP-Server-Practice-2
1
Github Watches
1
Github Forks
0
Github Stars
MCP Server Practice
This repository contains implementations of Model Context Protocol (MCP) servers for LinkedIn profile scraping and weather data retrieval. The MCP framework facilitates seamless integration and communication between AI services.
Overview
- LinkedIn Profile Scraper: Fetches LinkedIn profile data using the Fresh LinkedIn Profile Data API.
- Weather Data Service: Retrieves weather alerts and forecasts using the National Weather Service (NWS) API.
Prerequisites
- Python 3.7+
-
httpxfor asynchronous HTTP requests -
python-dotenvfor environment variable management -
mcpfor MCP server implementation
Installation
-
Clone the repository:
git clone https://github.com/mybarefootstory/MCP-Server-Practice-2.git cd MCP-Server-Practice-2 -
Install dependencies:
pip install httpx python-dotenv mcp -
Set up environment variables:
- Create a
.envfile in the root directory. - Add your RapidAPI key:
RAPIDAPI_KEY=your_rapidapi_key_here
- Create a
LinkedIn Profile Scraper
Description
Fetches LinkedIn profile data using the Fresh LinkedIn Profile Data API. The server is initialized with FastMCP and listens for requests to retrieve profile information.
Code Snippet
from mcp.server.fastmcp import FastMCP
import httpx
import os
from dotenv import load_dotenv
load_dotenv()
RAPIDAPI_KEY = os.getenv("RAPIDAPI_KEY")
mcp = FastMCP("linkedin_profile_scraper")
async def get_linkedin_data(linkedin_url: str) -> dict:
# Fetch LinkedIn profile data
...
@mcp.tool()
async def get_profile(linkedin_url: str) -> str:
# Get LinkedIn profile data
...
if __name__ == "__main__":
mcp.run(transport="stdio")
Weather Data Service
Description
Retrieves weather alerts and forecasts using the NWS API. The server is initialized with FastMCP and provides tools for fetching alerts and forecasts.
Code Snippet
from mcp.server.fastmcp import FastMCP
import httpx
mcp = FastMCP("weather")
async def make_nws_request(url: str) -> dict:
# Make a request to the NWS API
...
@mcp.tool()
async def get_alerts(state: str) -> str:
# Get weather alerts for a US state
...
@mcp.tool()
async def get_forecast(latitude: float, longitude: float) -> str:
# Get weather forecast for a location
...
if __name__ == "__main__":
mcp.run(transport='stdio')
Usage
-
LinkedIn Profile Scraper: Run the server and use the
get_profiletool to fetch LinkedIn data. -
Weather Data Service: Run the server and use the
get_alertsandget_forecasttools to retrieve weather information.
相关推荐
I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.
I find academic articles and books for research and literature reviews.
Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.
Confidential guide on numerology and astrology, based of GG33 Public information
Advanced software engineer GPT that excels through nailing the basics.
Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.
Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.
Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.
L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.
Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX
Plateforme d'automatisation de workflow à code équitable avec des capacités d'IA natives. Combinez le bâtiment visuel avec du code personnalisé, de l'auto-hôte ou du cloud, 400+ intégrations.
🧑🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.
Une liste organisée des serveurs de protocole de contexte de modèle (MCP)
Reviews
user_ktzaHphz
MCP-Server-Practice-2 is a fantastic tool for hands-on server management practice! Created by mybarefootstory, it offers a great way to improve your server skills. It’s user-friendly and provides a solid foundation for anyone looking to dive deeper into server management. Highly recommend checking it out! Here's the link to explore: https://github.com/mybarefootstory/MCP-Server-Practice-2.