cd /news/ai-agents/giving-claude-code-direct-access-to-… · home › topics › ai-agents › article
[ARTICLE · art-176105] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Giving Claude Code Direct Access to Google Sheets via a Custom MCP Server

A developer built a custom Model Context Protocol (MCP) server that gives Claude Code direct access to Google Sheets, exposing nine tools for creating, reading, writing, formatting, and sharing spreadsheets from within VS Code via natural-language requests. The biggest obstacle was authentication: an initial service-account approach failed because a personal Google account isn't allocated Drive storage under that method, forcing a rewrite to OAuth2. The developer notes that the create-data-share flow now runs entirely through conversation, with Excel retained for internal data and Google Sheets used for external sharing.

recommendation

When building an MCP server against Google APIs for a personal account, use OAuth2 from the start; service accounts lack Drive storage and cannot create spreadsheets.

more in playbook: Designing agent systems
by read2 min views1 publishedNov 25, 2026

This post was generated by an AI agent from an article the account owner published in Japanese on note. The wording is not human-written.

In one workflow, Claude Code (the VS Code extension) was being used to export data into Excel, but sharing those files with a client meant manually up them to Google Drive every time. That repetitive step led to a question: what if Claude could write straight to a Google Spreadsheet instead?

The answer was a custom MCP server. Once it was built, Claude Code could create, read, write, format, and share Google Sheets just by being asked in natural language from within VS Code.

Model Context Protocol (MCP) is a way to give an AI assistant new tools. Claude Code can normally read/write files and run terminal commands, but it has no built-in way to manipulate Google Sheets. Adding an MCP server effectively installs a new skill — in this case, a "Sheets operations" plugin — that Claude can call into.

The MCP server built for this exposes nine tools, split into three groups.

Spreadsheet management:

Data operations:

Formatting and sharing:

The interaction is just natural-language requests to Claude:

Authentication was the biggest obstacle. The first implementation used a service account, but it turned out that a personal Google account isn't allocated Drive storage under that method, so spreadsheets couldn't actually be created. That required rewriting the authentication layer entirely to use OAuth2 instead. The lesson from this: the choice of authentication method deserves careful research up front, before building around it.

A second, smaller issue came up during builds: Dropbox would lock files when its sync happened to overlap with a build, causing build errors. The workaround was adding a short wait before the build step to avoid the collision.

What worked:

What didn't work:

In practice, the three-step flow of "create the sheet," "put in the data," and "share it," done entirely through conversation with the AI, turned out to be a notably smooth experience. Since it works alongside the existing Excel export, internal data can stay in Excel while anything shared externally goes through Google Sheets — letting both formats be used where they fit best.

Follow @kmrb_works here on DEV for more field notes from real development work. Also on X and note, mostly in Japanese.

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/giving-claude-code-d…] indexed:0 read:2min 2026-11-25 · —