import requests
d={}
with open("/root/mcp-servers/google-workspace/.env") as f:
 for l in f:
  if "=" in l: k,v=l.strip().split("=",1); d[k]=v
r=requests.post("https://oauth2.googleapis.com/token",data={"client_id":d["GOOGLE_CLIENT_ID"],"client_secret":d["GOOGLE_CLIENT_SECRET"],
"refresh_token":d["GOOGLE_REFRESH_TOKEN"],"grant_type":"refresh_token"})
tk=r.json()["access_token"]
h={"Authorization":"Bearer "+tk}
fid='1ZVN66HNGV9mNxvTCg-PfH68NXK30qkuv'
q=f"'{fid}' in parents"
r2=requests.get("https://www.googleapis.com/drive/v3/files",headers=h,params={"q":q,"fields":"files(id,name,mimeType,size)"})
print(r2.json())
