gsheetmcp

gsheetmcp

MCP server to read public Google Sheets data via gviz endpoint, no authentication needed. Supports column filtering and returns structured JSON.

Category
Visit Server

README

gsheetmcp — MCP server đọc Google Sheet công khai

MCP server generic để đọc dữ liệu từ Google Sheet public qua endpoint gviz — không cần API key, OAuth, hay service account.

Cách chạy

Mặc định dùng stdio (cho Claude Desktop / MCP Hub qua uvx):

uvx gsheetmcp

Hoặc chạy local (từ source):

cd sheet-mcp-server
uv run server.py

SSE mode

Set env MCP_TRANSPORT=sse để dùng HTTP SSE transport:

MCP_TRANSPORT=sse uv run server.py

Server expose SSE endpoint /sse + /messages trên 0.0.0.0:8000. Cấu hình qua env var:

Env Default Mô tả
MCP_TRANSPORT stdio stdio hoặc sse
MCP_HOST 0.0.0.0 Host (SSE mode)
MCP_PORT 8000 Port (SSE mode)

Tool: get_sheet_data

Input

Param Type Required Description
sheet_url string yes URL đầy đủ của Google Sheet (có hoặc không gid)
filter_column string no Tên cột cần lọc (yêu cầu filter_value)
filter_value string no Giá trị để lọc (so khớp in, case-insensitive)

Output

{
  "sheet_id": "1p67eA4NGs389n-fuqHOmULhE5sfgRtFAulCHR8xcfGE",
  "tab_gid": "1253624571",
  "total_matched": 15,
  "filtered": true,
  "columns": ["Mã căn", "Tầng", "Diện tích", "Giá"],
  "items": [
    { "Mã căn": "A-1201", "Tầng": "12", "Diện tích": "85", "Giá": "2.5 tỷ" }
  ]
}

Error responses

Case Response
URL sai định dạng {"error": "invalid_sheet_url"}
Sheet không public {"error": "sheet_not_public"}
filter_column không tồn tại trả full data + "warning": "filter_column_not_found"
Tab rỗng {"items": [], "total_matched": 0}
Timeout / network lỗi {"error": "fetch_failed", "detail": "..."}

Ví dụ thực tế

Sheet 1: FAQ (2 cột: Title, Description)

URL: https://docs.google.com/spreadsheets/d/1zwblTR5DWzgOiVxsDYJJkP5Gcmi4OGiCtldI0nyxZGo/edit?gid=0

Request:

{
  "sheet_url": "https://docs.google.com/spreadsheets/d/1zwblTR5DWzgOiVxsDYJJkP5Gcmi4OGiCtldI0nyxZGo/edit?gid=0",
  "filter_column": "Title",
  "filter_value": "UI"
}

Response:

{
  "sheet_id": "1zwblTR5DWzgOiVxsDYJJkP5Gcmi4OGiCtldI0nyxZGo",
  "tab_gid": "0",
  "total_matched": 3,
  "filtered": true,
  "columns": ["Title", "Description"],
  "items": [
    {
      "Title": "What's the difference between UI Kits and libraries",
      "Description": "UI Kits are copy-and-pastable components..."
    }
  ]
}

Sheet 2: tồn kho sản phẩm (khác cấu trúc hoàn toàn)

Với sheet có cấu trúc khác, columns và items tự động đổi theo — không có tên cột nào bị "dính" từ sheet trước.

Test cases

  1. Sheet public + filter hợp lệ → filtered: true, đúng subset
  2. Sheet public, không filter → filtered: false, toàn bộ rows
  3. filter_column sai → full data + warning: filter_column_not_found
  4. Sheet private → error: sheet_not_public
  5. URL sai → error: invalid_sheet_url
  6. 2 sheet khác cấu trúc → columns/items tự động đổi, không dính

Cấu hình MCP client

stdio (khuyên dùng — mặc định)

{
  "mcpServers": {
    "gsheetmcp": {
      "command": "uvx",
      "args": ["git+https://github.com/kientv/gsheetmcp.git"]
    }
  }
}

Hoặc nếu đã clone repo local:

{
  "mcpServers": {
    "gsheetmcp": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/gsheetmcp", "server.py"]
    }
  }
}

SSE (remote server)

Khi server chạy ở chế độ SSE, client cấu hình URL endpoint:

{
  "mcpServers": {
    "gsheetmcp": {
      "transport": "sse",
      "url": "http://host:8000/sse"
    }
  }
}

Giới hạn

  • gviz là internal endpoint của Google Sheets, không phải REST API chính thức — không có SLA.
  • Chỉ đọc được sheet ở chế độ public (Anyone with the link can view).
  • Mỗi lần gọi chỉ đọc được 1 tab theo gid.
  • Không support ghi, xoá, hay chỉnh sửa dữ liệu.
  • Dung lượng sheet lớn có thể bị timeout (mặc định 30s).

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured