Skip to content
Muse Code × Google Docs 5 min setup

Secure Muse Code Google Docs Connection with PortEden

This guide gives Meta's Muse Code coding agent scoped Google Docs 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, summarize, and (if you allow it) edit the docs in folders you explicitly scope, with sensitive fields redacted before content reaches Meta's model and every tool call recorded in the PortEden audit log.

Image needed

Diagram showing Google Docs 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-docs-cover.png
Spec:
1200x630. Google Docs 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-docs
  • Restart Muse Code and authenticate to PortEden on the first docs tool call.
  • Scope the folders whose docs Muse Code may see; specs and design docs in, everything else out.
  • Verify with a read prompt. Edits stay behind confirm-before-write if you enable them at all.

What you get

Specs live in Docs, and coding agents need them: the API design the client must match, the architecture decision record, the release plan. When the connection is live, Muse Code reads them directly instead of you copy-pasting. Every tool call, from the lead agent or any parallel sub-agent, routes through PortEden, which applies:

Per-folder scope

Only docs in allowed folders are visible. HR docs, contracts, and board material stay out of reach by default.

Per-action permissions

Search, read, create, and edit are separate scopes. A read-only token cannot change a doc, and edits keep confirm-before-write on.

Redaction on content

Names, emails, and other identifiers inside allowed docs are stripped or tokenized before content reaches Meta's model.

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 docs you want Muse Code to use.

No PortEden account yet? That is fine.

When the PortEden sign-in opens on Muse Code's first docs 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 docs server entry. If the file is new, this is the whole file:
~/.config/muse/settings.json
{
"schema_version": 1,
"mcp_servers": {
"google-docs": {
"transport": "streamable_http",
"url": "https://mcp.porteden.com/google-docs",
"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-docs 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 docs only) and pass it in the server entry: "headers": { "Authorization": "Bearer pe_your_token" }.

Step 3: Connect Google and scope the folders

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

1
Open the Access Token for this connection and set the folder scope.
2
Allow the engineering folders that hold specs, design docs, and release plans.
3
Leave everything else out. Docs outside the scope simply never appear in search results.

Step 4: Verify the connection

Try one of these

Read the API design doc and summarize the open questions.
Find docs in the specs folder mentioning "webhooks", titles and links only.
Summarize the architecture decision record for the queue migration.
List the headings of the release-plan doc.
  • Muse Code reads docs inside allowed folders and nothing outside them.
  • Sensitive identifiers 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)

Adjust the token from my.porteden.com under Access Tokens. Every sub-agent Muse Code spawns uses this same token and folder 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)Search, read, and summarize docs in allowed foldersCreate or edit anything
read_and_createRead plus create new docs in allowed foldersEdit or delete existing docs
read_editRead plus edit existing docs, with confirmation per editDelete docs or touch other capabilities

Recommended rules for a Muse Code token

  • Read-only first: let the agent read specs and draft content in the terminal; you paste what survives review.
  • Narrow folder scope: specs and design docs in, everything else out.
  • Confirm before write: if you enable editing, keep the per-edit preview on. A doc edit has no worktree isolation to save you.
  • Redaction: leave on; design docs often quote customer names and emails that the model does not need.

Suggested prompts for everyday use

Implement

"Read the payments API spec doc and implement the endpoints it defines. Quote the sections you rely on."

Cross-check

"Compare the design doc against the code in this repo and list where the implementation drifted."

ADR

"Summarize the architecture decision records in the specs folder into a one-page overview."

Draft

"Draft a migration guide for the v2 API based on the design doc. Show it in the terminal; do not write to Docs."

Review prep

"List the open questions and TODO markers across the docs in the specs folder."

Changelog

"Read the release-plan doc and generate changelog entries for the items marked done."

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.

EMPTY_RESULTS

Doc searches return nothing

Symptoms

  • Muse Code reports no docs found for queries that should match.

Checks

  • The doc most likely lives outside the allowed folders. Check the token's folder scope in PortEden.
  • Folder scope applies to a folder and its children; a sibling folder needs its own entry.

Debug prompt for Muse Code

List the folders you can currently see through the google-docs server, then tell me which query returned empty.
PERMISSION_DENIED

403 Permission denied on an edit

Symptoms

  • Muse Code says it lacks permission to create or edit a doc.

Checks

  • The token is likely read_only, which is the recommended default. Enable read_edit only for a workflow that needs it.
  • Edits also require the doc to be inside the allowed folder scope.

Debug prompt for Muse Code

Show me the full accessInfo field from the last error response, then summarize which permission or folder 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 docs 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 folder scope bounds all of them.

Read-only is the right default. A coding agent that drafts in the terminal, with a human pasting into Docs, loses almost nothing and risks much less.

Keep confirm-before-write on for edits. Unlike code, a doc edit has no git worktree protecting the original.

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.

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

FAQ

Can Muse Code edit my Google Docs?

Only if you enable write permissions on the token, and edits keep confirm-before-write on by default so a preview surfaces before the doc changes. The recommended coding-agent setup is read-only: the agent reads specs and drafts content for you to paste.

Which docs can Muse Code see?

Only docs in the folders you allow. Scope starts narrow; add the engineering folders that hold your specs and design docs and leave everything else out.

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

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

What is the difference between this and the Drive connection?

The drive server covers file search, metadata, and file operations across allowed folders. The google-docs server adds structured reading and editing of Docs content. Many setups use drive for discovery and google-docs for content work; each has its own scoped token.

Will Meta train on my documents?

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 folder scope and redaction. Check Meta's current terms for your tier.

Next steps