Get the FREE Ultimate OpenClaw Setup Guide →

mcp-lightning-lesson

MCP server from rafaelpierre/mcp-lightning-lesson

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio rafaelpierre-mcp-lightning-lesson python main.py \
  --env OPENAI_API_KEY="your-openai-api-key"

How to use

This MCP server demonstrates running a Python-based agent system that uses OpenAI GPT models to query real-world data. The main workflow fetches a weather forecast for Hintertux, Austria from meteoblue via a custom agent and also retrieves the current time using an example tool (get_time). The server exposes structured JSON output suitable for downstream consumption by applications that expect machine-readable weather, time, and related context. To operate, ensure your environment has Python and the required dependencies installed, and provide your OpenAI API key so the agent can perform reasoning with the GPT models. You can interact with the running MCP server by executing the main.py script; it will orchestrate the agent, fetch data, and emit a JSON payload containing the results.

How to install

Prerequisites:

  • Python 3.13+
  • OpenAI API key
  • Internet access to fetch data from meteoblue and call OpenAI endpoints

Installation steps:

  1. Clone the repository: git clone ... cd mcp-lightning-lesson

  2. Create and activate a virtual environment (using your preferred tool; uv is demonstrated in the project): python -m venv venv source venv/bin/activate # on Unix/macOS

    On Windows use: venv\Scripts\activate

  3. Install dependencies: pip install -r requirements.txt # if such a file exists

    If no requirements.txt is present, install explicitly:

    pip install openai-agents>=0.0.15 python-dotenv>=1.1.0

  4. Copy the example environment file and set your API key: cp .env.example .env

    Edit .env and set OPENAI_API_KEY

  5. Run the application (as shown in the project): uv run python main.py

Notes:

  • If you prefer a direct Python execution without uv, you can run: python main.py
  • Ensure your OpenAI API key is valid and has access to the needed models.

Additional notes

Tips and common considerations:

  • Environment variable OPENAI_API_KEY is required for the agent to access OpenAI models.
  • The workflow fetches a weather forecast for Hintertux, Austria and also retrieves the current time via a tool; ensure network access to meteoblue data sources as configured by the agent.
  • If you encounter rate limits or API key issues, check your OpenAI usage limits and the meteoblue data source accessibility.
  • The output is a structured JSON payload; adapt downstream consumers to parse fields representing weather, time, and related context.
  • If you modify dependencies, re-install and re-test to ensure compatibility with openai-agents and python-dotenv.

Related MCP Servers

Sponsor this space

Reach thousands of developers