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: transportstreamable_http, URLhttps://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, thenmuse 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.
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.
mkdir -p ~/.config/muse $EDITOR ~/.config/muse/settings.json { "schema_version": 1, "mcp_servers": { "calendar": { "transport": "streamable_http", "url": "https://mcp.porteden.com/calendar", "mode": "optional" } } } schema_version is mandatory
"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.
Beta build not opening a sign-in?
"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
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
- 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
| Preset | What Muse Code can do | What it cannot do |
|---|---|---|
| freebusy_only | See when you are busy or free, no event details | Read titles, attendees, or locations |
| read_only (recommended) | Read events and availability with redacted attendees | Create, update, or delete anything |
| read_and_schedule | Read plus propose and create events, with confirmation | Update or delete existing events |
| full_calendar | All calendar actions with confirm-before-write | Touch 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
Suggested prompts for everyday use
"Find my three longest free blocks this week so I can schedule the database migration."
"Do I have any meetings Friday afternoon that would conflict with a 2pm deploy window?"
"Propose two slots next week for a one-hour incident retro. Confirm with me before creating anything."
"List my recurring engineering meetings and flag any that overlap."
"Create a two-hour focus block tomorrow morning titled "refactor auth module". Confirm before creating."
"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.
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
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
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
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
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
Connect PortEden to Muse Code
The general setup reference: all endpoints, settings fields, and troubleshooting.
MCP Calendar tool reference
All calendar tools exposed by the PortEden MCP server, with arguments and responses.
Connect Gmail to Muse Code
Give the same agent scoped, redacted email access next.
Muse Code MCP servers, explained
What Muse Code can reach over MCP and what Meta's docs say about sandboxing and tiers.