Automating Google Sheets with Claude
Let's set up the Google Sheets MCP.
Prepare Google Cloud Console
Create a New Project
- Open Google Cloud Console;
- Click current project name to access project selector (top left button);
- Select "New Project" and provide descriptive name (e.g., "sheets mcp agent");
- Pick your organisation. If you're using a personal Gmail, this field can have the value "No Organisation";
- Click Create;
- Wait for project creation and switch to new project.
API Activation
- From the left menu, go to APIs & Services → Library;
- In the search field, type Google Sheets API, select the corresponding API, and click the Enable button;
- Then, go to Library in left menu, search for Google Drive API, select the corresponding API and enable it.
Configure OAuth Consent Screen
- Navigate to the "Credentials" tab;
- If prompted, click "Configure consent screen";
- Click "Get started";
- Enter application name (e.g., "gsheet agent");
- Input your email address;
- Select "External Audience" for user type, if you use general Gmail account;
- Re-enter your email address when prompted;
- Accept the user data policy;
- Click Continue and Create.
Create OAuth Credentials
- Click "Create OAuth Client";
- Select "Desktop App" for local AI agents and scripts;
- Accept suggested naming or customize as needed;
- Download the JSON file and save it as
credentials.json
in your project directory; - Now you need to move the file with credentials to the folder with the AI agent (
/google_sheet_mcp
). You can do that manually by moving the file icon to the opened folder in the file explorer; - Use Claude with the Desktop MCP agent to move file:
Move the credentials.json file from Desktop into the new
Documents/projects/google_sheet_mcp folder
Confirm successful file transfer and remove from original location.
Update Config File
Update via Prompt
In Claude write:
Update config file with google_sheets_mcp server uvx mcp-google-sheet@latest.
Add environment variables CREDENTIALS_PATH and TOKEN_PATH
(same as CREDENTIALS_PATH, but pointing to token.json)
Restart Claude
- Fully exit Claude Desktop. (Mac:
Cmd + Q
; Windows:Alt + F4
); - Reopen Claude to finish the MCP launch.
Test the Google Sheets MCP
Test the MCP
- Reopen Claude;
- Now you can test the new Google Sheets AI agent. Here is the CSV file used in the video, along with a prompt example:
Create a new Google Sheet, build a pivot table that groups the data
by the product column, summarise the total quantity and the total
revenue for each product. Use the most recent
/Downloads/sales_dataset_large.csv file.
Use Python libraries to analyse this file.
- Claude will analyze the file and generate a new Google Sheet in your Drive.
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 4. Розділ 1
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Awesome!
Completion rate improved to 8.33
Automating Google Sheets with Claude
Свайпніть щоб показати меню
Let's set up the Google Sheets MCP.
Prepare Google Cloud Console
Create a New Project
- Open Google Cloud Console;
- Click current project name to access project selector (top left button);
- Select "New Project" and provide descriptive name (e.g., "sheets mcp agent");
- Pick your organisation. If you're using a personal Gmail, this field can have the value "No Organisation";
- Click Create;
- Wait for project creation and switch to new project.
API Activation
- From the left menu, go to APIs & Services → Library;
- In the search field, type Google Sheets API, select the corresponding API, and click the Enable button;
- Then, go to Library in left menu, search for Google Drive API, select the corresponding API and enable it.
Configure OAuth Consent Screen
- Navigate to the "Credentials" tab;
- If prompted, click "Configure consent screen";
- Click "Get started";
- Enter application name (e.g., "gsheet agent");
- Input your email address;
- Select "External Audience" for user type, if you use general Gmail account;
- Re-enter your email address when prompted;
- Accept the user data policy;
- Click Continue and Create.
Create OAuth Credentials
- Click "Create OAuth Client";
- Select "Desktop App" for local AI agents and scripts;
- Accept suggested naming or customize as needed;
- Download the JSON file and save it as
credentials.json
in your project directory; - Now you need to move the file with credentials to the folder with the AI agent (
/google_sheet_mcp
). You can do that manually by moving the file icon to the opened folder in the file explorer; - Use Claude with the Desktop MCP agent to move file:
Move the credentials.json file from Desktop into the new
Documents/projects/google_sheet_mcp folder
Confirm successful file transfer and remove from original location.
Update Config File
Update via Prompt
In Claude write:
Update config file with google_sheets_mcp server uvx mcp-google-sheet@latest.
Add environment variables CREDENTIALS_PATH and TOKEN_PATH
(same as CREDENTIALS_PATH, but pointing to token.json)
Restart Claude
- Fully exit Claude Desktop. (Mac:
Cmd + Q
; Windows:Alt + F4
); - Reopen Claude to finish the MCP launch.
Test the Google Sheets MCP
Test the MCP
- Reopen Claude;
- Now you can test the new Google Sheets AI agent. Here is the CSV file used in the video, along with a prompt example:
Create a new Google Sheet, build a pivot table that groups the data
by the product column, summarise the total quantity and the total
revenue for each product. Use the most recent
/Downloads/sales_dataset_large.csv file.
Use Python libraries to analyse this file.
- Claude will analyze the file and generate a new Google Sheet in your Drive.
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 4. Розділ 1