Google Forms MCP Server for managing forms and responses via the Model Context Protocol
Project description
Google Forms MCP Server
An MCP server for managing Google Forms and form responses, integrating seamlessly with AI assistants using the Model Context Protocol.
Features
- List Forms: Search and list Google Forms from Drive with optional title filter and pagination.
- Get Form: Retrieve metadata, items, and settings for a specific form.
- Create Form: Create a new, empty Google Form by title.
- Batch Update: Add, move, or delete items and update form info via the Forms
batchUpdateAPI. - List Responses: Page through responses for a form, with optional time filter.
- Get Response: Fetch a single response by
responseId. - Manage Watches: Create, list, and delete Pub/Sub watches for
SCHEMAorRESPONSESevents.
Installation
Prerequisites
- Python 3.9 or higher.
- A Google Cloud Project with the Google Forms API and Google Drive API enabled.
- OAuth2 credentials (Client ID and Client Secret).
- OAuth scopes (defaults, used if
--scopesnot provided):https://www.googleapis.com/auth/forms.body— read/write form structurehttps://www.googleapis.com/auth/forms.responses.readonly— read form responseshttps://www.googleapis.com/auth/drive.readonly— list forms via Drive
The server's
list_formstool calls the Drive API, andlist_responses/get_responsecall the Forms responses endpoint, so all three scopes are needed for full functionality.
Local Setup
-
Install dependencies:
pip install -e .
The published wheel contains
server.py,schemas.py, andtools/— notmain.py(see below). -
Run the server:
python server.py \ --access-token <ACCESS_TOKEN> \ --refresh-token <REFRESH_TOKEN> \ --client-id <CLIENT_ID> \ --client-secret <CLIENT_SECRET>
Optional flags:
--expiry <ISO_TIMESTAMP>— token expiry (e.g.2026-05-07T12:00:00Z).--scopes '["https://www.googleapis.com/auth/forms.body","https://www.googleapis.com/auth/forms.responses.readonly","https://www.googleapis.com/auth/drive.readonly"]'— JSON array of scopes.--log-level DEBUG|INFO|WARNING|ERROR— log verbosity (defaults toINFO).
Environment variable fallbacks (used when the matching CLI flag is absent):
GOOGLE_ACCESS_TOKEN,GOOGLE_REFRESH_TOKEN,GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRETGOOGLE_TOKEN_EXPIRY,GOOGLE_SCOPES,LOG_LEVEL
Configuration
Add the following to your MCP host configuration (e.g., mcp-config.json):
{
"mcpServers": {
"barie-google-forms-mcp": {
"command": "uvx",
"args": [
"barie-google-forms-mcp",
"--access-token",
"YOUR_ACCESS_TOKEN",
"--refresh-token",
"YOUR_REFRESH_TOKEN",
"--client-id",
"YOUR_CLIENT_ID",
"--client-secret",
"YOUR_CLIENT_SECRET"
]
}
}
}
For local development against the source tree, use uvx --from /path/to/google_forms barie-google-forms-mcp ... instead.
Optional: main.py (Barie monorepo only)
main.py is not shipped in the PyPI wheel. It wires this MCP server into CAMEL-AI (camel.toolkits) and Barie’s mcp_use_service. If you run it from a full monorepo checkout:
pip install -e ".[internal]" # pulls python-dotenv; you still need camel-ai + Barie services on PYTHONPATH
If imports are missing, you will get an explicit ImportError telling you to use barie-google-forms-mcp / python server.py instead.
Publishing (maintainers)
From this directory:
rm -rf dist/ build/ *.egg-info
python -m build
python -m twine check dist/*
# TestPyPI first (recommended):
# python -m twine upload --repository testpypi dist/*
Tools
list_forms: List Google Forms from Drive (optionalquery,pageSize,pageToken).get_form: Get form metadata, items, and settings byformId.create_form: Create a new, empty form with atitle.batch_update_form: Apply a list ofrequests(e.g.createItem,updateFormInfo) to a form.list_responses: List responses for a form, with optionalfilter,pageSize, andpageToken.get_response: Get a single response byformIdandresponseId.create_watch: Create a Pub/Sub watch on a form (eventType:SCHEMAorRESPONSES).list_watches: List all watches for a form.delete_watch: Delete a watch byformIdandwatchId.
Watch Tool Notes
create_watch requires a Google Cloud Pub/Sub topic and proper IAM bindings. Example payload:
{
"formId": "FORM_ID",
"target": { "topic": { "topicName": "projects/PROJECT/topics/TOPIC" } },
"eventType": "RESPONSES"
}
Allowed eventType values: SCHEMA, RESPONSES.
Reliability
- Transient Google API errors (HTTP 429/500/502/503/504) are automatically retried up to 3 times with exponential backoff via
tenacity. - All Google API calls are dispatched off the asyncio event loop with
asyncio.to_threadso the MCP server stays responsive. HttpErrors are surfaced as{"error": "Google API error <status>: <message>"}instead of leaking internal tracebacks.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file barie_google_forms_mcp-0.1.2.tar.gz.
File metadata
- Download URL: barie_google_forms_mcp-0.1.2.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d5c08e70b69405da6bbe8c02a353e3fd55fcecfcd3d2c3543de65ed0856f476
|
|
| MD5 |
4f35cac2546b9814100e2698c08c8567
|
|
| BLAKE2b-256 |
a7be84fcf68a708139f8a45a8c1087f721a890e09e56548a7874abd192257712
|
File details
Details for the file barie_google_forms_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: barie_google_forms_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66009b1ac0a71f657790d2b1273678be054209770c2ae571b0ec459752e31ed0
|
|
| MD5 |
c5a69a1b0199f3f282834e8794332371
|
|
| BLAKE2b-256 |
ece9dc0a446547bfda6d9d1864fd89e4407144838d0fca56b88788f93bda8b7d
|