# Use the Android Management API MCP server

> [!WARNING]
> **Preview**
>
> This product or feature is in preview. Products and features that are
> in preview are available "as is".

This document shows you how to use the Android Management API remote Model Context Protocol (MCP) server to connect with AI applications including Antigravity, ChatGPT, Claude, and custom applications you are developing. The Android Management API remote MCP server enables AI agents to programmatically access enterprise mobility data. It allows for natural language queries about device fleets, automated auditing of policy compliance, and the integration of device management data into broader automated workflows. The Android Management API remote MCP server is enabled when you enable the Android Management API API.

[Model Context Protocol](https://modelcontextprotocol.io/docs/getting-started/intro)
(MCP) standardizes how large language models (LLMs) and AI applications or
agents connect to external data sources. MCP servers let you use their tools,
resources, and prompts to take actions and get updated data from their backend
service.

## What's the difference between local and remote MCP servers?

Local MCP servers
:   Typically run on your local machine and use the standard input
    and output streams (stdio) for communication between services on the same
    device.

Remote MCP servers
:   Run on the service's infrastructure and offer an HTTP
    endpoint to AI applications for communication between the AI MCP client and
    the MCP server. For more information about MCP architecture, see
    [MCP architecture](https://modelcontextprotocol.io/docs/learn/architecture).

## Stateless core

With
[MCP version 2026-07-28](https://modelcontextprotocol.io/specification/2026-07-28),
MCP changes from a bidirectional, stateful protocol to a stateless protocol.
Each MCP request is self-describing and can be routed using headers. There isn't
a need for the `initialize`/`initialized` handshake or `Mcp-Session-Id` because
each request includes all the information needed in HTTP headers or the `_meta`
parameter. MCP servers can request additional information required by a tool
through
[multi-round-trip requests (MRTR)](https://modelcontextprotocol.io/specification/latest/basic/patterns/mrtr).

To help route and process requests without parsing the request body, some MCP
headers are required, including the following:

- Headers that are required by the MCP specification such as the [protocol version header](https://modelcontextprotocol.io/specification/latest/basic/transports/streamable-http#protocol-version-header) and [standard request headers](https://modelcontextprotocol.io/specification/latest/basic/transports/streamable-http#standard-request-headers).
- [Custom headers](https://modelcontextprotocol.io/specification/latest/basic/transports/streamable-http#custom-headers-from-tool-parameters) that are defined by the MCP server. These headers are mirrored into HTTP headers from the tool's input schema using the `x-mcp-header` property. For example, an MCP server might define a custom header to specify the Google Cloud region or project ID.

For more information about MCP architecture, see the MCP version 2026-07-28
[specification](https://modelcontextprotocol.io/specification/2026-07-28) and
[key changes](https://modelcontextprotocol.io/specification/2026-07-28/changelog).

## Before you begin

To use the Android Management API remote MCP server, you must create a Google Cloud
project and enable the Android Management API.

1. In your Cloud console, on the project selector page, select or create a Google Cloud project.

   [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)
2.


   Enable the Android Management API, if it is not already enabled.


   **Roles required to enable APIs**


   To enable APIs, you need the `serviceusage.services.enable` permission. If you
   created the project, then you likely already have this permission through the
   Owner role (`roles/owner`). Otherwise, you can get this permission through the
   Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`).
   [Learn how to grant roles](https://developers.google.com/iam/docs/granting-changing-revoking-access).

   [Enable the API](https://console.cloud.google.com/apis/enableflow?apiid=androidmanagement.googleapis.com)

### Required roles

To get the permissions that you need to use the Android Management API remote MCP
server, ask your admin to grant you the following Identity and Access Management
roles on the Google Cloud project where you want to enable the Android Management API
MCP server:

- Access Android Management resources: [Android Management User](https://docs.cloud.google.com/iam/docs/roles-permissions/androidmanagement#androidmanagement.user) (`roles/androidmanagement.user`)

For more information about granting roles, see
[Manage access to projects, folders, and organizations](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access).

These predefined roles contain the permissions required to use the
Android Management API remote MCP server. To see the exact permissions that are
required, expand the **Required permissions** section.

#### Required permissions

The following permissions are required to use the Android Management API remote
MCP server:

- Access Android Management resources:
  - `androidmanagement.enterprises.get`
  - `androidmanagement.devices.list`

You might also be able to get these permissions with
[custom
roles](https://docs.cloud.google.com/iam/docs/creating-custom-roles) or other
[predefined
roles](https://docs.cloud.google.com/iam/docs/roles-overview#predefined).

## Authentication and authorization

Android Management API MCP servers use the
[OAuth 2.0](https://developers.google.com/identity/protocols/oauth2)
protocol with
[Identity and Access Management](https://cloud.google.com/iam/docs/overview)
for authentication and authorization. All
[Google Cloud identities](https://cloud.google.com/docs/authentication/identity-products)
are supported for authentication to MCP servers.

The Android Management API remote MCP server does not accept API keys.

We recommend creating a separate identity for agents using MCP tools so that
access to resources can be controlled and monitored. For more information on
authentication, see [Authenticate to MCP servers](https://docs.cloud.google.com/mcp/authenticate-mcp).

## Android Management API MCP OAuth scopes

OAuth 2.0 uses scopes and credentials to determine if an authenticated
principal is authorized to take a specific action on a resource. For more
information about OAuth 2.0 scopes at Google, read
[Using OAuth 2.0 to access Google APIs](https://developers.google.com/identity/protocols/oauth2).

Android Management API has the following MCP tool OAuth scopes:

| Scope URI for gcloud | Description |
|---|---|
| `https://www.googleapis.com/auth/androidmanagement` | Manage Android devices and apps. |

Additional scopes might be required on the resources accessed during a tool
call. To view a list of scopes required for
Android Management API, see
[Android Management API](https://developers.google.com/identity/protocols/oauth2/scopes#androidmanagement).

## Configure an MCP client to use the Android Management API MCP server

AI applications and agents, such as Claude or Antigravity, can instantiate an MCP client that connects to a single MCP server. An AI application can have multiple clients that connect to different MCP servers. If your application isn't listed in the [client-specific guidance](https://docs.cloud.google.com/mcp/configure-mcp-ai-application#client-specific-guidance), then you can use the following information to connect from most applications.

In your AI application, look for a way to add or connect to a remote MCP server.
For the Android Management API MCP server, enter the following
information as required:

- **Server name**: Android Management API MCP server
- **Server URL** or **Endpoint**: https://androidmanagement.googleapis.com/mcp
- **Transport** : [Streamable HTTP](https://modelcontextprotocol.io/specification/latest/basic/transports/streamable-http)
- **Authentication details** : Depending on how you want to authenticate, you can enter your Google Cloud credentials, your OAuth Client ID and secret, or an agent identity and credentials. For more information about authentication, see [Authenticate to MCP servers](https://docs.cloud.google.com/mcp/authenticate-mcp).
- **OAuth scope**: the \[OAuth 2.0 scope\]\[oauth-scopes-overview\] that you want to use when connecting to the Android Management API MCP server.

For application-specific guidance about setting up and connecting to MCP server, see [Client-specific guidance](https://docs.cloud.google.com/mcp/configure-mcp-ai-application#client-specific-guidance).

For more general guidance, see the following resources:

- [Connect to remote MCP servers](https://modelcontextprotocol.io/docs/develop/connect-remote-servers).
- [Configure MCP in an AI application](https://docs.cloud.google.com/mcp/configure-mcp-ai-application).

## Available tools

To view details of available MCP tools and their descriptions for the
Android Management API MCP server, see the
[Android Management API MCP reference](https://developers.google.com/android/management/reference/mcp).

### List tools

Use the [MCP inspector](https://modelcontextprotocol.io/docs/tools/inspector) to list tools, or send a
`tools/list` HTTP request directly to the Android Management API
remote MCP server. The `tools/list` method doesn't require authentication.

    curl -X POST https://androidmanagement.googleapis.com/TOOLSET_ENDPOINT \
        -H 'Content-Type: application/json' \
        -H 'Accept: application/json' \
        -H 'MCP-Protocol-Version: MCP_PROTOCOL_VERSION' \
        -H 'Mcp-Method: tools/list' \
        -d '{
          "jsonrpc": "2.0",
          "id": 1,
          "method": "tools/list",
          "params": {
            "_meta": {
              "io.modelcontextprotocol/protocolVersion": "MCP_PROTOCOL_VERSION",
              "io.modelcontextprotocol/clientCapabilities": {
                "extensions": {
                  "io.modelcontextprotocol/ui": {
                    "mimeTypes": ["text/html;profile=mcp-app"]
                  }
                }
              }
            }
          }
        }'

Replace the following:

- <var translate="no">`TOOLSET_ENDPOINT`</var>: the remainder of the MCP endpoint after the service name. For example, for Android Management API, this might be `mcp/toolset-name`.
- <var translate="no">`MCP_PROTOCOL_VERSION`</var>: the MCP protocol version. For example, `2026-07-28`.

## Sample use cases

The following are sample use cases for the Android Management API MCP server:

- **Natural Language Queries:** Ask complex questions about your device fleet without writing code---for example, "Which of my devices are not compliant with the latest security patch?"
- **Automated Audits:** Periodically fetch data and compile reports on device status and policy adherence.
- **Intelligent Alerting:** Monitor fleet data to flag anomalies or potential issues based on real-time insights.

### Sample prompts

You can use the following sample prompts to get information about
Android Management API resources:

- List the devices in enterprise <var translate="no">`ENTERPRISE_ID`</var>.
- Get details for device <var translate="no">`DEVICE_ID`</var> in enterprise <var translate="no">`ENTERPRISE_ID`</var>.
- Show the policy details for policy <var translate="no">`POLICY_NAME`</var>.
- Which applications are available in enterprise <var translate="no">`ENTERPRISE_ID`</var>?

In the prompts, replace the following:

- <var translate="no">`ENTERPRISE_ID`</var>: the resource name of the enterprise---for example, `enterprises/LC012345`.
- <var translate="no">`DEVICE_ID`</var>: the resource name of the device.
- <var translate="no">`POLICY_NAME`</var>: the resource name of the policy.

## Optional security and safety configurations

MCP introduces new security risks and considerations due to the wide variety of
actions that can be taken with MCP tools. To minimize and manage these risks,
Google Cloud offers defaults and customizable policies to
control the use of MCP tools in your Google Cloud
organization or project.

For more information about MCP security and governance, see
[AI security and safety](https://docs.cloud.google.com/mcp/ai-security-safety).

## What's next

- Read the [Android Management API MCP reference documentation](https://developers.google.com/android/management/reference/mcp).
- Learn more about [Google Cloud MCP servers](https://docs.cloud.google.com/mcp/overview).