This guide walks you through creating OAuth 2.0 credentials in Google Cloud Console. You'll need these credentials to authenticate the Secure Workspace MCP server with your Google account.
Time required: 10-15 minutes
- Go to Google Cloud Console
- Sign in with your Google account
- Click the project dropdown at the top of the page
- Either:
- Select an existing project, OR
- Click "New Project", give it a name (e.g., "Claude Workspace MCP"), and click Create
- Go to APIs & Services > Library (or use this link)
- Search for and enable each of these APIs:
| API Name | Search Term |
|---|---|
| Gmail API | gmail |
| Google Drive API | drive |
| Google Docs API | docs |
| Google Sheets API | sheets |
| Google Calendar API | calendar |
| Google Forms API | forms |
| Google Slides API | slides |
For each API:
- Click on it in the search results
- Click Enable
- Wait for it to enable, then go back to the Library
Tip: You only need to enable APIs for services you plan to use. Gmail, Drive, and Calendar are the most common.
- Go to APIs & Services > OAuth consent screen (or use this link)
- Select User Type:
- Choose Internal if you have Google Workspace and want to limit to your organization
- Choose External if using a personal Google account or want broader access
- Click Create
App Information:
- App name:
Claude Workspace Integration(or any name you prefer) - User support email: Your email address
- App logo: (optional, skip)
App domain: (optional, skip all)
Developer contact information:
- Email addresses: Your email address
- Click Save and Continue
- Click Add or Remove Scopes
- In the filter box, paste each scope below and check it:
openid
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/gmail.compose
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.labels
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/documents.readonly
https://www.googleapis.com/auth/documents
https://www.googleapis.com/auth/spreadsheets.readonly
https://www.googleapis.com/auth/spreadsheets
https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/calendar.readonly
https://www.googleapis.com/auth/calendar.events
https://www.googleapis.com/auth/forms.body
https://www.googleapis.com/auth/forms.body.readonly
https://www.googleapis.com/auth/forms.responses.readonly
https://www.googleapis.com/auth/presentations
https://www.googleapis.com/auth/presentations.readonly
- Click Update at the bottom
- Click Save and Continue
If you chose "External" user type:
- Click Add Users
- Add your email address
- Click Save and Continue
Note: While your app is in "Testing" status, only test users you add can authorize it.
- Click Back to Dashboard
- Go to APIs & Services > Credentials (or use this link)
- Click Create Credentials at the top
- Select OAuth client ID
- Application type:
Desktop app - Name:
Claude Code MCP(or any name you prefer)
- Click Create
A dialog will appear with your credentials:
- Client ID: Looks like
123456789-abcdefg.apps.googleusercontent.com - Client Secret: Looks like
GOCSPX-xxxxxxxxx
Important: Copy both values and store them securely. You'll need them when configuring Claude Code.
You can also click Download JSON to save a backup.
Now that you have your credentials, go back to SETUP.md and continue from Step 2.
When you reach the configuration step, use:
GOOGLE_OAUTH_CLIENT_ID= your Client IDGOOGLE_OAUTH_CLIENT_SECRET= your Client Secret
This usually means the OAuth consent screen isn't fully configured. Make sure you:
- Completed the OAuth consent screen setup
- Added the required scopes
- If using "External" type, added yourself as a test user
This warning is expected for apps in testing mode. Click Continue to proceed. Google only verifies apps that are published for public use.
Check that:
- You enabled all the required APIs (Step 2)
- The OAuth client type is "Desktop app"
- You're signing in with an account that has access (test user for External apps)
You can delete the OAuth client and create a new one. Go to Credentials, find your OAuth client, click the trash icon, and start Step 4 again.
- Keep your Client Secret confidential. Never commit it to public repositories or share it publicly.
- Rotate credentials if you suspect they've been exposed. Delete the old OAuth client and create a new one.
- Review authorized apps periodically at myaccount.google.com/permissions