Google Docs MCP Server
Google ドキュメント MCP サーバー
これは、Claude を介して Google ドキュメントに接続できる Model Context Protocol(MCP)サーバーです。このサーバーでは、以下のことが可能になります。
ドライブ内のすべての Google ドキュメントを一覧表示する
特定の文書の内容を読む
新しいドキュメントを作成する
既存のドキュメントを更新する
ドキュメントを検索する
ドキュメントを削除する
前提条件
Node.js v16.0.0以降
Google Docs API と Google Drive API が有効になっている Google Cloud プロジェクト
Google Cloud プロジェクトの OAuth 2.0 認証情報
Related MCP server: Ultimate Google Docs & Drive MCP Server
設定
このリポジトリをクローンし、プロジェクト ディレクトリに移動します。
git clone https://github.com/yourusername/MCP-Google-Doc.git
cd MCP-Google-Doc依存関係をインストールします:
npm installGoogle Cloud Console で OAuth 2.0 クライアント ID を作成します。
Google Cloud Consoleにアクセスします
新しいプロジェクトを作成するか、既存のプロジェクトを選択してください
Google Docs APIとGoogle Drive APIを有効にする
「APIとサービス」>「認証情報」に移動します
「認証情報を作成」>「OAuthクライアントID」をクリックします
アプリケーションの種類として「デスクトップアプリ」を選択します
JSONファイルをダウンロードし、プロジェクトディレクトリに
credentials.jsonとして保存します。
重要:
credentials.jsonファイルとtoken.jsonファイルには機密情報が含まれており、.gitignoreによってバージョン管理から除外されています。これらのファイルをリポジトリにコミットしないでください。プロジェクトをビルドします。
npm run buildサーバーを実行します。
npm startサーバーを初めて起動すると、Google 認証を求められます。画面の指示に従ってアプリケーションを承認してください。これにより、アクセストークンを保存するtoken.jsonファイルが生成されます。
セキュリティに関する考慮事項
認証情報のセキュリティ:
credentials.jsonとtoken.jsonには機密情報が含まれており、共有したりバージョン管理にコミットしたりしないでください。これらは既に.gitignoreファイルに追加されています。トークンの更新: アクセス トークンの有効期限が切れると、アプリケーションは自動的にアクセス トークンを更新します。
アクセスの取り消し: アクセスを取り消す必要がある場合は、
token.jsonファイルを削除し、 Google アカウントのセキュリティ設定に移動して、承認済みアプリケーションからアプリを削除します。
Claude for Desktop への接続
このサーバーをClaude for Desktopで使用するには:
Claude Desktop 構成ファイルを編集します。
macOSの場合:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows の場合:
%APPDATA%\Claude\claude_desktop_config.json
設定に以下を追加します。
{
"mcpServers": {
"googledocs": {
"command": "node",
"args": ["/absolute/path/to/build/server.js"]
}
}
}/absolute/path/to/build/server.js 、ビルドした server.js ファイルへの実際のパスに置き換えます。
Claude for Desktop を再起動します。
ユーザーインターフェース
Google ドキュメント MCP サーバーは、次のようなユーザーフレンドリーな会話型インターフェースを備えています。
文書情報をわかりやすく読みやすい形式で提示します
生のAPIデータではなく自然言語の応答を使用します
人間が読める形式で日付をフォーマットします
行動後の役に立つフォローアップの質問を提供する
OAuthトークンなどの機密データを決して公開しない
このインターフェース スタイルは、Notion などの他の Claude MCP 統合と一致するように設計されており、一貫した快適なユーザー エクスペリエンスを提供します。
発達
プロジェクト構造
google-docs-integration/
├── build/ # Compiled JavaScript files
├── src/ # TypeScript source code
│ └── server.ts # Main server implementation
├── .gitignore # Git ignore file
├── credentials.json # OAuth 2.0 credentials (not in version control)
├── package.json # Project dependencies and scripts
├── README.md # Project documentation
├── token.json # OAuth tokens (not in version control)
└── tsconfig.json # TypeScript configuration新機能の追加
MCP サーバーに新しい機能を追加するには:
新しい機能を実装するために
src/server.tsファイルを変更するnpm run buildでプロジェクトをビルドします。npm startを実行して変更をテストします。
利用可能なリソース
googledocs://list- ドライブ内のすべての Google ドキュメントを一覧表示しますgoogledocs://{docId}- IDで特定のドキュメントの内容を取得します
利用可能なツール
create-doc- 指定されたタイトルとオプションのコンテンツで新しい Google ドキュメントを作成しますupdate-doc- 既存の Google ドキュメントを新しいコンテンツで更新します(追加または置換)insert-text- Notionや他の統合なしでドキュメントに直接テキストを挿入しますsearch-docs- 特定のテキストを含む Google ドキュメントを検索しますdelete-doc- IDでGoogleドキュメントを削除します
利用可能なプロンプト
create-doc-template- 指定されたトピックと文章スタイルに基づいて新しいドキュメントを作成するのに役立ちますanalyze-doc- 文書の内容を分析し、要約を提供します
使用例
サーバーが接続されたら、Claude で使用できるプロンプトの例を次に示します。
「すべての Google ドキュメントのリストを表示」
「『会議メモ』というタイトルで、『話し合うトピック: ...』という内容の新しい Google ドキュメントを作成します。」
「ID '1abc123def456' のドキュメントを更新して、最後にこのセクションを追加します: ...」
「Google ドキュメントで「プロジェクト提案」を含むドキュメントを検索してください」
「ID '1abc123def456' の Google ドキュメントを削除します」
「気候変動に関する正式な文書を作成する」
「ID '1abc123def456' のドキュメントの内容を分析する」
トラブルシューティング
認証の問題が発生した場合:
プロジェクトディレクトリ内の
token.jsonファイルを削除します。サーバーを再度実行して、新しい認証フローをトリガーします。
Google Docs API で問題が発生した場合:
Google Cloud Console で API が有効になっていることを確認してください
OAuth認証情報に正しいスコープがあることを確認してください
貢献
リポジトリをフォークする
機能ブランチを作成します:
git checkout -b feature/your-feature-name変更をコミットします:
git commit -am 'Add some feature'ブランチにプッシュ:
git push origin feature/your-feature-nameプルリクエストを送信する
ライセンス
マサチューセッツ工科大学
環境変数
次のキーを使用して、プロジェクト ルートに.envファイルを作成します (またはシェルで変数をエクスポートします)。
# OAuth 2.0 client credentials – **JSON string** of the credentials file
GOOGLE_DOCS_CREDENTIALS_JSON={...}
# OAuth token – **JSON string** returned by the OAuth consent flow
GOOGLE_DOCS_TOKEN_JSON={...}これらの変数が設定されている場合、サーバーはディスクからcredentials.jsonまたはtoken.jsonを読み取ろうとしません。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-quality-maintenanceConnects AI assistants like Claude to Google Drive, enabling them to browse, read, search, create, and edit files and folders using Google's official API with secure authentication.
- Alicense-qualityDmaintenanceConnects Claude Desktop to Google Docs and Google Drive, enabling comprehensive document reading, writing, formatting, structuring, and complete Drive file management including shared drives support through OAuth 2.0 authentication.82MIT
- Flicense-quality-maintenanceEnables Claude to interact with Google Docs to list, read, create, search, and update documents in a user's Google Drive. It provides a suite of tools and prompts for document management and content analysis using OAuth 2.0 authentication.1,396
- Flicense-qualityDmaintenanceEnables managing Google Drive files, Docs, and Sheets through natural language via Claude Code, with tools for listing, searching, editing, and formatting documents and spreadsheets.
Related MCP Connectors
Connect Claude to Fathom meeting recordings, transcripts, and summaries
Connect your team's living knowledge base — docs, data, issues, CRM — to Claude and ChatGPT.
Google Docs MCP Pack — read, create, and edit Google Docs via OAuth.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Gurgeron/MCPtRY'
If you have feedback or need assistance with the MCP directory API, please join our Discord server