MCP server for Google Docs, Sheets & Drive with full formatting support. Fixed OAuth flow for modern Google API.
npm install @suncreation/mcp-google-docsMCP server for Google Docs, Sheets & Drive with full formatting support.
> Fork of a-bonus/google-docs-mcp with fixed OAuth flow (replaced deprecated OOB with localhost redirect).
``bash`
npx @suncreation/mcp-google-docs
`json`
{
"mcpServers": {
"google-docs": {
"command": "npx",
"args": ["-y", "@suncreation/mcp-google-docs"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"TOKEN_PATH": "/path/to/token.json"
}
}
}
}
`json`
{
"mcpServers": {
"google-docs": {
"command": "npx",
"args": ["-y", "@suncreation/mcp-google-docs"],
"env": {
"CREDENTIALS_PATH": "/path/to/credentials.json",
"TOKEN_PATH": "/path/to/token.json"
}
}
}
}
On first run, a browser window will open for Google authentication. After approval, token.json is saved for future use.
| Variable | Description |
|----------|-------------|
| GOOGLE_CLIENT_ID | OAuth Client ID |GOOGLE_CLIENT_SECRET
| | OAuth Client Secret |CREDENTIALS_PATH
| | Path to credentials.json (alternative to above) |TOKEN_PATH
| | Path to save/load token.json |SERVICE_ACCOUNT_PATH
| | Path to service account key (for enterprise) |GOOGLE_IMPERSONATE_USER
| | Email to impersonate (with service account) |
1. Go to Google Cloud Console
2. Create a project
3. Enable APIs: Google Docs API, Google Sheets API, Google Drive API
4. Create OAuth 2.0 credentials (Desktop app)
5. Important: Add http://localhost:3000/oauth2callback` to Authorized redirect URIs
6. Download credentials.json or copy Client ID/Secret
MIT - Based on a-bonus/google-docs-mcp