Tasks offers a remote
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction)
server that allows AI agents to securely interact with Tasks
data. By configuring the Tasks MCP server, you enable AI
applications like Google Antigravity and Claude to perform actions in
Tasks.

The Tasks MCP server provides a standardized way for AI
agents to:

- **Read data**: List task lists and retrieve tasks.
- **Take action**: Create, update, complete, uncomplete, and delete tasks.
- **Respect security**: Inherit the same permissions and data governance controls as the user.

> [!NOTE]
> **Note:** You can also connect AI agents and interactive terminals to Tasks with the [Google Workspace command-line interface (CLI)](https://developers.google.com/workspace/guides/workspace-cli.md.txt), `gwscli`.

## Prerequisites

- A Google Cloud project. You can create or select a project during
  [Quick setup for personal use](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#quick-setup), or see
  [Create a project](https://developers.google.com/workspace/guides/create-project.md.txt).

- An MCP host, which is an AI application like
  [Google Antigravity](https://antigravity.google/) or Claude. The AI
  application creates an MCP client connection for each MCP server.

- To run the `gcloud` commands for manual setup on this page, set up the
  gcloud CLI in a local development environment by following these steps:

  1. [Install the Google Cloud CLI](https://cloud.google.com/sdk/docs/install). If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.
  2. If you're using an external identity provider (IdP), sign in to the gcloud CLI with your federated identity. For more information, see [Sign in to the gcloud CLI with your federated identity](https://docs.cloud.google.com/iam/docs/workforce-log-in-gcloud).
  3. [Initialize the gcloud CLI](https://docs.cloud.google.com/sdk/docs/initializing).

## Configure the Tasks MCP server

To use the Tasks MCP server, set up a Google Cloud
project with an AI-agent OAuth 2.0 client and configure your AI application to
connect to it:

- **Personal use** : If you're connecting an AI application for your own Google Account, use [Quick setup for personal use](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#quick-setup) to configure a project, enable the MCP service, and create an OAuth client on a single page.
- **Multi-user or custom setup** : If multiple users will sign in with your OAuth client, or if you want to enable only specific MCP services and OAuth scopes, start at [Enable the MCP service](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#enable-mcp-services).

### Quick setup for personal use

Use **Personal mode onboarding** in the Google Cloud console to create
an OAuth 2.0 client that works only for your Google Account and doesn't require
app verification or separate OAuth consent screen setup:

1. Open **Personal mode onboarding** in the Google Cloud console. The
   button pre-selects a **Web application** client, which Google Antigravity
   and Claude require:

   [Set up personal mode](https://console.cloud.google.com/auth/overview/personal?apis=ws,wsmcp,tasksmcp&clientType=web&isAgent=true)

   If your MCP client uses a desktop or mobile OAuth flow instead of a web
   redirect URI, open personal mode setup for a [Desktop app](https://console.cloud.google.com/auth/overview/personal?apis=ws,wsmcp,tasksmcp&clientType=desktop&isAgent=true),
   [Android](https://console.cloud.google.com/auth/overview/personal?apis=ws,wsmcp,tasksmcp&clientType=android&isAgent=true), or [iOS](https://console.cloud.google.com/auth/overview/personal?apis=ws,wsmcp,tasksmcp&clientType=ios&isAgent=true) client, or change **Application
   type** on the page.
2. In **Select Project** , select an existing personal-mode project or click
   **Create a new project**. If prompted, complete the project creation form.

3. Configure your OAuth client details:

   - Enter a **Name** for the client.
   - If **Application type** is **Web application** , in **Authorized
     redirect URIs** , click **+ Add URI** and add your MCP client's callback URI:
     - For Antigravity: `https://antigravity.google/oauth-callback`
     - For Claude: `https://claude.ai/api/mcp/auth_callback`
   - Verify that **Use this client for an AI-powered agent** is selected.
4. Review the [Google API Services User Data Policy](https://developers.google.com/terms/api-services-user-data-policy.md.txt),
   select **I agree to the Google API Services: User Data Policy.** , and click
   **Continue**.

   The console enables core Google Workspace APIs and MCP services in
   your project and creates your OAuth client.
5. Copy your **Client ID** and **Client Secret** , and then [connect your client
   to the MCP server](https://developers.google.com/workspace/tasks/guides/configure-mcp-server#configure-mcp-client), skipping step 1 since you already
   have your OAuth client ID and secret.

### Enable the MCP service

Skip this step if you used [Quick setup for personal use](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#quick-setup).

To use the Tasks MCP server, enable the following service in
your Google Cloud project. You don't need to enable the Google Tasks API:

- Tasks MCP API

### CLI

```bash
gcloud services enable tasksmcp.googleapis.com --project=PROJECT_ID
```

Replace `PROJECT_ID`
with your Google Cloud project ID.

### Console

Enable the MCP service in the Google Cloud console:

[Enable the MCP service](https://console.cloud.google.com/flows/enableapi?apiid=tasksmcp.googleapis.com)

### Set up the OAuth consent screen

Skip this step if you used [Quick setup for personal use](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#quick-setup).

The Tasks MCP server uses OAuth 2.0 for authentication and
authorization. You must configure the OAuth consent screen before you can
create an OAuth client ID.

1. In the Google Cloud console, go to **Google Auth Platform**
   \> **Branding**.

   [Go to Branding](https://console.cloud.google.com/auth/branding)
2. If you have already configured the **Google Auth Platform** , you can
   configure the following OAuth Consent Screen settings in
   [Branding](https://console.cloud.google.com/auth/branding),
   [Audience](https://console.cloud.google.com/auth/audience),
   and [Data Access](https://console.cloud.google.com/auth/scopes).
   If you see a message that says **Google Auth Platform not configured
   yet** , click **Get Started**:

   1. Under **App Information** , in **App name** , type `Tasks MCP Server`.
   2. In **User support email**, select your email address or an appropriate Google group.
   3. Click **Next**.
   4. Under **Audience** , select **Internal** . If you can't select **Internal** , select **External**.
   5. Click **Next**.
   6. Under **Contact Information** , enter an **Email address** where you can be notified about any changes to your project.
   7. Click **Next**.
   8. Under **Finish** , review the [Google API Services User Data Policy](https://developers.google.com/terms/api-services-user-data-policy.md.txt) and if you agree, select **I agree to the Google API Services: User Data Policy**.
   9. Click **Continue**.
   10. Click **Create**.
   11. If you selected **External** for user type, add test users:
       1. Click **Audience**.
       2. Under **Test users** , click **Add users**.
       3. Enter your email address and any other authorized test users, then click **Save**.
3. Click **Data Access** \>
   **Add or Remove Scopes**. A panel appears with a list of scopes for each
   API that you've enabled in your Google Cloud project.

   1. Under **Manually add scopes**, paste the scopes for the
      Tasks MCP server:

      - `https://www.googleapis.com/auth/tasks.readonly`
      - `https://www.googleapis.com/auth/tasks`
   2. Click **Add to Table**.

   3. Click **Update**.

   4. After selecting the scopes required by your app, on the **Data Access**
      page, click **Save**.

### Configure your AI application

To add the Tasks remote MCP server to your AI application,
follow the instructions for your application.

User-delegated OAuth 2.0 client IDs that call the Tasks MCP
server must have **Use this client for an AI-powered agent** selected in
**Google Auth Platform** \> **Clients** . To
update an existing OAuth 2.0 client ID, select this setting in
**Google Auth Platform** \> **Clients** , as
described in
[Manage OAuth Clients](https://support.google.com/cloud/answer/15549257).
If you can't change this setting on an existing client, or if the client also
supports non-agent features, create a new OAuth 2.0 client ID for your AI
agent. For rejected requests, service accounts with domain-wide delegation, or
Google Apps Script, see [Troubleshooting](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#troubleshooting).

### Antigravity

To add the Tasks remote MCP server to Antigravity, add the
server configuration to your `mcp_config.json` file. These instructions
support Antigravity 2.0, Antigravity IDE, and Antigravity CLI.

1. Create an OAuth 2.0 client ID and secret, or skip to the next step
   if you already created one in
   [Quick setup for personal use](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#quick-setup):

   1. In the Google Cloud console, go to **Google Auth Platform**
      \> **Clients**
      \> **Create Client**.

      [Go to Create Client](https://console.cloud.google.com/auth/clients/create)
   2. Select **Web application** as the application type.

   3. Enter a **Name**.

   4. In the **Authorized redirect URIs** section, click **+ Add URI** ,
      and then add `https://antigravity.google/oauth-callback` in the
      **URIs** field.

   5. Select **Use this client for an AI-powered agent**.

   6. Click **Create** and copy your **Client ID** and **Client Secret**.

2. Open or create the configuration file
   `~/.gemini/config/mcp_config.json`.

3. Add the `mcpServers` configuration to `mcp_config.json`:

   ```json
   {
     "mcpServers": {
       "tasks": {
         "serverUrl": "https://tasksmcp.googleapis.com/mcp/v1",
         "oauth": {
           "clientId": "OAUTH_CLIENT_ID",
           "clientSecret": "OAUTH_CLIENT_SECRET"
         }
       }
     }
   }
   ```

   Replace the following:
   - `OAUTH_CLIENT_ID`: The client ID you created.
   - `OAUTH_CLIENT_SECRET`: The client secret you created.
4. Save `mcp_config.json`.

5. Authenticate the MCP server. You can authenticate using either the GUI
   settings or the CLI:

   - **For Antigravity IDE or GUI (Antigravity 2.0):**

     1. Open your settings screen (for example, click **Settings** at the bottom-left or open **Antigravity User Settings**).
     2. Navigate to **Customizations**.
     3. Under **Installed MCP Servers** , click **Refresh**.
     4. Find `tasks` in the list, click **Authenticate** , sign in to your Google Account, copy the authorization code, paste it into the input dialog, and click **Submit**.
   - **For Antigravity CLI:**

     1. Start Antigravity CLI:

        ```bash
        agy
        ```
     2. Open the interactive MCP management panel by running:

        ```bash
        /mcp
        ```
     3. Use the arrow keys to select `tasks`, move to the
        **Authenticate** action, and press **Enter** . Complete the
        sign-in flow in your browser, copy the authorization code,
        paste it into the terminal prompt, and press **Enter**.

6. Verify that the server is correctly configured and running:

   - **For Antigravity IDE or GUI:** A **Sign out** button is displayed next to the server under **Customizations** \> **Installed MCP Servers**.
   - **For Antigravity CLI:** Open the `/mcp` panel to view your configured MCP servers. Verified and authenticated servers display **Authed** next to their names inside the interactive TUI panel. You can select the server under the dashboard view to inspect its status and list all of its available tools.

The remote MCP server is ready to use in Antigravity.

### Claude

To use the Tasks remote MCP server with Claude.ai or Claude
Desktop, you must have the Claude Enterprise, Pro, Max, or Team plan.

To add the Tasks remote MCP server to Claude, configure a
custom connector with an OAuth client ID and secret.

1. Create an OAuth 2.0 client ID and secret, or skip to the next step
   if you already created one in
   [Quick setup for personal use](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#quick-setup):

   1. In the Google Cloud console, go to **Google Auth Platform**
      \> **Clients**
      \> **Create Client**.

      [Go to Create Client](https://console.cloud.google.com/auth/clients/create)
   2. Select **Web application** as the application type.

   3. Enter a **Name**.

   4. In the **Authorized redirect URIs** section, click **+ Add URI** ,
      and then add `https://claude.ai/api/mcp/auth_callback` in the
      **URIs** field.

   5. Select **Use this client for an AI-powered agent**.

   6. Click **Create** and copy your **Client ID** and **Client Secret**.

2. Configure the MCP server in Claude:

   1. In Claude.ai or Claude Desktop, go to **Settings** \> **Connectors** or **Admin settings** \> **Connectors**.
   2. Click **Add custom connector**.
   3. Enter the connection details for the Tasks product:
      - **Server name** : `Tasks`.
      - **Remote MCP server URL** : `https://tasksmcp.googleapis.com/mcp/v1`
   4. In **Advanced settings** , enter your **OAuth client ID** and **OAuth client secret**.
   5. Click **Add**.

### Others

Many AI applications have ways to connect to a remote MCP server. You
typically need to enter details about the server, like its name, endpoints,
transport protocol, and authentication method. For the Tasks
remote MCP server, enter the following:

- **Server name** : `tasks`

- **Server URL** : `https://tasksmcp.googleapis.com/mcp/v1`

- **Transport** : [Streamable HTTP](https://modelcontextprotocol.io/specification/latest/basic/transports/streamable-http)

- **Authentication** : The Tasks remote MCP server uses
  OAuth 2.0. When creating your OAuth 2.0 client, select
  **Use this client for an AI-powered agent** . For single-user personal
  setups, you can create a web, desktop, Android, or iOS client using
  [Quick setup for personal use](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#quick-setup). For details, see
  [Learn about authentication and authorization](https://developers.google.com/workspace/guides/auth-overview.md.txt).

  To avoid hourly sign-in prompts with a **Web application** OAuth client,
  configure your MCP client to request offline access using
  `access_type=offline` or the `offline_access` scope. For details, see
  [Repeated hourly sign-in prompts](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#hourly-sign-in).

For more details on connecting different types of AI applications, see
[Configure MCP in an AI application](https://docs.cloud.google.com/mcp/configure-mcp-ai-application).

## Test the Tasks MCP server

After you configure your AI application, you can verify the connection by
running some test prompts.

Try asking your AI application the following questions:

- **"What tasks are on my to-do list?"**

  The client retrieves your task lists using `tasks.list_task_lists` and
  lists the tasks in your default list using `tasks.list_tasks`.
- **"Add a task to send Ariel the marketing plan by Friday."**

  The client uses `tasks.create_task` to add the task to your default
  task list.

If the tools execute successfully and you receive relevant responses, your
Tasks MCP server is correctly configured.

## Troubleshooting

Use the following sections to resolve common authentication and connection
issues with the Tasks MCP server.

### Check OAuth log events

If you encounter issues connecting to the MCP server, check for errors in the
OAuth logs. Ask your Google Workspace administrator to review the
**OAuth log events** in the [security investigation
tool](https://knowledge.workspace.google.com/admin/security/about-the-security-investigation-tool).

### Rejected requests from user-delegated OAuth clients

If your requests to the MCP server are rejected, verify that the
user-delegated OAuth 2.0 client ID for your 3-legged OAuth flow has **Use this
client for an AI-powered agent** selected in **Google Auth Platform**
\> **Clients**:

- **Existing client supports the setting** : Select **Use this client for an
  AI-powered agent** on your existing OAuth client.
- **Existing client can't be updated** : Create a new OAuth client with **Use
  this client for an AI-powered agent** selected and update your app to use it.
- **Existing client also supports non-agent features**: Create a separate OAuth client for the AI agent and keep the existing client for your non-agent features.

For instructions, see
[Configure your AI application](https://developers.google.com/workspace/tasks/guides/configure-mcp-server.md.txt#configure-mcp-client) and
[Manage OAuth Clients](https://support.google.com/cloud/answer/15549257).

### Service accounts with domain-wide delegation

If your app uses a service account with domain-wide delegation for 2-legged
OAuth, you can't select **Use this client for an AI-powered agent** because
service accounts aren't managed in **Google Auth Platform**
\> **Clients**:

- **Access control** : Requests to the MCP server from these service accounts aren't rejected for missing the agent setting. Instead, access is governed by the domain-wide delegation settings that your Google Workspace administrator manages. For details on administrator settings, see [Control
  API access with domain-wide
  delegation](https://knowledge.workspace.google.com/admin/apps/control-api-access-with-domain-wide-delegation).
- **Sensitive actions**: Google Workspace MCP servers still return form elicitation prompts for human-in-the-loop confirmation on sensitive tool calls made through domain-wide delegation user impersonation.

### Requests from Apps Script

If you call the MCP server from Apps Script, you can't select
**Use this client for an AI-powered agent** on the default OAuth client that
Apps Script creates and manages for your script. This applies
even if your script uses a [standard Google Cloud
project](https://developers.google.com/apps-script/guides/cloud-platform-projects#standard_cloud_platform_projects).

To call the MCP server from Apps Script, do the following:

1. In the Google Cloud console, go to **Google Auth Platform** \> **Clients** , create an OAuth client, and select **Use this client for an AI-powered agent**.
2. In your script, use the [OAuth2 for Apps Script
   library](https://github.com/googleworkspace/apps-script-oauth2) to authorize users with that OAuth client.
3. When you call the MCP server, send the access token that the library returns instead of the token from `ScriptApp.getOAuthToken`.

Apps Script projects that don't call Google Workspace
MCP servers aren't affected.

### Repeated hourly sign-in prompts

If you're prompted to sign in again about every hour, your MCP client isn't
receiving or using a refresh token. This typically happens in the following
situations:

- **Missing offline access on a Web application OAuth client** : Unlike **Desktop app** OAuth clients, **Web application** OAuth clients default to online access. To request a refresh token, include `access_type=offline` or include the OpenID Connect (OIDC) `offline_access` scope alongside at least one API scope, and don't set `access_type=online`.
- **Re-authorizing an already-consented app** : Google's OAuth 2.0 server issues a refresh token the first time a user grants offline access. If a user already authorized your OAuth client without offline access, or if your MCP client lost its stored refresh token, subsequent sign-ins might not return a new refresh token. Include `prompt=consent` in the authorization request, or remove the app's access in [Google Account connections](https://myaccount.google.com/connections) and sign in again.
- **Static bearer token** : If you pass a raw access token in an `Authorization` header, such as output from `gcloud auth print-access-token`, the token expires after one hour unless your client refreshes it.

For details, see [Refresh an access token](https://developers.google.com/identity/protocols/oauth2/web-server.md.txt#offline).

## Tool reference

The following tools are available for the Tasks MCP server.
For input and output schemas, see the
[Tasks MCP reference](https://developers.google.com/workspace/tasks/reference/mcp):

- [`complete_task`](https://developers.google.com/workspace/tasks/reference/mcp/tools_list/complete_task)
- [`create_task`](https://developers.google.com/workspace/tasks/reference/mcp/tools_list/create_task)
- [`delete_task`](https://developers.google.com/workspace/tasks/reference/mcp/tools_list/delete_task)
- [`get_task`](https://developers.google.com/workspace/tasks/reference/mcp/tools_list/get_task)
- [`list_task_lists`](https://developers.google.com/workspace/tasks/reference/mcp/tools_list/list_task_lists)
- [`list_tasks`](https://developers.google.com/workspace/tasks/reference/mcp/tools_list/list_tasks.md.txt)
- [`uncomplete_task`](https://developers.google.com/workspace/tasks/reference/mcp/tools_list/uncomplete_task)
- [`undelete_task`](https://developers.google.com/workspace/tasks/reference/mcp/tools_list/undelete_task)
- [`update_task`](https://developers.google.com/workspace/tasks/reference/mcp/tools_list/update_task)

## Important security consideration: Indirect prompt injection

When you expose a language model to untrusted data, there is a risk of an
indirect prompt injection attack. Because AI applications like Google
Antigravity have access to powerful tools and APIs through the
Tasks MCP server, they can read, modify, and delete data in
your Google Account.

To mitigate these risks, you must screen prompts and responses for malicious
content or prompt injection attacks. You can use the Google-provided
Model Armor, or you can use your own solution if you document it so
users can accept that risk. For instructions, see
[Configure security for Google Workspace MCP servers](https://developers.google.com/workspace/guides/configure-mcp-security.md.txt).

Follow these best practices:

- **Only use trusted tools.** Never connect the Tasks MCP server to untrusted or unverified applications.
- **Be cautious with untrusted inputs.** Avoid asking your AI application to process tasks or other resources from unverified sources. These inputs might contain hidden instructions that can hijack your session and let an attacker modify, steal, or delete your data.
- **Review all actions.** Always carefully review the actions taken by your AI application on your behalf to make sure they are accurate and match your intentions.

## Handle user approvals with form elicitation

Google Workspace MCP servers use server-driven human-in-the-loop
approvals through [MCP form elicitation](https://developers.google.com/workspace/guides/mcp-elicitation.md.txt) to protect user
data before an AI agent performs sensitive actions, such as sending emails,
modifying shared calendar events, sharing or trashing files, or accessing shared
data.

Choose the endpoint that matches your MCP host's capabilities:

- **`/mcp/v1`** : Recommended primary endpoint for MCP hosts and clients that support form elicitation. Exposes all tools and full result sets for each server. Keep your MCP host's own permission rules and governance policies active. To reduce duplicate prompts, you can optionally adjust your host's generic local confirmation prompts for `/mcp/v1` servers. For details, see [Coordinate local prompts on `/mcp/v1`](https://developers.google.com/workspace/guides/mcp-elicitation.md.txt#avoid-duplicate-prompts).
- **`/mcp/v1self`** : Fallback endpoint for MCP hosts that don't support form elicitation, such as `https://gmailmcp.googleapis.com/mcp/v1self`. Exposes only tools and results that work without form elicitation under default policy, although specific calls might still require approval depending on policy and target resources. The People API and Google Classroom MCP servers don't use form elicitation or provide `/mcp/v1self`.

For endpoint details, approval UI recommendations, and client implementation
steps, see [Handle user approvals with form elicitation](https://developers.google.com/workspace/guides/mcp-elicitation.md.txt).

## Administrator controls and governance

Google Workspace administrators can apply controls and governance to AI
agents that connect to Google Workspace MCP servers or the
[Google Workspace command-line interface](https://developers.google.com/workspace/guides/workspace-cli.md.txt), including
OAuth app access settings, user review policies for external agents, agent
attribution, data loss prevention, and audit logging. Server-side user approvals
work alongside Google Workspace administrator policies and your agent
platform's own permissions and restrictions. A user approval never overrides an
administrator or platform policy block. For details, see
[Manage AI agent access \& user review](https://knowledge.workspace.google.com/admin/apps/control-which-apps-access-google-workspace-data#ai-agents) in
Google Workspace Admin Help,
[Administrator user review policies](https://developers.google.com/workspace/guides/mcp-elicitation.md.txt#admin-policies), and
[How policies and user approvals work together](https://developers.google.com/workspace/guides/mcp-elicitation.md.txt#layered-governance).

## Related topics

- [Use the Google Workspace command-line interface
  (CLI)](https://developers.google.com/workspace/guides/workspace-cli)
- [Handle user approvals with form elicitation](https://developers.google.com/workspace/guides/mcp-elicitation.md.txt)
- [Configure security for Google Workspace MCP servers](https://developers.google.com/workspace/guides/configure-mcp-security.md.txt)
- [Google Workspace MCP servers in Antigravity
  codelab](https://codelabs.developers.google.com/google-workspace-mcp-antigravity#0)
- [List of Google Workspace MCP servers](https://developers.google.com/workspace/guides/configure-mcp-servers.md.txt#support-products)