google-workspace-mcp
MCP server connecting Claude to Google Sheets, Docs, and Drive, enabling cell-level editing, formatting, chart creation, and file management through natural language.
README
google-workspace-mcp
MCP server kết nối Claude với Google Sheets, Google Docs và Google Drive.
Khác với connector Google Drive mặc định (chỉ đọc/ghi file), server này đọc & ghi được từng ô trong Google Sheets: viết công thức, định dạng, chèn/xoá hàng cột, tạo dropdown, biểu đồ, conditional format…
Chạy hoàn toàn trên máy bạn, bằng tài khoản Google Cloud của chính bạn. Không có máy chủ trung gian, dữ liệu không đi qua bên thứ ba.
Cài đặt
Cách 1 — Claude Desktop (dễ nhất)
Tải file .mcpb ở mục Releases → double-click → Install.
Rồi mở chat gõ "Hướng dẫn mình kết nối Google", Claude sẽ dẫn từng bước.
Cách 2 — Chạy từ mã nguồn
git clone https://github.com/<user>/google-workspace-mcp.git
cd google-workspace-mcp
npm install
Tạo OAuth client của riêng bạn (miễn phí, ~10 phút, làm 1 lần):
- Vào Google Cloud Console → tạo project mới.
- APIs & Services → Library → Enable 3 API: Google Sheets API, Google Docs API, Google Drive API.
- APIs & Services → OAuth consent screen → chọn External → điền tên app → ở mục Audience, thêm email của bạn vào Test users.
- APIs & Services → Credentials → Create Credentials → OAuth client ID → chọn Desktop app → Create → Download JSON.
- Đổi tên file vừa tải thành
credentials.json, đặt vào thư mục gốc của project (xem mẫu ởcredentials.example.json).
Đăng nhập:
npm run auth
Trình duyệt mở ra → đăng nhập tài khoản Google → token lưu vào token.json (tự refresh, không cần làm lại).
Google hiện "Google hasn't verified this app"? Bình thường — app này do chính bạn vừa tạo. Bấm Advanced → Go to … (unsafe) → Continue.
Khai báo server trong file cấu hình MCP của Claude:
{
"mcpServers": {
"google-workspace": {
"command": "node",
"args": ["/đường/dẫn/tới/google-workspace-mcp/index.js"]
}
}
}
Bảo mật
credentials.jsonvàtoken.jsonchứa bí mật của bạn — đã được.gitignore, đừng bao giờ commit hay chia sẻ.token.jsoncho phép truy cập Google account của bạn mà không cần mật khẩu. Coi nó như mật khẩu.- Mỗi người dùng nên tạo OAuth client riêng, không dùng chung.
Tools
Drive (10)
| Tool | Chức năng |
|---|---|
drive_search |
Tìm file/thư mục theo tên → lấy id |
drive_list_folder |
Liệt kê nội dung thư mục |
drive_create_folder |
Tạo thư mục |
drive_move / drive_copy / drive_rename |
Di chuyển / nhân bản / đổi tên |
drive_trash |
Chuyển vào thùng rác (khôi phục được, không xoá vĩnh viễn) |
drive_export |
Tải về máy: Docs/Sheets → pdf/docx/xlsx/csv/pptx/txt/html |
drive_upload |
Upload file lên Drive, convert xlsx/csv → Sheets, docx → Docs |
drive_share |
Chia sẻ cho email hoặc bật link công khai |
Sheets (18)
| Tool | Chức năng |
|---|---|
sheets_get_metadata |
Danh sách tab, kích thước, freeze |
sheets_read |
Đọc 1 range hoặc nhiều ranges, tuỳ chọn đọc công thức |
sheets_write / sheets_append / sheets_clear |
Ghi / thêm hàng / xoá giá trị |
sheets_format |
Đậm/nghiêng, font, cỡ chữ, màu chữ/nền, căn lề, định dạng số, wrap, border, freeze, độ rộng cột |
sheets_manage_tab |
Đổi tên / nhân bản / ẩn-hiện / màu tab / xoá tab |
sheets_insert_delete_rows_columns |
Chèn/xoá hàng, cột |
sheets_merge_cells |
Gộp/tách ô |
sheets_sort_range |
Sắp xếp theo cột |
sheets_find_replace |
Tìm & thay thế |
sheets_conditional_format |
Tô màu theo điều kiện (>, <, chứa chữ, công thức...) |
sheets_dropdown |
Tạo dropdown chọn giá trị |
sheets_add_chart |
Vẽ biểu đồ COLUMN/BAR/LINE/AREA/PIE |
sheets_copy_tab_to |
Copy tab sang spreadsheet khác |
sheets_create / sheets_add_tab |
Tạo file / tab mới |
sheets_batch_update |
Raw API cho nhu cầu nâng cao (pivot, protected range...) |
Docs (8)
| Tool | Chức năng |
|---|---|
docs_read |
Đọc TẤT CẢ tab (tabId + tiêu đề + nội dung; heading → #, bullet → -) |
docs_create / docs_append |
Tạo / thêm nội dung markdown (# heading, đậm, nghiêng, - bullet, 1. số), ghi được vào từng tab |
docs_replace_text |
Tìm & thay thế toàn bộ hoặc trong 1 tab (điền template) |
docs_format_text |
Định dạng chuỗi tìm thấy: đậm, nghiêng, gạch chân, cỡ chữ, font, màu, highlight, gắn link |
docs_insert_table |
Chèn bảng kèm dữ liệu |
docs_insert_image |
Chèn ảnh từ URL |
docs_batch_update |
Raw API cho nhu cầu nâng cao (header/footer, page break...) |
Cấu hình (env, tuỳ chọn)
GOOGLE_OAUTH_CREDENTIALS— đường dẫn file client secret (mặc định:./credentials.json, copy từvivian/credentials.json)GOOGLE_OAUTH_TOKEN— đường dẫn file token (mặc định:./token.json)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.