How piotr-agier/google-drive-mcp works
Google Drive MCP Server exposes Drive, Docs, Sheets, Slides, Calendar, and account-management operations to MCP clients. The principal flow is a client request entering the MCP server, being dispatched to a Workspace tool, and reaching Google APIs; authentication supplies the identity and credentials used for calls. The README documents local OAuth, service accounts, external tokens, team mode, and an optional resource interface. Some subsystem links rely on the SOURCE INDEX or README rather than inspected implementation excerpts.
Main entry points: index.ts MCP server · auth.ts Auth orchestration · runtime.ts Team runtime · drive.ts Drive operations
Components 18
MCP runtime
- MCP server
src/index.ts - Drive resources
src/index.ts
Workspace tools
- Drive operations
src/tools/drive.ts - Docs editing
src/tools/docs.ts - Sheets operations
src/tools/sheets.ts - Slides authoring
src/tools/slides.ts - Calendar events
src/tools/calendar.ts
Identity and access
- Auth orchestration
src/auth.ts - Local OAuth flow
src/auth/server.ts - Account resolution
src/auth/accountResolver.ts - Account storage
src/auth/accountStore.ts - Account clients
src/auth/accountClientFactory.ts
Team authentication
- Team runtime
src/auth/team/runtime.ts - Team identity provider
src/auth/team/provider.ts - Team configuration
src/auth/team/config.ts - Team token store
src/auth/team/fileStore.ts
Other components
- MCP client
- Google APIs
Connections 21
- MCP client → MCP server: sends requests
README.md - MCP server → Drive operations: dispatches tools
src/index.ts - MCP server → Docs editing: dispatches tools
src/index.ts - MCP server → Sheets operations: dispatches tools
src/index.ts - MCP server → Slides authoring: dispatches tools
src/index.ts - MCP server → Calendar events: dispatches tools
src/index.ts - MCP server → Auth orchestration: initializes identity
src/index.ts - MCP server → Drive resources: offers interface
README.md - Drive operations → Google APIs: calls APIs
src/tools/drive.ts - Docs editing → Google APIs: calls APIs
src/tools/docs.ts - Sheets operations → Google APIs: calls APIs
- Slides authoring → Google APIs: calls APIs
- Calendar events → Google APIs: calls APIs
- Auth orchestration → Local OAuth flow: uses OAuth flow
src/auth.ts - Auth orchestration → Account resolution: resolves accounts
src/auth.ts - Auth orchestration → Account storage: loads accounts
src/auth.ts - Auth orchestration → Account clients: creates clients
src/auth.ts - MCP server → Team runtime: configures team mode
src/index.ts - Team runtime → Team configuration: loads settings
src/auth/team/runtime.ts - Team runtime → Team identity provider: uses provider
src/auth/team/runtime.ts - Team runtime → Team token store: uses token store
src/auth/team/runtime.ts