Google Forms MCP server

Enables programmatic interaction with Google Forms by generating refresh tokens and establishing OAuth authentication for automating form-related workflows and data retrieval.
Back to servers
Provider
Masatoshi
Release date
Mar 06, 2025
Language
TypeScript

This MCP server connects to Google Forms API, allowing you to programmatically create forms, add questions, and retrieve responses through Claude's interface.

Installation

Prerequisites

  • Node.js installed on your system
  • Google Cloud account
  • Claude desktop application

Initial Setup

Clone the repository and install dependencies:

cd google-forms-server
npm install

Build the server:

npm run build

Build the refresh token script:

npm run build:token

Google Cloud Configuration

  1. Create a project in Google Cloud Console and enable the Google Forms API:

  2. Obtain OAuth 2.0 credentials:

    • Go to "APIs & Services" > "Credentials"
    • Click "Create Credentials" > "OAuth client ID"
    • Select "Desktop app" as the application type
    • Note the generated Client ID and Client Secret

Obtaining a Refresh Token

Set environment variables with your Google credentials:

export GOOGLE_CLIENT_ID="your-client-id"
export GOOGLE_CLIENT_SECRET="your-client-secret"

Run the token retrieval script:

node build/get-refresh-token.js

If you encounter errors, try rebuilding the token script first:

npm run build:token
node build/get-refresh-token.js

Copy the refresh token that appears in the console.

Claude Desktop Integration

Update the Claude desktop application configuration file:

  1. Open ~/Library/Application Support/Claude/claude_desktop_config.json
  2. Add or update the mcpServers section with the Google Forms server:
"google-forms-server": {
  "command": "node",
  "args": [
    "/path/to/google-forms-server/build/index.js"
  ],
  "env": {
    "GOOGLE_CLIENT_ID": "your-client-id",
    "GOOGLE_CLIENT_SECRET": "your-client-secret",
    "GOOGLE_REFRESH_TOKEN": "your-refresh-token"
  }
}

Restart the Claude desktop application to apply changes.

Using the MCP Server

Available Tools

The MCP server provides the following tools:

  • create_form - Creates a new Google Form
  • add_text_question - Adds a text question to a form
  • add_multiple_choice_question - Adds a multiple-choice question to a form
  • get_form - Retrieves details about a form
  • get_form_responses - Retrieves responses submitted to a form

Usage Example

When you ask Claude to create a form with questions, it will use the appropriate MCP tools:

  1. First, Claude will create a new form using the create_form tool
  2. Next, it will add questions using add_text_question or add_multiple_choice_question tools
  3. Finally, it will display the URL of the created form

Simply ask Claude in natural language:

Please create a feedback form with questions about product satisfaction.

Claude will use the MCP tools to fulfill your request and provide you with the form URL when completed.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later