Google Forms MCP

io.github.A1-x-Tech由 GitHub 账号 A1-x-Tech 发布v1.4.0更新于 Nov 22, 2026

MCP server for the Google Forms API: create forms, manage questions, read responses and watches.

已验证STDIO仅桌面效率与工作流数据与分析

概览

AI 生成的概览

让助手通过 Google Forms API 创建、编辑和发布 Google 表单并读取已提交的回答,可在对话中完成 OAuth 登录。

可以做什么
  • 创建表单,并修改标题、说明、测验模式和邮箱收集设置
  • 添加、更新、移动和删除多种题型的问题,包括选择题、量表、日期、时间和评分
  • 发布或取消发布表单,开启或关闭回答收集
  • 列出并获取已提交的回答,可按提交时间筛选
  • 管理用于新提交和表单变更的 Cloud Pub/Sub 监视
  • 查看登录状态、在对话中完成 OAuth 登录、退出登录,以及发送原始 API 请求
适用场景
适合在助手内起草问卷或报名表、调整问题与设置、发布表单,然后读取或总结回答。也适合为新提交设置通知。
运行要求
以 npm 包形式通过 stdio 在本机运行,需要 Node.js 20+ 和一个 Google 账号。安装时无需凭据:内置 OAuth 客户端可直接在对话中登录。无人值守场景需提供 GOOGLE_FORMS_CLIENT_ID、GOOGLE_FORMS_CLIENT_SECRET 和 GOOGLE_FORMS_REFRESH_TOKEN,或短期有效的 GOOGLE_FORMS_ACCESS_TOKEN。
安装前请注意
写操作会改动线上表单:发布会让表单对外可访问,删除题目不可恢复。超时后写操作不会重试,重发前应先读取确认。客户端密钥和刷新令牌等同密码,不要放进对话或共享的配置文件。测试模式下的 OAuth 刷新令牌可能七天后失效。匿名遥测默认开启,可用 ASKADS_TELEMETRY=0 关闭。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Google Forms MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[A1] Google Forms MCP

English | Русский

[npm] [Glama] [CI] [License: MIT]

A1 Google Forms MCP lets an AI app build and manage Google Forms in plain language. Create a survey, choose its questions, publish it when ready, read answers and use notifications for new submissions.

It uses the Google Forms API with your Google account. It distinguishes a draft form from a published form and makes the limits of the Forms API explicit instead of implying that every form task is possible.

  • 19 tools. Inspect form structure and responses, create and edit forms and questions, manage publishing, and configure Pub/Sub watches.
  • Connects from the conversation. Say "connect Google Forms": the server walks you through the OAuth client, catches Google's redirect on 127.0.0.1 with PKCE and keeps the tokens itself — no config files, no restart.
  • Publish deliberately. Forms made through the API start unpublished, so they cannot collect responses until you publish them.
  • Responses stay intact. The API can read responses but cannot create or edit them; the server has no tool that submits answers.
  • Minimal Google scopes. It uses forms.body and forms.responses.readonly, without broad Drive access.

Start with a read-only question:

Show me yesterday’s responses to the customer feedback form and summarize the free-text answers.

Connect the server · Explore use cases · Open technical documentation


See it work in a minute

You: Show me the questions and response settings of the customer feedback form.

Assistant: Shows the form, its items, whether it is published and whether it accepts responses. Nothing changes.

You: Prepare a required 1–5 rating question called “How was your experience?” after the first question.

Assistant: Shows the target form, position and proposed question, then asks for confirmation before adding it.

You: Confirm.

Assistant: Adds the question to the form. It does not publish or close the form unless you ask separately.

Contents

Quick start

You need Node.js 20+ and a Google account. Credentials are not required at install time — the server connects from the conversation.

  1. Add the server to your AI app.
  2. Say "connect Google Forms": the assistant gives you a Google sign-in link — no Google Cloud project or OAuth client to create.
  3. Ask the read-only question above.
Codex

In the app: open Settings → MCP servers, select Add server, choose STDIO, enter the command npx -y mcp-google-forms@latest, then select Save and Restart.

From the command line:

bash
codex mcp add google-forms \  -- npx -y mcp-google-forms@latest
bash
codex mcp list

Codex MCP documentation

Claude Code
bash
claude mcp add \  --transport stdio --scope user google-forms \  -- npx -y mcp-google-forms@latest
bash
claude mcp list

Claude Code MCP documentation

Claude Desktop

The current official path is Settings → Extensions. For a custom desktop extension, open Advanced settings → Extension Developer → Install Extension…, select a .mcpb file and follow the prompts.

This repository currently publishes an npm stdio package and does not contain a .mcpb bundle. For Claude Desktop builds that still support local configuration, use the following JSON stdio configuration as a fallback:

json
{  "mcpServers": {    "google-forms": {      "command": "npx",      "args": ["-y", "mcp-google-forms@latest"]    }  }}

In those builds, save it to ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows.

Claude Desktop MCP documentation

Cursor

Add this to ~/.cursor/mcp.json on macOS/Linux or %USERPROFILE%\.cursor\mcp.json on Windows:

json
{  "mcpServers": {    "google-forms": {      "type": "stdio",      "command": "npx",      "args": ["-y", "mcp-google-forms@latest"]    }  }}

Cursor MCP documentation

VS Code

Run MCP: Open User Configuration and add:

json
{  "servers": {    "google-forms": {      "type": "stdio",      "command": "npx",      "args": ["-y", "mcp-google-forms@latest"]    }  }}

Check it with MCP: List Servers.

VS Code MCP documentation

What you can ask it to do

Inspect a survey and its answers

  • Show this form’s questions, response settings and responder link.
  • How many answers arrived since Monday? Summarize the free-text feedback.
  • Show one response by ID.

Build and improve a form

  • Create an RSVP form with name, meal preference and arrival date.
  • Add a required rating, dropdown, date, time, choice or text question.
  • Reorder a question or update a title, description, quiz mode or email collection.

Publish and connect notifications

  • Publish a prepared form and show its responder URL.
  • Stop accepting new responses without deleting the form.
  • Create, renew or remove a Cloud Pub/Sub watch for new submissions.

How a form changes

  1. create_form creates a form, which starts unpublished by default.
  2. Questions are items, identified by their position in the form.
  3. Publishing makes a form available to respondents; closing response collection leaves it published but stops new submissions.
  4. Responses are a separate read-only record. The API cannot submit, edit or delete a respondent’s answer.

File-upload questions cannot be created through the Forms API, although existing file-upload items can be read. Legacy forms created before Google’s publish model may not support publishing settings.

What can change

OperationWhat happensConfirmation boundary
Read a form and its responsesReads form structure and submissionsNo change
Create a formAdds an unpublished formChanges Google Forms
Add or move a questionChanges form itemsChanges a form
Update form info, settings or an itemChanges title, settings or a selected questionChanges a form
Publish, unpublish, open or close responsesChanges who can use the formChanges a form’s public availability
Delete an itemRemoves a selected questionDestructive
Manage a Pub/Sub watchCreates, renews or deletes notification deliveryPotentially destructive
Raw API requestCan call API methods without a dedicated toolPotentially destructive

The AI client controls confirmation prompts. The server marks reads, writes and destructive tools so the client can distinguish an inspection from a live change.

Getting access

Google Forms requires OAuth 2.0; an API key is not enough. There are two ways in, and the first one needs no configuration files.

Connect from the chat (recommended)

Say "connect Google Forms". The server ships with a built-in OAuth client, so there is no Google Cloud project or OAuth client to create:

  1. start_login returns a Google consent link. Open it on this machine and approve; the code comes back to a one-shot listener on 127.0.0.1 (PKCE), never through the chat.
  2. finish_login exchanges the code and saves the tokens to ~/.config/mcp-google-forms/credentials.json (mode 0600).

Google may show a "Google hasn't verified this app" screen while the app's verification is in progress: choose Advanced → Go to A1 MCP. The built-in client only identifies the app to Google — the tokens are issued to and stored on your machine, and A1 never receives them.

Use your own OAuth client

The built-in client and its Google API quota are shared by everyone who uses it. Bring your own client to get a quota of your own, or when a Google Workspace admin blocks third-party apps:

  1. setup_instructions prints the checklist: create or select a Google Cloud project, enable Google Forms API, configure the consent screen and create a Desktop app OAuth client.
  2. Download that client's JSON ("Download JSON") and give the assistant its path — set_client stores it owner-only. The secret never goes through the conversation. From then on it takes priority over the built-in client.
  3. Run start_login and finish_login again.

The tokens are re-read on every call, so the connection works immediately — no restart of the AI app. auth_status shows what is connected, logout revokes and deletes it.

Environment variables (CI, unattended installs)

  1. Create or select a Google Cloud project and enable Google Forms API.

  2. Configure the OAuth consent screen and create a Desktop app OAuth client.

  3. Authorize the Google account that owns or can edit the forms. The OAuth 2.0 Playground can obtain the refresh token when Use your own OAuth credentials is enabled.

  4. Request both scopes:

    text
    https://www.googleapis.com/auth/forms.bodyhttps://www.googleapis.com/auth/forms.responses.readonly

Testing-mode OAuth refresh tokens can expire after seven days. Publish the OAuth app, or use an Internal app in a Workspace domain, when you need long-lived access. Treat the client secret and refresh token as passwords.

Configuration

Every variable is optional — with none of them the server connects from the chat.

VariableRequiredDescription
GOOGLE_FORMS_CLIENT_IDNo*OAuth client ID.
GOOGLE_FORMS_CLIENT_SECRETNo*OAuth client secret.
GOOGLE_FORMS_REFRESH_TOKENNo*OAuth refresh token.
GOOGLE_FORMS_ACCESS_TOKENNo*Short-lived alternative to the OAuth trio.
GOOGLE_FORMS_OAUTH_PORTNoFixed loopback port for the in-chat login; useful over SSH port forwarding.
GOOGLE_FORMS_API_BASENoGoogle Forms API base URL override.
GOOGLE_FORMS_TIMEOUT_MSNoPer-request timeout; default 60000 ms.
GOOGLE_FORMS_MAX_RETRIESNoTemporary-error retries; default 3.

* Only for a setup without the in-chat login: provide either the OAuth trio or an access token.

Data, limits and background work

  • Requests go to Google Forms. The local server refreshes Google OAuth tokens and calls the Forms API. Its anonymous telemetry contains an installation ID, package version, AI client and platform versions, and tool names — never OAuth tokens, form data, tool arguments or prompts. For each tool call it also sends the outcome and, on failure, an excerpt of the error text with e-mails, addresses, tokens, numbers of 4+ digits and quoted text replaced by #; a value from your request can appear in it if the error text contains it. Set ASKADS_TELEMETRY=0 to opt out.
  • Google applies per-minute quotas. The documented limits are 975 reads per project, 450 list_responses calls and 375 writes. On 429, the server uses backoff; reads also retry after network and 5xx errors, while writes are not replayed after an uncertain failure.
  • There is no background polling. The server runs only when called. Pub/Sub watches can notify your own infrastructure about new responses; if your AI app supports scheduled tasks, it can also check responses periodically.

Technical documentation

Support

Found a bug or need a scenario? Create an issue or write in Telegram.


[Две Моны дают пять]

You made it to the end!

来源:README.md,提交 61d9b08

工具

19

auth_status

Google connection status

Shows whether this server is connected to Google: token presence and source (env variables or a stored in-chat login), expiry, the Google account email, granted vs missing OAuth scopes, where the credentials file lives and where the OAuth client comes from. Makes no network calls and never returns the token itself. Call it first when other tools report the server is not connected.

无需输入参数。

setup_instructions

Setup instructions

This server ships with a built-in OAuth client, so connecting normally needs only start_login + finish_login; call this for the details or to switch to your own client. The checklist adapts to the client in use: with the built-in client it is just the two login calls, and it adds the steps for your OWN client — creating a Google Cloud project and a Desktop-app OAuth client, publishing the consent screen (mandatory — Testing-mode refresh tokens die after 7 days), downloading the client JSON and handing its PATH to set_client. Works without any credentials; with your own client already configured it shortens to 'enable the API + log in' (one client serves the whole mcp-google-* line). Never asks the user to paste secrets into the chat.

无需输入参数。

set_client

Save the OAuth client

Saves the OAuth client credentials from the JSON file downloaded from Google Cloud Console ('Download JSON' on a Desktop-app client). Pass the file PATH — the secret must never be pasted into the chat. The client is stored once in the shared ~/.config/mcp-google-auth/client.json (owner-only) and reused by every mcp-google-* server; tokens stay per-server. After this, call start_login.

输入参数path必填

start_login

Start the Google login

First step of connecting from the chat, without editing config files or restarting the client. Returns authorizeUrl — show it to the user as a clickable link and ask them to open it in the browser ON THIS MACHINE, pick the Google account and approve access. A one-shot listener on 127.0.0.1 catches Google's redirect; the code is exchanged locally and never passes through the chat. Does not open the browser itself. The attempt lives 10 minutes; when the browser shows the success page, call finish_login.

无需输入参数。

finish_login

Finish the Google login

Second step: waits up to 20 s for the browser consent to finish, saves the tokens to an owner-only file and verifies the login with a read-only identity call, returning the account email and the granted scopes. After success every tool works immediately — no client restart. If the user granted only part of the requested permissions, the login is still saved and missingScopes lists what will not work. Logging in under a different Google account replaces the previous login (its refresh token is revoked best-effort) and the response carries previousAccountEmail so the change never goes unnoticed.

无需输入参数。

logout

Disconnect from Google

Revokes the stored token at Google (oauth2.googleapis.com/revoke) and deletes the local credentials file. Tokens supplied via env variables are NOT touched — remove them from the MCP client config manually; envTokenStillSet in the response says whether any are still in effect.

无需输入参数。

create_form

Create a form

Creates a new Google Form and returns it (formId, revisionId, responderUri, publishSettings). The API only accepts a title and an optional document title at creation (the Drive file name — it cannot be changed later through this API) — add questions with add_question and change settings with update_form_settings afterwards. IMPORTANT: API-created forms are UNPUBLISHED by default and do not accept responses; pass publish=true to publish immediately, or call set_publish_settings later. If the chained publish step fails, the form still exists: the result carries formId with published:false and publish_error — finish with set_publish_settings, never create_form again. Share the responderUri with respondents once published.

输入参数title必填publishdocument_title

get_form

Get a form

Returns the full form: info (title, description), settings (quiz mode, email collection), items[] with their itemId/questionId and question definitions, publishSettings, responderUri and linkedSheetId. Items are returned in order — their 0-based positions are the indexes that update_question, delete_item and move_item address, so call this before mutating items.

输入参数form_id必填

update_form_info

Update form info

Changes the form's title and/or description. Only the provided fields are touched (the updateMask is computed automatically); at least one field is required. The document title (the Drive file name) is set once at create_form and cannot be changed through the Forms API — renaming the file needs the Drive API, which this server does not cover. Returns the batchUpdate replies with the new revisionId.

输入参数titleform_id必填description

update_form_settings

Update form settings

Toggles quiz mode (grading with points) and/or the email collection mode. Quiz mode only enables grading — points, correct answers and feedback are set per question afterwards via update_question with the questionItem.question.grading mask (add_question cannot set them). email_collection_type: DO_NOT_COLLECT, VERIFIED (respondent must be signed in; email verified) or RESPONDER_INPUT (respondent types an email). At least one field is required; only the provided fields are touched.

输入参数form_id必填is_quizemail_collection_type

set_publish_settings

Publish or unpublish a form

Publishes or unpublishes the form and opens/closes response collection. is_accepting_responses defaults to mirroring is_published (publish = start accepting, unpublish = stop). Use is_published=true with is_accepting_responses=false to keep a published form visible but closed. Fails on legacy forms created before the publish model existed — those are managed only in the Forms UI.

输入参数form_id必填is_published必填is_accepting_responses

add_question

Add a question

Adds a question to the form (a convenience wrapper over batchUpdate createItem). Types: text (short answer), paragraph (long answer), radio (single choice), checkbox (multiple choice), dropdown, scale (linear scale low..high), date, time, rating (stars/hearts/thumbs). Choice types require options[]. Returns the created itemId and questionId from the batchUpdate replies. index inserts at that 0-based position; omit it to append at the end (costs one extra read to count items). Quiz grading (points, correct answers, feedback) cannot be set here — after adding, use update_question with the questionItem.question.grading mask. File-upload questions cannot be created via the API, and question grids (questionGroupItem) need raw_request with a batchUpdate body.

输入参数lowhightype必填indextitle必填form_id必填optionsshuffledurationrequiredlow_labelhigh_label另有 5 个

update_question

Update an item

Updates an existing item (question or other) via batchUpdate updateItem. The item is addressed by its 0-based index — call get_form first to see current positions and the item's current shape. item is a raw Forms API Item object with the new values; update_mask names the fields to replace, e.g. "title" or "title,questionItem.question.required". Only masked fields change; masking a field the item object leaves unset clears it.

输入参数item必填index必填form_id必填update_mask必填

delete_item

Delete an item

Deletes the item at the given 0-based index (question, page break, text block, ...). Deletion shifts every later item one position down — re-check indexes with get_form between successive deletes.

输入参数index必填form_id必填

move_item

Move an item

Moves the item at from_index to to_index (both 0-based, to_index is the position after removal). Use get_form to see the current order first.

输入参数form_id必填to_index必填from_index必填

list_responses

List form responses

Lists submitted responses: responseId, createTime, lastSubmittedTime, respondentEmail (only when email collection is on), answers keyed by questionId (map questionId → question via get_form), and totalScore for graded quizzes. submitted_after keeps only responses submitted strictly after that RFC3339 UTC timestamp — the API's only filter; there is no ordering or email filter, do that client-side. Paginate with page_token from nextPageToken. Note: this endpoint has a lower per-minute quota than other reads — poll incrementally with submitted_after rather than re-listing everything. The API is read-only for responses; submitting them programmatically is impossible.

输入参数form_id必填page_sizepage_tokensubmitted_after

get_response

Get one response

Fetches a single submission by its responseId (from list_responses): answers keyed by questionId, createTime, lastSubmittedTime, respondentEmail and totalScore when available. Map questionId to the question text via get_form.

输入参数form_id必填response_id必填

manage_watches

Manage push-notification watches

Manages Cloud Pub/Sub push-notification watches on a form. action=create needs event_type (RESPONSES = new submissions, SCHEMA = form structure changes) and topic_name; the topic must live in your Cloud project and grant the Pub/Sub Publisher role to [email protected]. action=list shows your watches; delete and renew need watch_id. Watches expire after 7 days — renew extends 7 days from now and reactivates a SUSPENDED watch. Notifications carry only formId/watchId/eventType attributes (no payload): on RESPONSES call list_responses with submitted_after, on SCHEMA call get_form. Limits: 1 watch per user per form+event type, 20 per Cloud project.

输入参数action必填form_id必填watch_idevent_typetopic_name

raw_request

Raw Google Forms API call

Escape hatch to call any Google Forms API v1 path directly, for requests the typed tools don't cover — e.g. a batchUpdate with questionGroupItem grids, writeControl/requiredRevisionId, includeFormInResponse, or several requests at once: path "v1/forms/<formId>:batchUpdate", method POST, body {"requests":[...]}. The path may carry a query string (e.g. "v1/forms/<id>/responses?filter=timestamp%20%3E%202026-08-01T00:00:00Z"). The Bearer token is added automatically; the method defaults to GET.

输入参数bodypath必填method

版本历史

6
  1. v1.4.0最新Nov 21, 2026
  2. v1.3.2Nov 5, 2026
  3. v1.3.1Oct 31, 2026
  4. v1.3.0Oct 31, 2026
  5. v1.2.0Sep 21, 2026
  6. v1.1.0Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分