This is a simple MCP server implementation using FastMCP. It provides tools like 'web_search' and 'check_weather' to search the internet and get the latest update of your city's weather respectively.
- Make sure you have Python 3.12 or higher installed
- Create a virtual environment and activate it:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile in the project root with your API Keys (if needed):OPENWEATHER_API_KEY=your_openweather_api_key_here ANY_OTHER_API_KEY=your_any_other_api_key_here
Start the server with:
python main.pyThe server will start on http://localhost:8000 by default.
To use this server with your custom MCP client:
Make sure your client is configured to connect to the MCP server URL:
http://localhost:8000/mcp
- Weather API: Get from OpenWeatherMap (free tier available)