Google Docs
A Model Context Protocol (MCP) server for integrating Google Docs with AI clients.
Google Docs MCP Server (Next.js)
A remote Model Context Protocol (MCP) server that provides Google Docs integration for Claude Desktop, built with Next.js and deployed on Vercel.
Features
- Remote MCP Server: Deployed on Vercel with SSE transport
- Google OAuth: Secure authentication with Google Docs and Drive permissions
- Web Dashboard: User-friendly interface for managing API keys
- Multi-user: Support for multiple users with isolated access
- API Key Management: Secure token-based authentication for MCP clients
Architecture
User Browser → Next.js App → Google OAuth → Database (User/Tokens)
Claude Desktop → MCP SSE Transport → API Key Auth → Google APIs
Setup
1. Google Cloud Console Setup
- Create a new project in Google Cloud Console
- Enable Google Docs API and Google Drive API
- Create OAuth 2.0 credentials:
- Application type: Web application
- Authorized redirect URIs:
https://your-app.vercel.app/api/auth/callback/google
- Copy Client ID and Client Secret
2. Database Setup
Create a PostgreSQL database (recommended: Neon or Supabase)
3. Redis Setup
Create a Redis instance (required for Vercel MCP adapter). Recommended: Upstash
4. Deploy to Vercel
- Fork this repository
- Import to Vercel
- Add environment variables:
NEXTAUTH_SECRET=your-random-secret NEXTAUTH_URL=https://your-app.vercel.app GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret DATABASE_URL=your-postgresql-url REDIS_URL=your-redis-url - Deploy
5. Initialize Database
After deployment, run database migrations:
pnpm db:push
Usage
Simple Setup (OAuth-on-Demand)
- Add MCP server to Claude Desktop (no setup required):
claude mcp add --transport sse google-docs https://your-app.vercel.app/sse
Or manually add to claude_desktop_config.json:
{
"mcpServers": {
"google-docs": {
"command": "claude",
"args": ["mcp", "connect", "sse", "https://your-app.vercel.app/sse"]
}
}
}
-
First-time authorization:
- In Claude Desktop, run: "Use the authorize_google tool"
- Claude will provide an authorization link
- Click the link → browser opens → sign in with Google
- After authorization, all Google Docs tools work automatically
-
Available Tools:
authorize_google- Authorize Google Docs access (run this first)read_document- Read content from Google Docscreate_document- Create new Google Docsupdate_document- Update document content with batch operationsappend_text- Append text to documentslist_documents- List your Google Docs
Alternative: API Key Setup (Advanced)
For programmatic access or multiple clients:
-
Web Setup:
- Visit your deployed app:
https://your-app.vercel.app - Sign in with Google
- Create an API key
- Visit your deployed app:
-
Claude Desktop Setup:
claude mcp add --transport sse google-docs \\
https://your-app.vercel.app/sse \\
--header "X-API-Key: your-api-key"
Development
Local Setup
- Clone the repository
- Install dependencies:
pnpm install - Copy
.env.exampleto.envand fill in values - Run database migrations:
pnpm db:push - Start development server:
pnpm dev
Commands
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm db:generate- Generate database migrationspnpm db:push- Push schema to databasepnpm db:studio- Open Drizzle Studio
Security
- API keys are hashed before storage
- Google refresh tokens are encrypted in database
- User isolation prevents cross-user access
- HTTPS enforced for OAuth callbacks
Troubleshooting
Common Issues
- OAuth Error: Check redirect URI matches exactly
- Database Connection: Verify DATABASE_URL format
- API Key Invalid: Ensure X-API-Key header is set correctly
- Redis Connection: Verify REDIS_URL for SSE transport
Logs
Check Vercel function logs for detailed error information.
Contributing
- Fork the repository
- Create a feature branch
- Make changes
- Test locally
- Submit a pull request
License
MIT License - see LICENSE file for details.
Related Servers
Lunch Roulette MCP Server
Manages and randomly selects from a list of lunch restaurants, storing choices and visit statistics locally.
OneNote MCP
An MCP server for Microsoft OneNote that supports personal notebooks and caches credentials for authentication.
MCP-MD-PDF: Markdown to Word/PDF Converter
A simple, reliable Model Context Protocol (MCP) server that converts Markdown files into professional Word (.docx) and PDF documents — with full support for .dotx templates.
notebooklm MCP
Chat with Google NotebookLM via MCP or HTTP REST API for zero-hallucination answers from your docs. Perfect for n8n workflows and automation.
Rebrandly MCP Tool (Go)
Generate short URLs using the Rebrandly API.
Obsidian
Interact with your Obsidian vault using the Local REST API plugin, enabling LLMs to access and manage your notes.
Google Tag Manager
Manage Google Tag Manager accounts, containers, and tags via its API, with built-in Google OAuth.
Yandex Tracker
Interact with Yandex Tracker APIs for issue management and search.
Roam Research MCP Server
Access and manage your Roam Research graph via its API.
GitBook
Access and manage GitBook spaces and content using the GitBook API.