mcp-google-forms

mcp-google-forms

An MCP server for the Google Forms API that enables creating and editing forms, publishing them, reading responses, and setting up push notifications from AI clients using natural language.

Category
访问服务器

README

Google Forms MCP

npm CI Glama License: MIT

MCP server for the Google Forms API: create forms, add and edit questions, publish, read responses and set up push notifications for new submissions — from Claude, Cursor, Codex and other AI clients, in natural language.

Ask your assistant to "make a customer-feedback survey with a rating question and publish it", "show me yesterday's responses", or "close the form for responses" — it drives the Forms API for you, from a blank form to response analysis.

Quick start

  1. Get OAuth credentials for the Google Forms API.

  2. Add the server — for example, in Claude Code (other clients):

    claude mcp add google-forms \
      -e GOOGLE_FORMS_CLIENT_ID=your_client_id \
      -e GOOGLE_FORMS_CLIENT_SECRET=your_client_secret \
      -e GOOGLE_FORMS_REFRESH_TOKEN=your_refresh_token \
      -- npx -y mcp-google-forms@latest
    
  3. Ask the assistant: "Create a form called 'Team lunch survey' with a dropdown of three restaurants and publish it."

Tools

Tool Description
create_form Create a form (optionally publish it right away — API-created forms start unpublished).
get_form Full form structure: info, settings, items with ids, publish state, responder URL.
update_form_info Change the title, description or document title.
update_form_settings Toggle quiz mode and email collection.
add_question Add a question: text, paragraph, radio, checkbox, dropdown, scale, date, time, rating.
update_question Update an existing item by index with an explicit update mask.
delete_item Delete the item at an index.
move_item Reorder items.
set_publish_settings Publish/unpublish, open/close response collection.
list_responses List submissions, incrementally with submitted_after; paginated.
get_response Fetch one submission by id.
manage_watches Create/list/delete/renew Cloud Pub/Sub push-notification watches.
raw_request Escape hatch: any Forms API v1 path (e.g. a custom batchUpdate with grids).

Plus resilience built in: automatic OAuth token refresh (including on 401), retries with backoff on 429 (and on 5xx/network errors for reads only — writes are never replayed), a request timeout, and an SSRF guard so the token can't leak to a foreign host.

Example prompts

  • "Create an RSVP form for the offsite, ask for name, meal preference (veg/meat/fish) and arrival date, then publish it and give me the link."
  • "Turn the 'Onboarding quiz' form into a quiz and make every question required."
  • "How many responses came in since Monday? Summarize the free-text feedback."
  • "Stop accepting responses on the feedback form."

Limitations (the API's, not the server's)

  • Responses are read-only. The Forms API cannot submit or edit responses — there is no such endpoint, so this server has no submit tool either.
  • API-created forms start unpublished and don't accept responses until published — use publish: true on create_form or set_publish_settings. Legacy forms (from before the publish model) don't support set_publish_settings at all.
  • File-upload questions can't be created via the API (existing ones are readable).
  • Quotas are per minute (reads 975/project, list_responses 450, writes 375); the server backs off on 429 automatically.

Installation

Requires Node.js 20+ (runs via npx, no separate install).

<details open> <summary><b>Claude Code</b></summary>

claude mcp add google-forms \
  -e GOOGLE_FORMS_CLIENT_ID=your_client_id \
  -e GOOGLE_FORMS_CLIENT_SECRET=your_client_secret \
  -e GOOGLE_FORMS_REFRESH_TOKEN=your_refresh_token \
  -- npx -y mcp-google-forms@latest

</details>

<details> <summary><b>Claude Desktop</b></summary>

claude_desktop_config.json — macOS ~/Library/Application Support/Claude/, Windows %APPDATA%\Claude\

{
  "mcpServers": {
    "google-forms": {
      "command": "npx",
      "args": ["-y", "mcp-google-forms@latest"],
      "env": {
        "GOOGLE_FORMS_CLIENT_ID": "your_client_id",
        "GOOGLE_FORMS_CLIENT_SECRET": "your_client_secret",
        "GOOGLE_FORMS_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

</details>

<details> <summary><b>Cursor</b></summary>

~/.cursor/mcp.json (or .cursor/mcp.json in the project)

{
  "mcpServers": {
    "google-forms": {
      "command": "npx",
      "args": ["-y", "mcp-google-forms@latest"],
      "env": {
        "GOOGLE_FORMS_CLIENT_ID": "your_client_id",
        "GOOGLE_FORMS_CLIENT_SECRET": "your_client_secret",
        "GOOGLE_FORMS_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

</details>

<details> <summary><b>VS Code</b></summary>

.vscode/mcp.json — note the servers key (not mcpServers)

{
  "servers": {
    "google-forms": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcp-google-forms@latest"],
      "env": {
        "GOOGLE_FORMS_CLIENT_ID": "your_client_id",
        "GOOGLE_FORMS_CLIENT_SECRET": "your_client_secret",
        "GOOGLE_FORMS_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

</details>

Getting credentials

The Forms API has no API-key access — every call needs OAuth 2.0. One-time setup, ~10 minutes:

  1. Create a Google Cloud project (or reuse one) at console.cloud.google.com, then enable the Google Forms API: APIs & Services → Library → Google Forms API → Enable.
  2. Configure the OAuth consent screen (APIs & Services → OAuth consent screen): choose External, fill in the app name and your email, and add your Google account under Test users (in Testing mode only listed users can authorize — no app verification needed).
  3. Create an OAuth client (APIs & Services → Credentials → Create credentials → OAuth client ID), application type Desktop app. Save the client ID and client secret.
  4. Mint a refresh token. The easiest way is the OAuth 2.0 Playground:
    • Click the gear icon → check Use your own OAuth credentials → paste your client ID and secret (add https://developers.google.com/oauthplayground as an authorized redirect URI to the OAuth client first).
    • In Step 1, enter the scopes https://www.googleapis.com/auth/forms.body https://www.googleapis.com/auth/forms.responses.readonly and click Authorize APIs, signing in with the test-user account.
    • In Step 2, click Exchange authorization code for tokens and copy the refresh token.
  5. Put the three values into GOOGLE_FORMS_CLIENT_ID, GOOGLE_FORMS_CLIENT_SECRET and GOOGLE_FORMS_REFRESH_TOKEN. The server exchanges the refresh token for short-lived access tokens automatically.

Scope notes: forms.body + forms.responses.readonly is the minimal, recommended pair (no broad Drive access). While the consent screen stays in Testing mode, refresh tokens expire after 7 days — publish the app (or keep it Internal in a Workspace domain) for long-lived tokens.

⚠️ The credentials are stored in plain text in your client's config — treat them like a password. The refresh token grants access to your forms until revoked at myaccount.google.com/permissions.

Configuration

Variable Required Default Description
GOOGLE_FORMS_CLIENT_ID yes* — OAuth2 client id (refresh flow).
GOOGLE_FORMS_CLIENT_SECRET yes* — OAuth2 client secret (refresh flow).
GOOGLE_FORMS_REFRESH_TOKEN yes* — OAuth2 refresh token (refresh flow).
GOOGLE_FORMS_ACCESS_TOKEN yes* — Alternative: a static access token (~1 h lifetime), mostly for testing.
GOOGLE_FORMS_API_BASE no https://forms.googleapis.com API root override.
GOOGLE_FORMS_TIMEOUT_MS no 60000 Per-request timeout, ms.
GOOGLE_FORMS_MAX_RETRIES no 3 Retries on transient errors.

* Either the three refresh-flow variables together, or GOOGLE_FORMS_ACCESS_TOKEN.

Documentation

  • All tools — full reference with parameters and notes.
  • Development — build, tests, smoke check, telemetry.
  • Publishing — releasing and MCP-catalog listing.

Support

Questions, ideas, issues — Telegram @gistrec or GitHub issues.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选