{"slug": "giving-claude-code-direct-access-to-google-sheets-via-a-custom-mcp-server", "title": "Giving Claude Code Direct Access to Google Sheets via a Custom MCP Server", "summary": "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.", "body_md": "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.\n\nIn 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 uploading them to Google Drive every time. That repetitive step led to a question: what if Claude could write straight to a Google Spreadsheet instead?\n\nThe 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.\n\nModel 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.\n\nThe MCP server built for this exposes nine tools, split into three groups.\n\nSpreadsheet management:\n\nData operations:\n\nFormatting and sharing:\n\nThe interaction is just natural-language requests to Claude:\n\nAuthentication 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.\n\nA 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.\n\nWhat worked:\n\nWhat didn't work:\n\nIn 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.\n\nFollow [@kmrb_works](https://dev.to/kmrb_works) here on DEV for more field notes from real development work. Also on [X](https://x.com/kmrb_works) and [note](https://note.com/quirky_hosta1908), mostly in Japanese.", "url": "https://wpnews.pro/news/giving-claude-code-direct-access-to-google-sheets-via-a-custom-mcp-server", "canonical_source": "https://dev.to/kmrb_works/giving-claude-code-direct-access-to-google-sheets-via-a-custom-mcp-server-2occ", "published_at": "2026-11-25 13:01:49+00:00", "updated_at": "2026-11-25 13:14:03.437761+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools", "large-language-models"], "entities": ["Claude Code", "Google Sheets", "Model Context Protocol", "Google Drive", "VS Code", "Dropbox", "Google"], "also_reported_by": [], "takeaway": "A custom MCP server with nine Google Sheets tools lets Claude Code create, write, format, and share spreadsheets from natural-language prompts, but authentication must use OAuth2 rather than a service account, since personal Google accounts get no Drive storage under service accounts.", "recommendation": {"advice": "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.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/giving-claude-code-direct-access-to-google-sheets-via-a-custom-mcp-server", "markdown": "https://wpnews.pro/news/giving-claude-code-direct-access-to-google-sheets-via-a-custom-mcp-server.md", "text": "https://wpnews.pro/news/giving-claude-code-direct-access-to-google-sheets-via-a-custom-mcp-server.txt", "jsonld": "https://wpnews.pro/news/giving-claude-code-direct-access-to-google-sheets-via-a-custom-mcp-server.jsonld"}}