Skip to content
Muse Code × Google Sheets 5 min setup

Secure Muse Code Google Sheets Connection with PortEden

This guide gives Meta's Muse Code coding agent scoped Google Sheets 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 cells and (if you allow it) append rows in the specific spreadsheets you scope, with formula protection, redaction, and every tool call recorded in the PortEden audit log.

Image needed

Diagram showing Google Sheets 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-sheets-cover.png
Spec:
1200x630. Google Sheets 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/google-sheets
  • Restart Muse Code and authenticate to PortEden on the first sheets tool call.
  • Scope access per spreadsheet: the test-accounts sheet in, the payroll sheet never.
  • Verify with a read prompt. Formula cells are protected from writes, and range updates confirm first.

What you get

Spreadsheets hold the operational data coding work leans on: test-account matrices, feature-flag rollout plans, benchmark results, error budgets. When the connection is live, Muse Code reads them directly, and can log results back if you allow appends. Every tool call, from the lead agent or any parallel sub-agent, routes through PortEden, which applies:

Per-file scoping

Access is granted spreadsheet by spreadsheet. The token that reads the test-accounts sheet cannot see the revenue model two folders over.

Formula protection

Cells containing formulas are excluded from writes by default, so an append or update cannot silently break the sheet's calculations.

Per-action permissions

Read, append, and update ranges are separate scopes. Append-only is the sweet spot for logging results without touching existing data.

Audit trail

Every tool call from Muse Code is logged centrally: the requested action, the decision, 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 spreadsheets you want Muse Code to use.

No PortEden account yet? That is fine.

When the PortEden sign-in opens on Muse Code's first sheets 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

1
Open (or create) the settings file:
mkdir -p ~/.config/muse
$EDITOR ~/.config/muse/settings.json
2
Add the sheets server entry. If the file is new, this is the whole file:
~/.config/muse/settings.json
{
"schema_version": 1,
"mcp_servers": {
"google-sheets": {
"transport": "streamable_http",
"url": "https://mcp.porteden.com/google-sheets",
"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

1
Trigger a first call from a Muse Code session, for example: "List the tools available from the google-sheets 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 sheets only) and pass it in the server entry: "headers": { "Authorization": "Bearer pe_your_token" }.

Step 3: Connect Google and scope the spreadsheets

If your PortEden account does not have Google connected yet, complete the OAuth consent when prompted (skipped automatically if it is). Then scope the token per file from my.porteden.com.

1
Open the Access Token for this connection and add the spreadsheets Muse Code may access.
2
Typical picks for a coding agent: the test-accounts matrix, the feature-flag rollout sheet, the benchmark-results log.
3
Leave finance, HR, and planning sheets out. Files outside the scope simply do not exist as far as the agent can see.

Step 4: Verify the connection

Try one of these

Show me the first 10 rows of the test-accounts sheet.
How many rows does the feature-flags sheet have, and what are the column headers?
Find the row in the test-accounts sheet where environment is "staging".
Read the benchmark-results sheet and summarize the trend for the search endpoint.
  • Muse Code reads the allowed spreadsheets and cannot find files outside the scope.
  • 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)

Adjust the token from my.porteden.com under Access Tokens. Every sub-agent Muse Code spawns uses this same token and file scope.

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
read_only (recommended)Read cells and ranges in allowed spreadsheetsWrite anything
read_appendRead plus append new rows (great for logging results)Update or clear existing cells
read_writeRead, append, and update ranges with confirmation, formulas protectedDelete spreadsheets or touch files outside the scope

Recommended rules for a Muse Code token

  • Per-file scope, always: name the two or three sheets the agent needs; never grant all spreadsheets.
  • Prefer read_append over read_write: appending a benchmark row cannot corrupt existing data.
  • Keep formula protection on: a fleet of sub-agents writing into a live model is how a sheet quietly breaks.
  • Confirm before write: keep the preview on for range updates.

Suggested prompts for everyday use

Test data

"Read the test-accounts sheet and generate fixtures for the staging environment rows."

Flags

"Which feature flags in the rollout sheet are marked for 100% this week? List flag names and owners."

Log results

"Append a row to the benchmark-results sheet with today's date and the p95 latency from the last run. Confirm before writing."

Validate

"Check the config sheet for rows where the URL column is not a valid URL and list them."

Generate

"Turn the error-codes sheet into a TypeScript enum with doc comments from the description column."

Diff

"Compare the environments sheet against .env.example in this repo and list missing keys."

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.

FILE_NOT_FOUND

Muse Code cannot find a spreadsheet that exists

Symptoms

  • Queries return no matching spreadsheet, or a not-found error for a file you can open in the browser.

Checks

  • The file is probably outside the token's per-file scope. Add it in the token settings at my.porteden.com.
  • Confirm the file is on the same Google account PortEden is connected to.

Debug prompt for Muse Code

List the spreadsheets you can currently see through the google-sheets server.
PERMISSION_DENIED

403 Permission denied on a write

Symptoms

  • Muse Code says it lacks permission to append or update.
  • A write to a formula cell is rejected.

Checks

  • The token may be read_only; switch to read_append for logging workflows.
  • Formula protection rejects writes into formula cells by design; append to a data range instead.

Debug prompt for Muse Code

Show me the full accessInfo field from the last error response, then summarize which permission or protection rule blocked the call.
SETTINGS_MALFORMED

Muse Code fails at startup after editing settings.json

Symptoms

  • Every muse command fails with "malformed settings file".

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.
CONNECTION_DROPPED

Google returned reauth required

Symptoms

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

Checks

  • Open Connections in PortEden and click Reconnect on the Google connection.

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. Every parallel sub-agent shares this connection; the per-file scope bounds all of them.

Scope per file, never per Drive. A coding agent needs three sheets, not three hundred.

Prefer append-only writes. Logging a benchmark row cannot corrupt existing data the way a range update can.

Keep formula protection and confirm-before-write on for any token that can write.

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

Keep redaction on. Meta's contributor API tier documents training rights on submitted data; redacted fields never reach the model on any tier.

FAQ

Can Muse Code overwrite formulas in my spreadsheet?

Not with formula protection on, which is the default. Cells containing formulas are excluded from writes, and range updates keep confirm-before-write so a preview surfaces before anything changes. Append-only mode avoids touching existing cells entirely.

Which spreadsheets can Muse Code see?

Only the ones you allow. Sheets access is scoped per file, so a token can see the test-accounts sheet and nothing else in your Drive.

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

Yes. Sub-agents use the session's MCP connections, so the PortEden token's per-file scope bounds the whole fleet, up to 16 parallel agents.

Can multiple sub-agents write to the same sheet at once?

Appends from parallel agents land as separate rows, which is why append-only is the recommended write mode. Range updates from a fleet are exactly the collision worktrees prevent in code but nothing prevents in a spreadsheet, so keep updates confirmed and rare.

Will Meta train on my spreadsheet data?

It depends on the Meta Model API tier behind your session; the standard tier does not include training rights, while the discounted contributor tier documents them. PortEden limits what reaches Meta on any tier through per-file scope and redaction. Check Meta's current terms for your tier.

Next steps