This document shows you how to use the Network Management API remote MCP
server to create, view, and delete
[Connectivity Tests](https://docs.cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/overview).
The Network Management API remote MCP server is enabled when you enable the Network 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).

## Google and Google Cloud remote MCP servers

Google and Google Cloud remote MCP servers have the following features and benefits:

<br />

- Simplified, centralized discovery
- Managed global or regional HTTP endpoints
- Fine-grained authorization
- Optional prompt and response security with Model Armor protection
- Centralized audit logging

For information about other MCP servers and information about security
and governance controls available for Google Cloud MCP servers,
see [Google Cloud MCP servers overview](https://docs.cloud.google.com/mcp/overview).

## Before you begin

Make sure you have the following IAM roles.

### Required roles


To get the permissions that
you need to use the Network Management API MCP server,

ask your administrator to grant you the
following IAM roles on the project where you want to use the MCP server:

- Make MCP tool calls: [MCP Tool User](https://docs.cloud.google.com/iam/docs/roles-permissions/mcp#mcp.toolUser) (`roles/mcp.toolUser`)
- Perform all operations on a connectivity test: [Network Management Admin](https://docs.cloud.google.com/iam/docs/roles-permissions/networkmanagement#networkmanagement.admin) (`roles/networkmanagement.admin`)
- Get and list connectivity tests: [Network Management Viewer](https://docs.cloud.google.com/iam/docs/roles-permissions/networkmanagement#networkmanagement.viewer) (`roles/networkmanagement.viewer`)
- Run a connectivity test against specific Google Cloud resources: [Compute Network Viewer](https://docs.cloud.google.com/iam/docs/roles-permissions/compute#compute.networkViewer) (`roles/compute.networkViewer`)


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 Network Management API 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 Network Management API MCP server:

- Make MCP tool calls: `mcp.tools.call`
- Create connectivity tests: `networkmanagement.connectivitytests.create`
- Get a connectivity test: `networkmanagement.connectivitytests.get`
- List connectivity tests: `networkmanagement.connectivitytests.list`
- Delete a connectivity test: `networkmanagement.connectivitytests.delete`


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).
To see the exact permissions and roles that are required to run connectivity tests, see [Permissions](https://docs.cloud.google.com/network-intelligence-center/docs/connectivity-tests/concepts/access-control#permissions).

<br />

## Authentication and authorization

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

The Network Management API remote MCP server doesn't accept API keys.

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

## Network 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).

Network Management API uses the
[`https://www.googleapis.com/auth/cloud-platform` OAuth scope](https://developers.google.com/identity/protocols/oauth2/scopes#networkmanagement).

Additional scopes might be required on the resources accessed during a tool
call.

## Configure an MCP client to use the Network 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 Network Management API MCP server, enter the following
information as required:

- **Server name**: Network Management API MCP server
- **Server URL** or **Endpoint** : `https://networkmanagement.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](https://developers.google.com/identity/protocols/oauth2/scopes) to use when connecting to the Network Management API MCP server. Enter `https://www.googleapis.com/auth/cloud-platform`.

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
Network Management API MCP server, see the
[Network Management API MCP reference](https://docs.cloud.google.com/network-intelligence-center/docs/reference/networkmanagement/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 Network Management API
remote MCP server. The `tools/list` method doesn't require authentication.

    curl -X POST https://networkmanagement.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 Network Management API, this might be `mcp/toolset-name`.
- <var translate="no">`MCP_PROTOCOL_VERSION`</var>: the MCP protocol version. For example, `2026-07-28`.

## Example use cases

The following are example use cases for the Network Management API
MCP server:

- Create a connectivity test
- Get and list connectivity tests
- Delete a connectivity test

Example prompt:

"Run a connectivity test from `vm-1` to `vm-2` on port 22 using
the Network Management API MCP server."

After the test is created, follow the prompts to view and then delete the
test resource.

How to interpret results:

- **Reachability result** : a value of `REACHABLE` in `reachabilityDetails` indicates that the network configuration allows traffic.
- **Probing result** : a value of `REACHABLE` in `probingDetails` confirms that the active probes sent between the endpoints were successful.
- **Traces**: review the hop-by-hop trace to see which resources were included in the test.

## Optional security and safety configurations

MCP introduces new security risks and considerations due to the wide variety of
actions that you can do with the MCP tools. To minimize and manage these risks,
Google Cloud offers default settings 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 [Network Management API MCP reference documentation](https://docs.cloud.google.com/network-intelligence-center/docs/reference/networkmanagement/mcp)
- Learn more about [Google Cloud MCP servers](https://docs.cloud.google.com/mcp/overview)