Secure Muse Code Google Drive Connection with PortEden
This guide gives Meta's Muse Code coding agent scoped Google Drive access with PortEden as the data firewall. You add one MCP server entry to ~/.config/muse/settings.json, sign in, and Muse Code can search and read the folders you explicitly allow. Drive starts block-all: nothing is visible until you add a Drive Rule, and every tool call is recorded in the PortEden audit log.
Image needed
Diagram showing Google Drive connecting to PortEden, with PortEden labeled RULES AUDIT SCOPE, then forwarding to Muse Code in a terminal window
- File:
- public/images/guides/muse-code/muse-code-google-drive-cover.png
- Spec:
- 1200x630. Google Drive icon on the left, PortEden shield in the middle labeled RULES / 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/drive - Restart Muse Code and authenticate to PortEden on the first drive tool call.
- Drive is block-all by default. Add Drive Rules in PortEden for the folders Muse Code may see (specs, runbooks, design docs).
- Verify with a search prompt. Destructive file operations stay behind confirm-before-write.
What you get
When the connection is live, Muse Code can find and read the documents coding work actually depends on: API specs, architecture docs, runbooks, test plans. Every tool call, from the lead agent or any parallel sub-agent, routes through PortEden, which applies:
Block-all by default
No folder is visible until you allow it with a Drive Rule. Board decks, HR folders, and client files stay invisible unless you decide otherwise.
Per-action permissions
Search, read, export, create, move, and delete are separate scopes. Destructive operations keep confirm-before-write on.
Redaction on file content
Sensitive identifiers inside allowed documents 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 (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 Drive folders you want Muse Code to use.
No PortEden account yet? That is fine.
Step 1: Add the PortEden MCP server to settings.json
mkdir -p ~/.config/muse $EDITOR ~/.config/muse/settings.json { "schema_version": 1, "mcp_servers": { "drive": { "transport": "streamable_http", "url": "https://mcp.porteden.com/drive", "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
Beta build not opening a sign-in?
"headers": { "Authorization": "Bearer pe_your_token" }.Step 3: Connect Drive and add Drive Rules
If your PortEden account does not have Google Drive connected yet, complete Google's OAuth consent when prompted. Then, unlike email and calendar, there is one deliberate extra step: Drive starts block-all, so you allow folders explicitly.
Why block-all is the right default here
Step 4: Verify the connection
Try one of these
- Muse Code finds files inside allowed folders and nothing outside them.
- The PortEden audit log at my.porteden.com shows the request with a green allow decision.
Empty results are usually the rules working
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 the same Drive Rules.
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 |
|---|---|---|
| search_read (recommended) | Search, read, and export files in allowed folders | Create, move, rename, or delete anything |
| read_and_create | Read plus upload new files into allowed folders | Modify or delete existing files |
| full_drive | All file operations inside allowed folders, with confirmation on destructive ones | See anything outside the Drive Rules |
Recommended rules for a Muse Code token
- Allow narrowly: name the two or three engineering folders the agent needs; resist allowing a root folder.
- Stay read-only: a coding agent that needs to publish a doc can hand you the content to save instead.
- Confirm before write: keep on for delete, move, and overwrite if you enable write at all.
- Redaction: leave on; specs rarely need the customer names that sometimes appear in them.
Suggested prompts for everyday use
"Read the payments API spec and implement the client against it. Quote the sections you rely on."
"Open the incident runbook and walk me through the rollback steps for the search service."
"Find every doc in the specs folder that mentions the v2 auth flow, names and links only."
"Compare the architecture doc against the current repo structure and list the drift."
"Read the QA test plan and generate the missing test cases as code stubs."
"Summarize what changed between the two most recent versions of the design doc."
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.
Searches return nothing
Symptoms
- Muse Code reports no files found for queries that should match.
- Audit log shows allow decisions with empty result sets.
Checks
- Drive starts block-all. Check Drive Rules in PortEden and add an Allow rule for the folder the files live in.
- Rules apply to a folder and its children; a sibling folder needs its own rule.
Debug prompt for Muse Code
403 Permission denied on a file operation
Symptoms
- Muse Code says it lacks permission, or returns an accessInfo string explaining the rejection.
Checks
- The action attempted may not be enabled (search_read cannot create or delete).
- The target file may live outside the allowed folders.
- Adjust the token or rules, save, then retry. Changes apply on the next request.
Debug prompt for Muse Code
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
Google returned reauth required
Symptoms
- Calls were working, then all drive tools start failing.
- Audit log shows a provider_reauth_required entry.
Checks
- Open Connections in PortEden. Google Drive 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. Every parallel sub-agent shares this connection; the Drive Rules bound all of them.
Allow folders, never the Drive root. Name the two or three engineering folders the agent needs.
Stay read-only until a workflow proves it needs to write, and keep confirm-before-write on destructive operations.
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
Why does Muse Code see nothing in Drive after connecting?
By design. PortEden's Drive capability starts block-all: no folder is visible until you add a Drive Rule allowing it. Add a rule for the folder your specs or docs live in and the next query will find them.
Can Muse Code delete or overwrite my files?
Not on the defaults. The token starts read-only within allowed folders, and destructive operations (delete, move, overwrite) are separate permissions with confirm-before-write enabled.
Do Muse Code's sub-agents get the same Drive access?
Yes. Sub-agents use the session's MCP connections, so the PortEden token's folder rules bound the whole fleet, up to 16 parallel agents.
Can Muse Code read Google Docs and Sheets through this connection?
The drive server covers file search, metadata, reading, and file operations. For structured editing of Docs and Sheets content, add the dedicated servers: https://mcp.porteden.com/google-docs and https://mcp.porteden.com/google-sheets, each with its own scoped token and guide.
Will Meta train on my Drive files?
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: only allowed folders are visible, sensitive fields are redacted, and everything is logged. Check Meta's current terms for your tier.
Next steps
Connect Google Docs to Muse Code
Structured reading and editing of Docs, with per-folder scope.
Connect Google Sheets to Muse Code
Read and append to spreadsheets with per-file scoping.
MCP Drive tool reference
All drive tools exposed by the PortEden MCP server, with arguments and responses.
Muse Code MCP servers, explained
What Muse Code can reach over MCP and what Meta's docs say about sandboxing and tiers.