Build with Base44

Base44's AI can add Google Calendar and Microsoft Outlook to your app with Pyas. You connect the Pyas MCP server to Base44 once. The AI then gets the code for each task from Pyas, and you store a key as a secret. The key stays in backend functions, and the code works with the sandbox's sample people before anyone connects a real calendar.

Before you start

Base44 adds custom MCP servers and backend functions on its Builder plan and above. Both are needed here.

Base44's MCP tools work only in the editor chat, while you build. What the AI reads from Pyas there is written into your app as it was at that moment, and doesn't update in the published app. That's why the code Pyas gives the AI reads calendars from backend functions, which call Pyas each time your app needs the data.

Add Pyas to Base44

  1. Select your workspace name at the bottom left, then Account preferences, then Builder.
  2. Under MCP Connections, select Add custom MCP.
  3. For Name, enter Pyas. For URL, enter https://mcp.pyas.io/sandbox. For Authentication, choose OAuth.
  4. Select Test, then Test & Add.
  5. Authorize the connection: sign in to Pyas, choose your app, and select Allow. See Sign in for what each permission allows.

The connection is yours, and it works in every app you build in Base44. New tools from Pyas can take up to 15 minutes to appear.

Ask for what you want

Ask in plain words, for example:

Add a button that lets people connect their Google or Outlook calendar, and show their events for the next week.

The AI checks your setup with setup_status and gets the code for each task with get_recipe. It adds your app's address, such as https://your-app.base44.app, to the allowed origins with update_app, and creates a test key with get_test_key. You confirm the address in Pyas, from the link it gives you. Every response from Pyas ends with the next step, so the AI knows what to do next.

Store the key

Store the test key as a secret named PYAS_API_KEY:

  1. In the app editor, open Dashboard, then Secrets, and select Add Secret.
  2. Enter PYAS_API_KEY as the Secret Name and the key as the Secret Value, then select Add Secret.

The Secrets page appears once your app has a backend function. Don't paste the key into the chat. Backend functions read the secret on the server, and it never reaches the browser. A test key works only in your app's sandbox.

What Base44 adds

The code runs as backend functions:

base44/functions/pyasConnectSession/entry.ts  creates a connect session for the button
base44/functions/pyasEvents/entry.ts          the person's events for the next 7 days
base44/functions/pyasBook/entry.ts            books the first free 30 minutes tomorrow
src/components/ConnectCalendar.jsx            the "Connect an account" button

Your pages call each function by its name, such as pyasEvents, with the app's Base44 client and base44.functions.invoke. Each function reads the key with secrets.get('PYAS_API_KEY'), and the signed-in person with Base44's auth.me().

With a test key, the functions use the sandbox's sample person, so the events and booking work right away. The connect button shows a message from Pyas that connecting a real calendar requires a live key. This is expected.

After you add a function or change a secret, publish the app again. The published app uses the functions and secrets it had when you last published it.

Receive webhooks

Ask the AI to receive Pyas webhooks. It adds a pyasWebhooks function, which verifies the signature of each delivery against the raw body before it reads the event.

The AI adds the endpoint to your sandbox with create_webhook, at your published address:

https://<your-app>.base44.app/functions/pyasWebhooks

Store the signing secret that create_webhook returns as a secret named PYAS_WEBHOOK_SECRET. See Webhooks for the events Pyas sends.

Go live

  1. In the Pyas dashboard, choose a plan and create a live key. Plans, payment and live keys are always done by you, in the dashboard.
  2. Replace the PYAS_API_KEY secret with the live key, and publish the app again.
  3. The functions now use the person signed in to your Base44 app. People who aren't signed in get a 401 response with the code SIGN_IN_REQUIRED, so your app needs sign-in before people connect a calendar.
  4. Add your published address to the app's allowed origins, and add a live webhook endpoint in the dashboard.

Disconnect

In Base44, open Account preferences, then Builder, then MCP Connections. Turn Pyas off to pause it, or open More actions, then Remove MCP, to remove it.

To stop Base44 from Pyas's side, open your profile in the Pyas dashboard. Connected tools lists Base44 with when it was last used, and Disconnect stops it immediately.