maru-sheets-mcp
Allows AI agents to read, write, format, and manage Google Sheets via the Google Sheets API v4. Capabilities include listing sheets, reading and writing ranges, setting formulas, adding/deleting/renaming sheets, freezing rows, formatting cells (background, font, bold), setting column widths, merging cells, borders, number formats, data validation, conditional formatting, text wrap/alignment, protected ranges, and batch updates.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@maru-sheets-mcpRead range A1:B10 from my spreadsheet."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
maru-sheets-mcp
MCP server cho phép AI agent đọc/ghi/format Google Sheets qua API v4.
👩💼 DÀNH CHO NGƯỜI DÙNG
Bạn không cần biết code. Chỉ cần mở Antigravity 2.0 (hoặc AI coding agent khác), paste đoạn prompt bên dưới, rồi làm theo khi AI hỏi.
Paste prompt này vào Antigravity 2.0:
Tôi cần bạn cài đặt MCP server "maru-sheets-mcp" để tôi có thể đọc và ghi Google Sheets từ đây.
Đọc file README.md trong repo https://github.com/leaddaruma-web/maru-sheets-mcp — phần "DÀNH CHO AI CODING AGENT" có hướng dẫn chi tiết từng bước.
Làm hết tất cả các bước giúp tôi — bao gồm cả kiểm tra/cài Node.js nếu máy chưa có.
Hướng dẫn tôi tạo credentials.json trên Google Cloud (theo Bước 2 trong README).
Tôi chỉ cần click "Cho phép" khi trình duyệt mở ra hỏi quyền Gmail.
Bắt đầu.Sau đó AI sẽ tự làm mọi thứ. Bạn chỉ cần:
Click "Cho phép" khi trình duyệt mở ra hỏi quyền Gmail (1 lần duy nhất)
Restart Antigravity sau khi AI báo cấu hình xong (nếu AI yêu cầu)
Sau khi cài xong, bạn có thể bảo AI:
"Đọc dữ liệu từ Sheet [dán link Sheet] tab Nhật ký, cột A đến K"
"Ghi danh sách sau vào Sheet [dán link Sheet] bắt đầu từ ô A2: ..."
"Tạo tab mới tên 'Tháng 7' trong Sheet [dán link Sheet]"
"Format header: nền xanh đậm, chữ trắng, in đậm"
"Set công thức tính tổng cột B vào ô B101"
Lưu ý
Sheet phải được share cho Gmail bạn — nếu AI báo "insufficient permission", mở Sheet đó → click Share → thêm Gmail của bạn (quyền Editor)
Chỉ cần cài 1 lần — những lần sau mở Antigravity là dùng được luôn
Related MCP server: mcp-google-sheets
🤖 DÀNH CHO AI CODING AGENT
Phần này dành cho AI agent đọc và tự thực hiện. Người dùng không cần đọc phần này.
Bước 0 — Kiểm tra và cài Node.js (nếu chưa có)
node --versionNếu lệnh trên báo lỗi hoặc version < 18, cài Node.js:
Windows: tải và chạy installer từ https://nodejs.org/en/download/ (chọn bản LTS, chạy file .msi, chọn tất cả mặc định). Sau khi cài xong cần mở terminal mới để
nodecó trong PATH.macOS:
brew install nodehoặc tải installer từ https://nodejs.org/Linux:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs
Kiểm tra lại sau khi cài:
node --version # phải >= 18
npm --version # phải cóBước 1 — Clone repo
git clone https://github.com/leaddaruma-web/maru-sheets-mcp.git
cd maru-sheets-mcpNếu máy chưa có git:
Windows: tải từ https://git-scm.com/download/win, cài mặc định
macOS:
xcode-select --installLinux:
sudo apt-get install git
Bước 2 — Tạo file credentials.json
File này chứa thông tin OAuth client — không có trong repo (bảo mật). Người dùng tự tạo trên Google Cloud (miễn phí).
BÁO CHO NGƯỜI DÙNG: "Bạn cần tạo credentials trên Google Cloud — miễn phí, chỉ mất 3 phút. Tôi sẽ hướng dẫn từng bước, bạn chỉ cần click theo."
Hướng dẫn người dùng mở trình duyệt và làm theo:
Bước 2.1. Tạo Google Cloud project:
Đăng nhập bằng Gmail sẽ dùng để đọc/ghi Sheet
Click menu dropdown project ở thanh trên (cạnh logo Google Cloud) → "New Project"
Đặt tên project:
maru-sheets-mcp→ click "Create"Đợi vài giây, chọn project vừa tạo từ dropdown
Bước 2.2. Bật Google Sheets API:
Mở https://console.cloud.google.com/apis/library/sheets.googleapis.com
Click "Enable" (Bật)
Mở thêm https://console.cloud.google.com/apis/library/drive.googleapis.com
Click "Enable" (Bật)
Bước 2.3. Cấu hình OAuth consent screen:
Mở https://console.cloud.google.com/apis/credentials/consent
Chọn "External" → click "Create"
Điền:
App name:
maru-sheets-mcpUser support email: chọn Gmail của bạn
Developer contact: nhập Gmail của bạn
Click "Save and Continue" qua các bước còn lại (Scopes, Test users) → click "Back to Dashboard"
Ở trang Consent screen, click "Publish App" nếu muốn dùng lâu dài (nếu chỉ test thì bỏ qua)
Bước 2.4. Tạo OAuth Client ID:
Click "+ Create Credentials" → "OAuth client ID"
Application type: chọn "Desktop app"
Name:
maru-sheets-mcpClick "Create"
MÀN HÌNH HIỆN RA CLIENT ID VÀ CLIENT SECRET — copy cả 2 giá trị này
Bước 2.5. Tạo file credentials.json:
Tạo file credentials.json ở thư mục gốc repo (maru-sheets-mcp/credentials.json) với nội dung:
{
"installed": {
"client_id": "THAY_CLIENT_ID_VAO_DAY",
"project_id": "maru-sheets-mcp",
"client_secret": "THAY_CLIENT_SECRET_VAO_DAY",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"redirect_uris": ["http://localhost:4571/oauth2callback"]
}
}Thay THAY_CLIENT_ID_VAO_DAY và THAY_CLIENT_SECRET_VAO_DAY bằng giá trị vừa copy ở B4.
BÁO CHO NGƯỜI DÙNG: "Xong bước tạo credentials! Tiếp tục cài đặt nhé."
Bước 3 — Cài dependencies
npm installBước 4 — Xác thực Gmail (chỉ 1 lần)
npm run authLệnh này sẽ:
Mở trình duyệt tại URL xác thực Google
Người dùng đăng nhập Gmail và click "Cho phép" / "Allow"
Trình duyệt chuyển hướng về localhost → file
token.jsonđược tạo tự động
BÁO CHO NGƯỜI DÙNG: "Trình duyệt sẽ mở ra — bạn đăng nhập Gmail rồi click Cho phép nhé."
Đợi cho đến khi terminal hiện ✓ Đã lưu token.json rồi tiếp tục.
Bước 5 — Cấu hình MCP server
Ghi nhớ đường dẫn tuyệt đối tới thư mục maru-sheets-mcp vừa clone (ví dụ D:\Projects\maru-sheets-mcp hoặc /Users/ten/maru-sheets-mcp).
Thêm vào file cấu hình MCP của tool đang dùng:
Claude Code — file claude_desktop_config.json hoặc .claude.json:
{
"mcpServers": {
"maru-sheets": {
"command": "node",
"args": ["src/sheets-server.js"],
"cwd": "<đường-dẫn-tuyệt-đối-tới-thư-mục-maru-sheets-mcp>"
}
}
}Antigravity 2.0 — vào Settings → MCP Servers → thêm server mới:
Name:
maru-sheetsCommand:
nodeArguments:
src/sheets-server.jsWorking directory:
<đường-dẫn-tuyệt-đối-tới-thư-mục-maru-sheets-mcp>
Tool khác — tương tự, trỏ command node, args src/sheets-server.js, cwd là thư mục chứa repo.
Bước 6 — Kiểm tra
Sau khi cấu hình, restart tool (hoặc reload MCP) rồi thử:
Gọi tool
list_sheetsvớispreadsheetIdbất kỳ mà Gmail đã auth có quyền truy cậpNếu trả về danh sách tab → thành công
BÁO CHO NGƯỜI DÙNG: "Đã cài xong! Bạn có thể restart Antigravity rồi thử bảo tôi đọc/ghi Sheet."
Các tool có sẵn sau khi cài
Tool | Mô tả | Tham số chính |
| Liệt kê các tab | spreadsheetId |
| Đọc giá trị 1 vùng (A1 notation) | spreadsheetId, range |
| Ghi giá trị 2D vào 1 vùng | spreadsheetId, range, values |
| Set công thức vào 1 ô | spreadsheetId, cell, formula |
| Thêm tab mới | spreadsheetId, title |
| Xoá tab | spreadsheetId, sheetTitle |
| Đổi tên tab | spreadsheetId, oldTitle, newTitle |
| Đóng băng N hàng đầu | spreadsheetId, sheetTitle, rows |
| Tô nền + chữ + bold | spreadsheetId, sheetTitle, startRow, endRow, startCol, endCol, bgHex, fontHex, bold |
| Đặt chiều rộng cột | spreadsheetId, sheetTitle, startCol, endCol, width |
| Merge ô | spreadsheetId, sheetTitle, startRow, endRow, startCol, endCol |
| Đặt border | spreadsheetId, sheetTitle, startRow, endRow, startCol, endCol |
| Định dạng số/ngày | spreadsheetId, sheetTitle, startRow, endRow, startCol, endCol, pattern |
| Dropdown validation | spreadsheetId, sheetTitle, startRow, endRow, startCol, endCol, values |
| Conditional formatting | spreadsheetId, sheetTitle, range, type, values, bgHex |
| Wrap text + căn chỉnh | spreadsheetId, sheetTitle, startRow, endRow, startCol, endCol |
| Bảo vệ vùng | spreadsheetId, sheetTitle, startRow, endRow, startCol, endCol |
| Áp nhiều request 1 lúc (batchUpdate) | spreadsheetId, requests |
Lưu ý kỹ thuật
Công thức Google Sheets locale Việt Nam dùng dấu
;thay,— ví dụ:=IF(A1>5;"Đạt";"Chưa đạt")spreadsheetIdlấy từ URL:https://docs.google.com/spreadsheets/d/{spreadsheetId}/editMuốn truy cập Sheet của người khác → người đó phải share (Viewer/Editor) cho Gmail đã auth
set_formatdùng gridRange 0-based (hàng/cột bắt đầu từ 0)
Xử lý lỗi thường gặp
Lỗi | Nguyên nhân | Cách sửa |
| Chưa chạy auth |
|
| Sheet chưa share cho Gmail | Mở Sheet → Share → thêm Gmail |
| Tên tab sai | Kiểm tra tên chính xác (có dấu, khoảng trắng) |
| Chưa cài Node.js | Cài Node.js theo Bước 0 |
| Chưa cài Git | Cài Git theo Bước 1 |
| Token hết hạn | Xoá |
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.
Latest Blog Posts
- 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/leaddaruma-web/maru-sheets-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server