import gradio as gr from scrape_fake_app import get_homework,get_timetable import subprocess import os from dotenv import load_dotenv if os.getenv('ENVIRONMENT')=="PROD": print("installing playwright firefox") subprocess.run(["playwright","install","firefox"]) def fetch_homework(date:str,request: gr.Request) -> str: """ description: fetch the homeworks. Args: date: (str) set it to "today" unless explicitly specified otherwise Returns: The string describing the homeworks """ # print(str(dict(request.headers)["token"])) token = str(dict(request.headers)["token"]) return get_homework(token) def fetch_timetable(date:str,request: gr.Request) -> str: """ description: fetch the timetable Args: date: (str) set it to "today" unless explicitly specified otherwise Returns: The string describing the timetable """ # print(str(dict(request.headers)["token"])) token = str(dict(request.headers)["token"]) return get_timetable(token) title="
This app uses Playwright to log in and scrape the content of the dashboard of the fake app fake-app-omega.vercel.app.
The url, username and password to log in to the fake-app dashboard are passed to the mcp-server via a token in the request header.
Clicking on "Homeworks" or "Timetable" will produce an ERROR as no token is given here
You can test the mcp-server tools in Claude desktop using the following mcp-server config