OM

ophydami/mcp-google-doc

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

48 stars 43 forks Качество 64 Тренд 17

ophydami/mcp-google-doc - кандидат на сервер MCP, импортированный из https://github.com/ophydami/mcp-google-doc.

Обзор

ophydami/mcp-google-doc - кандидат на сервер MCP, импортированный из https://github.com/ophydami/mcp-google-doc.

Обзор (машинный перевод)

Это сервер Model Context Protocol (MCP), который позволяет подключаться к Google Docs через Claude. С помощью этого сервера вы можете:

Перечислите все документы Google на вашем диске Читайте содержание конкретных документов Создание новых документов Обновление существующих документов

  • Поиск документов
  • Удалить документы

Предпосылки

Node.js v16.0.0 или более поздняя версия Google Cloud Project с поддержкой Google Docs API и Google Drive API Учетные данные OAuth 2.0 для вашего проекта Google Cloud

Настройка

  1. Клонируйте это хранилище и перейдите в каталог проекта:

  2. Установить зависимости:

  3. Создайте идентификатор клиента OAuth 2.0 в Google Cloud Console:

Перейдите в Google Cloud Console Создать новый проект или выбрать существующий Включите Google Docs API и Google Drive API Перейдите в раздел «APIs & Services» > «Удостоверения»

  • Нажмите «Создать учетные данные» > «Идентификатор клиента OAuth»
  • Выберите «Настольное приложение» для типа приложения Загрузите файл JSON и сохраните его как credentials.json в каталоге проекта.

Важно: файлы credentials.json и token.json содержат конфиденциальную информацию и исключаются из контроля версий через .gitignore.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Google Docs MCP Server

This is a Model Context Protocol (MCP) server that allows you to connect to Google Docs through Claude. With this server, you can:

  • List all Google Docs in your Drive
  • Read the content of specific documents
  • Create new documents
  • Update existing documents
  • Search for documents
  • Delete documents

Prerequisites

  • Node.js v16.0.0 or later
  • Google Cloud project with the Google Docs API and Google Drive API enabled
  • OAuth 2.0 credentials for your Google Cloud project

Setup

  1. Clone this repository and navigate to the project directory:
git clone https://github.com/yourusername/MCP-Google-Doc.git
cd MCP-Google-Doc
  1. Install dependencies:
npm install
  1. Create an OAuth 2.0 client ID in the Google Cloud Console:

    • Go to the Google Cloud Console
    • Create a new project or select an existing one
    • Enable the Google Docs API and Google Drive API
    • Go to “APIs & Services” > “Credentials”
    • Click “Create Credentials” > “OAuth client ID”
    • Select “Desktop app” for the application type
    • Download the JSON file and save it as credentials.json in your project directory

    Important: The credentials.json and token.json files contain sensitive information and are excluded from version control via .gitignore. Never commit these files to your repository.

  2. Build the project:

npm run build
  1. Run the server:
npm start

The first time you run the server, it will prompt you to authenticate with Google. Follow the on-screen instructions to authorize the application. This will generate a token.json file that stores your access tokens.

Security Considerations

  • Credential Security: Both credentials.json and token.json contain sensitive information and should never be shared or committed to version control. They are already added to the .gitignore file.
  • Token Refresh: The application automatically refreshes the access token when it expires.
  • Revoking Access: If you need to revoke access, delete the token.json file and go to your Google Account Security settings to remove the app from your authorized applications.

Connecting to Claude for Desktop

To use this server with Claude for Desktop:

  1. Edit your Claude Desktop configuration file:

    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • On Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the following to your configuration:

{
  "mcpServers": {
    "googledocs": {
      "command": "node",
      "args": ["/absolute/path/to/build/server.js"]
    }
  }
}

Replace /absolute/path/to/build/server.js with the actual path to your built server.js file.

Connecting to Claude Code

claude mcp add --transport stdio google-docs node /absolute/path/to/build/server.js
  1. Restart Claude for Desktop.
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "googledocs": { "command": "node", "args": ["/absolute/path/to/build/server.js"] } } }