Skip to main content

Connecting to Google Sheets via MCP

Your financial models live in spreadsheets. Your forecasts, variance analyses, reconciliations, budgets—they all ultimately need to exist in cells with formulas that calculate results deterministically.

But building those models takes time. Figuring out the right formula structure, creating projections that follow realistic growth patterns, analyzing what the numbers mean—this is where finance professionals spend hours.

What if Claude Code could directly work with your spreadsheets? Not just suggest formulas you copy-paste, but actually read your data, create cells, and generate models—with you approving every change?

In Chapter 5, Lessons 9 and 10, you learned that MCP servers connect Claude Code to external systems. You saw how Playwright MCP gives Claude web browsing capabilities and how Context7 MCP provides documentation access. Now you'll apply that same pattern to connect Claude Code to Google Sheets, implementing the three-layer architecture from our Agentic Financial Planning framework.


Building on Chapter 5: MCP for External Access

Remember the core concept from Chapter 5, Lesson 9:

MCP is like a phone directory. It connects Claude Code to external tools and data sources in a standardized, safe way.

You've already used this pattern:

  • Playwright MCP: Claude browses websites
  • Context7 MCP: Claude fetches documentation

Google Sheets MCP follows the same principle: Claude Code gains the ability to read and write spreadsheet data through a standardized protocol, with you maintaining control over what gets changed.

The key insight from Chapter 5 applies here: MCP provides the data pipes while your CLAUDE.md (from Lesson 2) provides the expertise context. Together, they enable intelligent financial workflows.


The Three-Layer Architecture

When Claude Code connects to Google Sheets via MCP, you're implementing a powerful separation of concerns:

User Intent ("Model revenue growth at 15% MoM")


┌─────────────────────────────────┐
│ Claude Code (Intelligence) │
│ - Interprets business intent │
│ - Designs model structure │
│ - Generates formulas │
│ - Explains reasoning │
└─────────────────────────────────┘


┌─────────────────────────────────┐
│ Google Sheets MCP (Execution) │
│ - Creates/modifies cells │
│ - Executes formulas │
│ - Returns calculated results │
└─────────────────────────────────┘


┌─────────────────────────────────┐
│ Claude Code (Analysis) │
│ - Interprets results │
│ - Generates narratives │
│ - Suggests refinements │
└─────────────────────────────────┘


Human (Governance)
- Reviews proposed changes
- Approves modifications
- Validates assumptions

This separation mirrors how finance teams actually work—analysts don't both design the model AND execute it AND approve it. Different functions require different capabilities.

Why This Architecture Matters

Claude as Intelligence Layer: Claude reasons about your financial goals. When you say "model conservative revenue growth," Claude translates that into specific assumptions, formula structures, and time horizons. This is the cognition that traditional spreadsheets lack.

Sheets as Execution Layer: Google Sheets performs deterministic computation. When Claude generates =B2*(1+$C$1)^(A3-1), Sheets calculates the result exactly, every time. No hallucination possible—formulas either work or produce errors.

Human as Governance Layer: You approve every change. Claude proposes, you dispose. This maintains the audit trail and accountability that finance requires.


Why Google Sheets?

Google Sheets provides capabilities that complement Claude's reasoning:

CapabilityValue for Finance
Deterministic computationReliable, verifiable execution—formulas produce the same result every time
TransparencyHuman-readable formulas anyone can audit and understand
CollaborationReal-time multi-user access for team review and input
APIsProgrammatic control via MCP for automated workflows
VersioningBuilt-in revision history creates audit trail for changes
AccessibilityUniversal familiarity—finance teams already know spreadsheets

Traditional FP&A platforms execute logic but do not understand it. They can calculate a forecast but cannot explain why that growth rate makes sense or suggest alternatives. The Claude + Sheets combination provides both: reasoning AND reliable execution.


Configuring Google Sheets MCP

Adding the Google Sheets MCP server follows the same pattern you learned in Chapter 5.

Step 1: Add the MCP Server

claude mcp add --transport stdio google-sheets npx @anthropic/google-sheets-mcp

This registers the Google Sheets MCP server with Claude Code, just like you registered Playwright and Context7 in Chapter 5.

Step 2: Authenticate with Google

The first time you use the Google Sheets MCP, you'll need to authenticate:

# When prompted, Claude will provide an authentication URL
# Open it in your browser and grant access to your Google Sheets

Security note: The MCP server requests read/write access to your Google Sheets. Review the permissions carefully. Consider using a dedicated Google account for finance work, separate from personal documents.

Step 3: Verify the Connection

Test that the MCP server is working:

claude

# In Claude Code:
"List my available Google Sheets"

If Claude returns a list of your spreadsheets, the connection is working.


Your First Financial Workflow

Let's put the three-layer architecture into practice with a revenue projection.

The Scenario

You need to create a 12-month revenue projection starting at $100,000 with 15% monthly growth.

What Happens Without MCP

Without the Google Sheets connection, you would:

  1. Ask Claude for the formula
  2. Copy the formula
  3. Open Google Sheets
  4. Create cells manually
  5. Paste and adapt the formula
  6. Check results
  7. Go back to Claude with questions
  8. Repeat...

Context switches. Copy-paste errors. Formula adaptation mistakes. This is the friction from Lesson 1.

What Happens With MCP

With Google Sheets MCP, the workflow becomes:

Your request:

Create a 12-month revenue projection in a new sheet called "Revenue Forecast".
Start with $100,000 in January, grow 15% monthly.
Show me the formulas you'll use before creating anything.

Claude's reasoning:

I'll create a revenue projection with:

Structure:
- Column A: Month names (January through December)
- Column B: Revenue values
- Cell B1: Starting value ($100,000)
- Cells B2-B12: Growth formula referencing previous month

Formulas:
- B1: 100000 (seed value)
- B2: =B1*(1+0.15) → $115,000
- B3: =B2*(1+0.15) → $132,250
- ...continuing with same pattern

For maintainability, I'll put the growth rate in a named cell:
- D1: Growth Rate label
- E1: 0.15 (15% as decimal)
- B2-B12: =B1*(1+$E$1) with absolute reference to E1

This way you can change the growth rate in one place and the entire
projection updates.

Should I create this structure in your Google Sheets?

You approve:

Yes, create it.

Claude executes (via MCP):

Created "Revenue Forecast" sheet with:
- 12 months of projections
- Starting revenue: $100,000
- Growth rate: 15% (in cell E1 for easy modification)
- December projection: $435,025

The sheet is ready for your review.

Notice what happened:

  • Claude reasoned about the best structure
  • Claude proposed before acting
  • You approved the approach
  • MCP executed the creation
  • Claude summarized the results

This is the three-layer architecture in action.


Formula Generation from Intent

One of the most powerful applications of Claude + Sheets MCP is translating natural language into working formulas.

Simple Example: Variance Analysis

Your intent:

Compare Q3 actuals to plan and calculate the variance percentage

Claude generates:

For variance analysis, I'll use:

=ABS(Actual - Plan) / Plan * 100

If your actuals are in column B and plan in column C, the formula for row 2:
=ABS(B2-C2)/C2*100

This gives the absolute percentage variance. If you want to show whether
you're over or under plan (positive = favorable for revenue, negative = unfavorable):

=(B2-C2)/C2*100

Want me to apply this to your Budget sheet?

Complex Example: Conditional Aggregation

Your intent:

Calculate total expenses by department for the current fiscal year.
The data has columns: Date (A), Department (B), Amount (C).

Claude generates:

For conditional sum across date range and department:

=SUMIFS(C:C, A:A, ">="&DATE(2024,7,1), A:A, "<="&DATE(2025,6,30), B:B, "Engineering")

Breaking down this SUMIFS formula:
- C:C → Sum these values (Amount column)
- A:A, ">="&DATE(2024,7,1) → Where date is on/after July 1, 2024
- A:A, "<="&DATE(2025,6,30) → AND date is on/before June 30, 2025
- B:B, "Engineering" → AND department is "Engineering"

For all departments, I'd create a summary table with each department name
and this formula adjusted for each.

Your fiscal year runs July-June based on your CLAUDE.md context, so I've
used those dates. Should I create a department summary in your sheet?

Notice how Claude:

  1. Understood your fiscal year from CLAUDE.md context (Lesson 2)
  2. Chose the appropriate function (SUMIFS for multiple conditions)
  3. Explained each component of the formula
  4. Offered to execute but waited for approval

Working with Existing Data

The Google Sheets MCP can also read data, enabling Claude to analyze what you already have.

Reading and Analyzing

Your request:

Read the Q3 actuals from cells B2:B10 in my Budget sheet and compare
to the plan in cells C2:C10. Explain the top 3 variances.

Claude reads the data (via MCP):

Reading from Budget sheet...

Q3 Actuals vs Plan:
| Category | Actual | Plan | Variance |
|--------------------|----------|----------|-----------|
| Salaries | $125,000 | $120,000 | +4.2% |
| Marketing | $45,000 | $60,000 | -25.0% |
| Software | $28,000 | $22,000 | +27.3% |
| Travel | $8,500 | $15,000 | -43.3% |
| ... | ... | ... | ... |

Top 3 Variances Requiring Attention:

1. **Travel (-43.3%, -$6,500)**: Significantly under plan. This could be
a timing issue (trips postponed to Q4) or reduced travel needs. Verify
whether committed trips are still planned.

2. **Software (+27.3%, +$6,000)**: Over plan by material amount. Check
if this includes annual renewals that were budgeted differently, or
if new tools were added mid-quarter.

3. **Marketing (-25.0%, -$15,000)**: Campaign spending below plan. Could
indicate delayed initiatives or cost savings. Confirm whether planned
campaigns were postponed or canceled.

Want me to add variance percentage formulas to your sheet for ongoing tracking?

Claude didn't just calculate—it interpreted the numbers using financial reasoning, suggesting what each variance might mean and what to investigate.


Governance Integration

Your CLAUDE.md from Lesson 2 includes governance rules:

## Governance Rules
- All AI suggestions require human approval before posting
- Flag any transaction > $10,000 for management review
- Never modify historical transactions without documented adjustment

The Google Sheets MCP respects these boundaries:

Claude's behavior with governance context:

I can create the formula structure, but I notice this projection affects
your FY25 budget assumptions, which totals over $10,000.

Per your governance rules, I'll:
1. Show you the complete proposed changes
2. Wait for your explicit approval
3. Document the modification reason when you approve

Ready to proceed with your review?

The MCP executes, but your CLAUDE.md governance rules shape HOW Claude proposes actions.


Try With AI

Put the three-layer architecture into practice with these collaborative exercises.

Prompt 1: Create a Revenue Projection

Using the Google Sheets MCP, create a 12-month revenue projection in my
Financial Model sheet. Start with $100,000 in January, grow 15% monthly.
Show me the formulas you'll use before creating anything.

What you're learning: This prompt exercises the full three-layer flow. Claude interprets your intent (Intelligence layer), proposes formulas, waits for approval (Governance), then executes via MCP (Execution layer). Pay attention to the formula structure Claude chooses—compound growth with =B1*(1+$C$1)^(A2-1) versus iterative growth with =B1*(1+$C$1). Both work; understand when each is preferable.

Prompt 2: Analyze Budget Variances

Read the Q3 actuals from cells B2:B10 in my Budget sheet and compare
to the plan in cells C2:C10. Explain the top 3 variances with specific
cell references. What questions should I investigate for each?

What you're learning: This prompt demonstrates Claude reading existing data through MCP and applying financial reasoning. Notice how Claude doesn't just calculate percentages—it interprets what the variances might mean for your business. The specific cell references ensure you can verify Claude's analysis against your actual data.

Prompt 3: Generate a Complex Formula

Generate a SUMIFS formula for calculating total expenses by department
for the current fiscal year. The data has columns: Date (A), Department (B),
Amount (C). Explain how the formula works step by step.

What you're learning: Complex formulas like SUMIFS are where many finance professionals struggle. This prompt shows Claude as Teacher—explaining not just WHAT formula to use but WHY each component matters. Notice how Claude should reference your fiscal year from CLAUDE.md context. If Claude uses calendar year dates instead of your July-June fiscal year, your CLAUDE.md may need refinement.

Note: When working with Google Sheets MCP, start with non-critical spreadsheets. Test formula generation in a sandbox sheet before applying to production financial models. Always verify calculated results manually for the first few operations until you trust the workflow.