Skip to content
Muse Code × Google Calendar 5 min setup

Secure Muse Code Google Calendar Connection with PortEden

This guide gives Meta's Muse Code coding agent scoped Google Calendar access with PortEden as the data firewall. You add one MCP server entry to ~/.config/muse/settings.json, sign in, and Muse Code can read events, check free/busy, and (if you allow it) schedule, with attendee details redacted before content reaches Meta's model and every tool call recorded in the PortEden audit log.

Image needed

Diagram showing Google Calendar connecting to PortEden, with PortEden labeled REDACT AUDIT SCOPE, then forwarding to Muse Code in a terminal window

File:
public/images/guides/muse-code/muse-code-google-calendar-cover.png
Spec:
1200x630. Google Calendar icon on the left, PortEden shield in the middle labeled REDACT / AUDIT / SCOPE, terminal window with the Muse Code prompt on the right, arrows left to right.
Used as:
Guide cover + OpenGraph image

In short

  • Add one MCP server to ~/.config/muse/settings.json: transport streamable_http, URL https://mcp.porteden.com/calendar
  • Restart Muse Code and authenticate to PortEden on the first calendar tool call. Sign up in the same flow if needed.
  • If Google Calendar is already connected to your PortEden account, the Google authorization step is skipped automatically.
  • Verify with a read prompt. Tighten permissions, attendee redaction, and calendar scope later from my.porteden.com.

What you get

When the connection is live, Muse Code can answer scheduling questions in the middle of a coding session: find a free window for a risky migration, check the on-call rotation before a deploy, book the incident retro. Every tool call, from the lead agent or any parallel sub-agent, routes through PortEden, which applies:

Attendee redaction

Attendee names and email addresses are redacted or tokenized by default before event data reaches Meta's model. A free/busy-only preset exposes availability with no event details at all.

Per-action permissions

Read, free/busy, create, update, and delete are separate scopes. A read-only token cannot cancel a meeting, no matter which sub-agent asks.

Calendar and time scope

Limit access to specific calendars (work only, never a shared exec calendar) and to a rolling time window around today.

Audit trail

Every tool call from Muse Code is logged centrally: the requested action, the decision (allow, redact, or block), and the response shape returned. SIEM-exportable.

Prerequisites

  • Muse Code (beta) installed and authenticated: curl -fsSL https://dev.meta.ai/install.sh | bash, then muse login. macOS and Linux; on Windows use WSL2.
  • A Google account with the calendars you want Muse Code to use.

No PortEden account yet? That is fine.

When the PortEden sign-in opens on Muse Code's first calendar tool call (Step 2), you can sign up with Google one-click or with email in the same flow.

Step 1: Add the PortEden MCP server to settings.json

PortEden runs a hosted calendar MCP server you connect with one URL over the streamable_http transport.

1
Open (or create) the settings file:
mkdir -p ~/.config/muse
$EDITOR ~/.config/muse/settings.json
2
Add the calendar server entry. If the file is new, this is the whole file:
~/.config/muse/settings.json
{
"schema_version": 1,
"mcp_servers": {
"calendar": {
"transport": "streamable_http",
"url": "https://mcp.porteden.com/calendar",
"mode": "optional"
}
}
}
3
Save the file and restart Muse Code so it picks up the new server. Continue to Step 2.

schema_version is mandatory

Muse Code refuses to start with a malformed settings file error if "schema_version": 1 is missing. "mode": "optional" keeps an unreachable server from aborting your coding run.

Step 2: Sign in to PortEden

The first time Muse Code calls a calendar tool, the PortEden server requires authentication.

1
Trigger a first call from a Muse Code session, for example: "List the tools available from the calendar server." The PortEden sign-in opens in your browser.
2
Sign in, or sign up in the same flow. Approve the connection request. PortEden creates a scoped Access Token for this Muse Code connection automatically.

Beta build not opening a sign-in?

If your Muse Code build does not run a browser sign-in for remote MCP servers, create an Access Token at my.porteden.com (scoped to calendar only) and pass it in the server entry: "headers": { "Authorization": "Bearer pe_your_token" }.

Step 3: Connect Google Calendar (first-time only)

This step runs only if your PortEden account does not already have Google Calendar connected. If it does, PortEden reuses the existing connection and you can jump straight to Step 4.

If Google Calendar is not connected yet

1
PortEden will prompt you to Connect Google Calendar. Click it.
2
Complete Google's OAuth consent screen. Read scope by default; event-write scopes are requested so scheduling can be enabled later if you allow it.
3
The window closes. Return to your terminal and retry the prompt; the connection is now live.

If Google Calendar is already connected to PortEden

You will not see a Google authorization prompt at all. PortEden detects the existing connection, attaches it to the new Muse Code token, and the next tool call just works.

Step 4: Verify the connection

In a Muse Code session, run a low-risk read prompt. Then check the PortEden audit log to confirm the request shows up.

Try one of these

What meetings do I have this week?
When is my next free two-hour block this week?
Am I free Thursday at 3pm?
List my recurring meetings and their cadence.
  • Muse Code returns real events or availability, not a refusal or an error.
  • Attendee names and emails appear redacted or tokenized if you left redaction enabled.
  • The PortEden audit log at my.porteden.com shows the request with a green allow decision.

Step 5: Tighten what Muse Code can do (optional)

The token PortEden created uses conservative defaults: calendar scope only, attendee redaction on, confirm-before-write for create, update, and delete. Adjust it from my.porteden.com under Access Tokens. Every sub-agent Muse Code spawns uses this same token.

Permission presets for a coding agent

Pick the action set that matches what you want Muse Code to do

PresetWhat Muse Code can doWhat it cannot do
freebusy_onlySee when you are busy or free, no event detailsRead titles, attendees, or locations
read_only (recommended)Read events and availability with redacted attendeesCreate, update, or delete anything
read_and_scheduleRead plus propose and create events, with confirmationUpdate or delete existing events
full_calendarAll calendar actions with confirm-before-writeTouch other PortEden capabilities (email, drive)

Recommended rules for a Muse Code token

  • Prefer freebusy_only: most coding-agent scheduling questions only need availability, not who you are meeting.
  • Calendar scope: expose your primary work calendar only; keep shared team and exec calendars out.
  • Time window: a rolling window of two weeks back and eight weeks forward covers scheduling without exposing history.
  • Confirm before write: keep on for create, update, and delete. Recurring-event edits are the classic blast-radius mistake.

Changes apply immediately

PortEden re-evaluates the token on every tool call. Save the change and the very next request, from the lead agent or any sub-agent, uses the new rules.

Suggested prompts for everyday use

Plan work

"Find my three longest free blocks this week so I can schedule the database migration."

Deploy check

"Do I have any meetings Friday afternoon that would conflict with a 2pm deploy window?"

Retro

"Propose two slots next week for a one-hour incident retro. Confirm with me before creating anything."

Standups

"List my recurring engineering meetings and flag any that overlap."

Focus time

"Create a two-hour focus block tomorrow morning titled "refactor auth module". Confirm before creating."

Availability

"Am I free for the whole of Wednesday afternoon? Answer from free/busy only."

Troubleshooting and error handling

Match the message you see to the entries below. For settings-file and auth errors, the full troubleshooting table in the Gmail guide applies to any PortEden connection in Muse Code.

SETTINGS_MALFORMED

Muse Code fails at startup after editing settings.json

Symptoms

  • Every muse command fails with "malformed settings file" or "unsupported settings schema version".

Checks

  • Validate the JSON: jq . ~/.config/muse/settings.json
  • Confirm "schema_version": 1 is present at the top level.

Debug prompt for Muse Code

Not applicable, this one fails before a session starts. Fix the JSON and rerun muse.
PERMISSION_DENIED

403 Permission denied on a specific action

Symptoms

  • Muse Code says it lacks permission, or returns an accessInfo string explaining the rejection.
  • Audit log shows a block decision with a rule name.

Checks

  • Open the Access Token in PortEden and read the permission set (a freebusy_only token cannot read event titles; a read_only token cannot create).
  • Check the calendar scope; events on an unshared calendar are denied.
  • Check the time window; events outside the rolling window are hidden.

Debug prompt for Muse Code

Show me the full accessInfo field from the last error response, then summarize which permission, calendar rule, or time window blocked the call.
EMPTY_RESULTS

Muse Code sees no events even though the calendar has them

Symptoms

  • Prompts return an empty week or no availability data.

Checks

  • The token's calendar scope may exclude the calendar the events live on. Add the right calendar in the token settings.
  • The time window may be narrower than the range you asked about.
  • If you use freebusy_only, event listing prompts return availability only; ask availability-style questions instead.

Debug prompt for Muse Code

List the calendars you can currently see through the calendar server, and the date range the last query covered.
CONNECTION_DROPPED

Google returned reauth required

Symptoms

  • Calls were working, then all calendar tools start failing.
  • Audit log shows a provider_reauth_required entry.

Checks

  • Open Connections in PortEden. Google Calendar will show a yellow Needs reauth badge.
  • Click Reconnect and complete the Google OAuth flow again.

Debug prompt for Muse Code

Quote the last provider_reauth_required error from PortEden and tell me which provider needs to be reconnected.

Security best practices

Remember the fleet. Muse Code fans out to parallel sub-agents that all use this connection; the token's scope bounds all of them.

Free/busy is usually enough. A coding agent scheduling around your day rarely needs event titles or attendees.

Keep attendee redaction on. Who you meet is often more sensitive than when you meet.

One token per AI client. Do not reuse a token across Muse Code, Claude, and ChatGPT.

Keep confirm-before-write on for create, update, and delete. A mass edit to a recurring series is the classic calendar incident.

Review the audit log weekly and revoke tokens promptly when an experiment ends.

FAQ

Why would a coding agent need my calendar?

Scheduling around code: finding a free window for a risky migration, checking the on-call rotation before a deploy, booking an incident retro, or listing this week's meetings while planning a sprint. Free/busy access alone covers most of it.

Can Muse Code see who I am meeting with?

Only if you allow it. PortEden redacts attendee names and emails by default, and the freebusy_only preset exposes availability with no event details at all.

Can Muse Code delete or move my meetings?

Not on the defaults. The token starts read-only; create, update, and delete are separate permissions, and destructive actions keep confirm-before-write on so a preview surfaces first.

Do Muse Code's sub-agents get the same calendar access?

Yes. Sub-agents use the session's MCP connections, so the PortEden token's scope is the boundary for the whole fleet. Keep it read-only or freebusy_only unless a workflow needs more.

Does this work with Outlook Calendar too?

Yes. PortEden's calendar capability covers Google Calendar and Outlook Calendar behind the same endpoint, https://mcp.porteden.com/calendar. You pick the account during the auth flow.

Will Meta train on my calendar data?

It depends on the Meta Model API tier behind your session; Meta's standard tier does not include training rights, while the discounted contributor tier documents them. PortEden reduces what reaches Meta on any tier: attendees are redacted, scope is limited, and freebusy_only sends no event content at all. Check Meta's current terms for your tier.

Next steps