[{"data":1,"prerenderedAt":500},["ShallowReactive",2],{"navigation":3,"page:\u002Fcodex":45},{"title":4,"links":5},"API reference",[6,9,12,15,18,21,24,27,30,33,36,39,42],{"title":7,"href":8},"Accounts","\u002Freference\u002Faccounts",{"title":10,"href":11},"Connect","\u002Freference\u002Fconnect",{"title":13,"href":14},"Calendars","\u002Freference\u002Fcalendars",{"title":16,"href":17},"Events","\u002Freference\u002Fevents",{"title":19,"href":20},"Availability","\u002Freference\u002Favailability",{"title":22,"href":23},"Meetings","\u002Freference\u002Fmeetings",{"title":25,"href":26},"Invitations","\u002Freference\u002Finvitations",{"title":28,"href":29},"Webhooks","\u002Freference\u002Fwebhooks",{"title":31,"href":32},"Metadata","\u002Freference\u002Fmetadata",{"title":34,"href":35},"Keys","\u002Freference\u002Fkeys",{"title":37,"href":38},"Sandbox","\u002Freference\u002Fsandbox",{"title":40,"href":41},"Usage","\u002Freference\u002Fusage",{"title":43,"href":44},"Logs","\u002Freference\u002Flogs",{"kind":46,"title":47,"description":48,"sections":49,"doc":68},"guide","Codex","Add the Pyas MCP server to OpenAI's Codex, in the CLI, the IDE extension or the ChatGPT desktop app, sign in to Pyas, and let Codex set up your app and write the integration while you code.",[50,53,56,59,62,65],{"id":51,"title":52},"add-pyas-to-codex","Add Pyas to Codex",{"id":54,"title":55},"sign-in","Sign in",{"id":57,"title":58},"use-it-while-you-code","Use it while you code",{"id":60,"title":61},"choose-what-needs-your-approval","Choose what needs your approval",{"id":63,"title":64},"live-calendars","Live calendars",{"id":66,"title":67},"disconnect","Disconnect",{"id":69,"title":47,"body":70,"description":48,"extension":491,"hero":492,"meta":493,"navigation":494,"path":495,"rawbody":496,"sections":49,"seo":497,"stem":76,"v1":498,"__hash__":499},"docs\u002Fcodex.md",{"type":71,"value":72,"toc":483},"minimark",[73,77,84,98,101,104,107,153,164,167,237,239,242,258,269,271,274,280,303,308,313,324,330,332,341,360,363,365,368,400,403,410,423,425,428,455,465,479],[74,75,47],"h1",{"id":76},"codex",[78,79,80],"lead",{},[81,82,83],"p",{},"Add Pyas to Codex, and it can set up your Pyas app, write the code that connects calendars, and check your sandbox while you code. You add Pyas by its address and sign in. There is nothing to install and no key to copy.",[81,85,86,87,91,92,97],{},"Start with the sandbox address, ",[88,89,90],"code",{},"https:\u002F\u002Fmcp.pyas.io\u002Fsandbox",". It works in your app's ",[93,94,96],"a",{"href":95},"\u002Fsandbox","sandbox",", on sample people, calendars and events, so nothing you try reaches a real calendar.",[81,99,100],{},"The Codex CLI, the Codex IDE extension and Codex in the ChatGPT desktop app share their settings, so you add Pyas once for all three.",[102,103,52],"h2",{"id":51},[81,105,106],{},"In a terminal, run:",[108,109,114],"pre",{"className":110,"code":111,"language":112,"meta":113,"style":113},"language-bash shiki shiki-themes css-variables","codex mcp add pyas-sandbox --url https:\u002F\u002Fmcp.pyas.io\u002Fsandbox\ncodex mcp login pyas-sandbox\n","bash","",[88,115,116,140],{"__ignoreMap":113},[117,118,121,124,128,131,134,137],"span",{"class":119,"line":120},"line",1,[117,122,76],{"class":123},"s1IGz",[117,125,127],{"class":126},"sTB4W"," mcp",[117,129,130],{"class":126}," add",[117,132,133],{"class":126}," pyas-sandbox",[117,135,136],{"class":126}," --url",[117,138,139],{"class":126}," https:\u002F\u002Fmcp.pyas.io\u002Fsandbox\n",[117,141,143,145,147,150],{"class":119,"line":142},2,[117,144,76],{"class":123},[117,146,127],{"class":126},[117,148,149],{"class":126}," login",[117,151,152],{"class":126}," pyas-sandbox\n",[81,154,155,158,159,163],{},[88,156,157],{},"login"," opens your browser to ",[93,160,162],{"href":161},"#sign-in","sign in",". Codex doesn't ask you to sign in by itself, so run it after you add the server.",[81,165,166],{},"Or add it without the terminal:",[168,169,170,194,211],"ul",{},[171,172,173,177,178,181,182,185,186,189,190,193],"li",{},[174,175,176],"strong",{},"In the IDE extension:"," open the gear menu, then ",[174,179,180],{},"MCP servers",", and select ",[174,183,184],{},"Add server",". Choose ",[174,187,188],{},"Streamable HTTP",", enter the address, and restart the extension. Then select ",[174,191,192],{},"Authenticate"," next to the server.",[171,195,196,199,200,203,204,181,206,208,209,193],{},[174,197,198],{},"In the ChatGPT desktop app:"," open ",[174,201,202],{},"Settings",", then ",[174,205,180],{},[174,207,184],{},". Enter the address, restart the app, then select ",[174,210,192],{},[171,212,213,220],{},[174,214,215,216,219],{},"In ",[88,217,218],{},"~\u002F.codex\u002Fconfig.toml",":",[108,221,225],{"className":222,"code":223,"language":224,"meta":113,"style":113},"language-toml shiki shiki-themes css-variables","[mcp_servers.pyas-sandbox]\nurl = \"https:\u002F\u002Fmcp.pyas.io\u002Fsandbox\"\n","toml",[88,226,227,232],{"__ignoreMap":113},[117,228,229],{"class":119,"line":120},[117,230,231],{},"[mcp_servers.pyas-sandbox]\n",[117,233,234],{"class":119,"line":142},[117,235,236],{},"url = \"https:\u002F\u002Fmcp.pyas.io\u002Fsandbox\"\n",[102,238,55],{"id":54},[81,240,241],{},"When you sign in, your browser opens the Pyas dashboard:",[243,244,245,248,251],"ol",{},[171,246,247],{},"Sign in, or create an account.",[171,249,250],{},"Choose the app that Codex works with.",[171,252,253,254,257],{},"Check what Codex asks for, and select ",[174,255,256],{},"Allow",".",[81,259,260,261,264,265,268],{},"Go back to Codex. In the CLI, ",[88,262,263],{},"\u002Fmcp"," lists Pyas's tools. See ",[93,266,55],{"href":267},"\u002Fai-tools#sign-in"," for what each permission allows.",[102,270,58],{"id":57},[81,272,273],{},"Ask in plain words, in the project you're working on:",[275,276,277],"blockquote",{},[81,278,279],{},"Set up Pyas in this app so people can connect their Google or Outlook calendar.",[81,281,282,283,286,287,290,291,294,295,298,299,302],{},"Codex checks your app's setup with ",[88,284,285],{},"setup_status",", gets the code for your stack with ",[88,288,289],{},"get_recipe",", and creates a test key with ",[88,292,293],{},"get_test_key",". It tells you where to store the key, such as ",[88,296,297],{},"PYAS_API_KEY"," in your ",[88,300,301],{},".env"," file. Recipes cover Next.js and Express, and the AI app builders.",[275,304,305],{},[81,306,307],{},"What's on Avery's calendar tomorrow?",[275,309,310],{},[81,311,312],{},"My last request to Pyas failed. Why?",[81,314,315,316,319,320,323],{},"The sandbox's sample people, such as Avery Brooks and Riley Chen, have calendars with a week of events. For a failed request, Codex looks it up with ",[88,317,318],{},"get_request"," and ",[88,321,322],{},"explain_error",", from its trace ID.",[81,325,326,327,329],{},"Every request Codex makes is on the ",[174,328,43],{}," page in the dashboard, marked with the tool that made it.",[102,331,61],{"id":60},[81,333,334,335,338,339,219],{},"Each Pyas tool says whether it only reads. To let Codex use the tools that read without asking, and ask you before every change, set ",[88,336,337],{},"writes"," in ",[88,340,218],{},[108,342,344],{"className":222,"code":343,"language":224,"meta":113,"style":113},"[mcp_servers.pyas-sandbox]\nurl = \"https:\u002F\u002Fmcp.pyas.io\u002Fsandbox\"\ndefault_tools_approval_mode = \"writes\"\n",[88,345,346,350,354],{"__ignoreMap":113},[117,347,348],{"class":119,"line":120},[117,349,231],{},[117,351,352],{"class":119,"line":142},[117,353,236],{},[117,355,357],{"class":119,"line":356},3,[117,358,359],{},"default_tools_approval_mode = \"writes\"\n",[81,361,362],{},"Use the same setting for the live server.",[102,364,64],{"id":63},[81,366,367],{},"To work on the real calendars that people connected to your app, add a second server:",[108,369,371],{"className":110,"code":370,"language":112,"meta":113,"style":113},"codex mcp add pyas-live --url https:\u002F\u002Fmcp.pyas.io\ncodex mcp login pyas-live\n",[88,372,373,389],{"__ignoreMap":113},[117,374,375,377,379,381,384,386],{"class":119,"line":120},[117,376,76],{"class":123},[117,378,127],{"class":126},[117,380,130],{"class":126},[117,382,383],{"class":126}," pyas-live",[117,385,136],{"class":126},[117,387,388],{"class":126}," https:\u002F\u002Fmcp.pyas.io\n",[117,390,391,393,395,397],{"class":119,"line":142},[117,392,76],{"class":123},[117,394,127],{"class":126},[117,396,149],{"class":126},[117,398,399],{"class":126}," pyas-live\n",[81,401,402],{},"When you sign in, choose whether Codex may only read live calendars, or change them too.",[81,404,405,406,409],{},"Before Codex changes a live calendar, you confirm the change in Pyas, from a link that Codex gives you. See ",[93,407,64],{"href":408},"\u002Fai-tools#live-calendars"," for how that works and who can confirm.",[81,411,412,413,416,417,338,420,422],{},"While you work in the sandbox, turn the live server off. Add ",[88,414,415],{},"enabled = false"," under ",[88,418,419],{},"[mcp_servers.pyas-live]",[88,421,218],{},", and remove it when you need live calendars.",[102,424,67],{"id":66},[81,426,427],{},"To sign Codex out of Pyas, run:",[108,429,431],{"className":110,"code":430,"language":112,"meta":113,"style":113},"codex mcp logout pyas-sandbox\ncodex mcp remove pyas-sandbox\n",[88,432,433,444],{"__ignoreMap":113},[117,434,435,437,439,442],{"class":119,"line":120},[117,436,76],{"class":123},[117,438,127],{"class":126},[117,440,441],{"class":126}," logout",[117,443,152],{"class":126},[117,445,446,448,450,453],{"class":119,"line":142},[117,447,76],{"class":123},[117,449,127],{"class":126},[117,451,452],{"class":126}," remove",[117,454,152],{"class":126},[81,456,457,460,461,464],{},[88,458,459],{},"logout"," signs out, and ",[88,462,463],{},"remove"," deletes the server from Codex.",[81,466,467,468,471,472,474,475,478],{},"To stop Codex from Pyas's side, open your profile in the Pyas dashboard. ",[174,469,470],{},"Connected tools"," lists Codex with when it was last used, and ",[174,473,67],{}," stops it immediately. To use it again, run ",[88,476,477],{},"codex mcp login"," again.",[480,481,482],"style",{},"html pre.shiki code .s1IGz, html code.shiki .s1IGz{--shiki-default:var(--shiki-token-function)}html pre.shiki code .sTB4W, html code.shiki .sTB4W{--shiki-default:var(--shiki-token-string)}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":113,"searchDepth":356,"depth":356,"links":484},[485,486,487,488,489,490],{"id":51,"depth":142,"text":52},{"id":54,"depth":142,"text":55},{"id":57,"depth":142,"text":58},{"id":60,"depth":142,"text":61},{"id":63,"depth":142,"text":64},{"id":66,"depth":142,"text":67},"md",false,{},true,"\u002Fcodex","---\ntitle: Codex\ndescription: Add the Pyas MCP server to OpenAI's Codex, in the CLI, the IDE extension or the ChatGPT desktop app, sign in to Pyas, and let Codex set up your app and write the integration while you code.\nsections:\n  - { id: add-pyas-to-codex, title: Add Pyas to Codex }\n  - { id: sign-in, title: Sign in }\n  - { id: use-it-while-you-code, title: Use it while you code }\n  - { id: choose-what-needs-your-approval, title: Choose what needs your approval }\n  - { id: live-calendars, title: Live calendars }\n  - { id: disconnect, title: Disconnect }\n---\n\n# Codex\n\n::lead\nAdd Pyas to Codex, and it can set up your Pyas app, write the code that connects calendars, and check your sandbox while you code. You add Pyas by its address and sign in. There is nothing to install and no key to copy.\n::\n\nStart with the sandbox address, `https:\u002F\u002Fmcp.pyas.io\u002Fsandbox`. It works in your app's [sandbox](\u002Fsandbox), on sample people, calendars and events, so nothing you try reaches a real calendar.\n\nThe Codex CLI, the Codex IDE extension and Codex in the ChatGPT desktop app share their settings, so you add Pyas once for all three.\n\n## Add Pyas to Codex\n\nIn a terminal, run:\n\n```bash\ncodex mcp add pyas-sandbox --url https:\u002F\u002Fmcp.pyas.io\u002Fsandbox\ncodex mcp login pyas-sandbox\n```\n\n`login` opens your browser to [sign in](#sign-in). Codex doesn't ask you to sign in by itself, so run it after you add the server.\n\nOr add it without the terminal:\n\n- **In the IDE extension:** open the gear menu, then **MCP servers**, and select **Add server**. Choose **Streamable HTTP**, enter the address, and restart the extension. Then select **Authenticate** next to the server.\n- **In the ChatGPT desktop app:** open **Settings**, then **MCP servers**, and select **Add server**. Enter the address, restart the app, then select **Authenticate** next to the server.\n- **In `~\u002F.codex\u002Fconfig.toml`:**\n\n  ```toml\n  [mcp_servers.pyas-sandbox]\n  url = \"https:\u002F\u002Fmcp.pyas.io\u002Fsandbox\"\n  ```\n\n## Sign in\n\nWhen you sign in, your browser opens the Pyas dashboard:\n\n1. Sign in, or create an account.\n2. Choose the app that Codex works with.\n3. Check what Codex asks for, and select **Allow**.\n\nGo back to Codex. In the CLI, `\u002Fmcp` lists Pyas's tools. See [Sign in](\u002Fai-tools#sign-in) for what each permission allows.\n\n## Use it while you code\n\nAsk in plain words, in the project you're working on:\n\n> Set up Pyas in this app so people can connect their Google or Outlook calendar.\n\nCodex checks your app's setup with `setup_status`, gets the code for your stack with `get_recipe`, and creates a test key with `get_test_key`. It tells you where to store the key, such as `PYAS_API_KEY` in your `.env` file. Recipes cover Next.js and Express, and the AI app builders.\n\n> What's on Avery's calendar tomorrow?\n\n> My last request to Pyas failed. Why?\n\nThe sandbox's sample people, such as Avery Brooks and Riley Chen, have calendars with a week of events. For a failed request, Codex looks it up with `get_request` and `explain_error`, from its trace ID.\n\nEvery request Codex makes is on the **Logs** page in the dashboard, marked with the tool that made it.\n\n## Choose what needs your approval\n\nEach Pyas tool says whether it only reads. To let Codex use the tools that read without asking, and ask you before every change, set `writes` in `~\u002F.codex\u002Fconfig.toml`:\n\n```toml\n[mcp_servers.pyas-sandbox]\nurl = \"https:\u002F\u002Fmcp.pyas.io\u002Fsandbox\"\ndefault_tools_approval_mode = \"writes\"\n```\n\nUse the same setting for the live server.\n\n## Live calendars\n\nTo work on the real calendars that people connected to your app, add a second server:\n\n```bash\ncodex mcp add pyas-live --url https:\u002F\u002Fmcp.pyas.io\ncodex mcp login pyas-live\n```\n\nWhen you sign in, choose whether Codex may only read live calendars, or change them too.\n\nBefore Codex changes a live calendar, you confirm the change in Pyas, from a link that Codex gives you. See [Live calendars](\u002Fai-tools#live-calendars) for how that works and who can confirm.\n\nWhile you work in the sandbox, turn the live server off. Add `enabled = false` under `[mcp_servers.pyas-live]` in `~\u002F.codex\u002Fconfig.toml`, and remove it when you need live calendars.\n\n## Disconnect\n\nTo sign Codex out of Pyas, run:\n\n```bash\ncodex mcp logout pyas-sandbox\ncodex mcp remove pyas-sandbox\n```\n\n`logout` signs out, and `remove` deletes the server from Codex.\n\nTo stop Codex from Pyas's side, open your profile in the Pyas dashboard. **Connected tools** lists Codex with when it was last used, and **Disconnect** stops it immediately. To use it again, run `codex mcp login` again.\n",{"title":47,"description":48},null,"_PhD6cnbj33me8newh2ymn9_Ti3T1SfBK_meDu_dgTU",1794697271065]