View
Apigee Edge documentation.
This page describes how to use the Apigee Discovery proxy to make your APIs available to Model Context Protocol (MCP) clients in agentic applications as MCP tools.
Before you begin, complete the following tasks:
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
Verify that billing is enabled for your Google Cloud project.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
roles/resourcemanager.projectCreator), which contains the
resourcemanager.projects.create permission. Learn how to grant
roles.
Verify that billing is enabled for your Google Cloud project.
To get the permissions that
you need to create and deploy an MCP Discovery Proxy,
ask your administrator to grant you the
Apigee Admin (roles/apigee.admin) IAM role on the service account you use to deploy Apigee proxies.
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Enable the Apigee API.
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.
In the Google Cloud project that contains your Apigee instance, use the following command to set environment variables:
export PROJECT_ID=PROJECT_IDexport REGION=REGIONexport RUNTIME_HOSTNAME=RUNTIME_HOSTNAME
Where:
PROJECT_ID is the ID of the project with your Apigee instance.REGION is the Google Cloud region of your Apigee instance.RUNTIME_HOSTNAME is the hostname of your Apigee runtime.To confirm that the environment variables are set correctly, run the following command and review the output:
echo $PROJECT_ID $REGION $RUNTIME_HOSTNAME
Set the Google Cloud project in your development environment:
gcloud auth logingcloud config set project $PROJECT_ID
To expose your APIs as MCP tools using Apigee, you create and deploy a new Apigee proxy using the MCP Discovery Proxy template. After your proxy is deployed, you can create an API product to bundle the MCP API operations in your proxy into an API product. As an API product, your API operations/tools are discoverable by MCP clients through integration into API hub.
The following sections describe the steps to create and deploy an MCP Discovery Proxy, create an API product, and list available tools:
Before you create and deploy your MCP Discovery Proxy, you need to create an OpenAPI 3.0.x specification that describes the API operations that you want to expose as MCP tools. MCP in Apigee supports the following OpenAPI versions:
This quickstart uses a sample OpenAPI 3.0.x specification with three API operations:
GET /artists: Returns a list of artists.POST /artists: Lets a user post a new artist.GET /artists/{username}: Obtain information about an artist from his or her unique username.To create the OpenAPI 3.0.x specification, do the following:
mcp-quickstart-openapi.yaml file in the oas directory
of your API proxy bundle.# mcp-quickstart-openapi.yaml --- openapi: 3.0.3 info: title: Cymbal Group Products API description: This is the official API for managing the artists for Cymbal Group Products. version: 1.0.0 servers: - url: https://cymbal.products.com description: Cymbal Group Production Server - url: https://internal.products.com description: Cymbal Group internal Server paths: /artists: get: description: Returns a list of artists operationId: listArtists parameters: - name: limit in: query description: Limits the number of items on a page schema: type: integer - name: offset in: query description: Specifies the page number of the artists to be displayed schema: type: integer responses: "200": description: An array of artists content: application/json: schema: type: array items: $ref: "#/components/schemas/Artist" post: summary: Create a new artist operationId: createArtist tags: - artists requestBody: description: The artist to create. required: true content: application/json: schema: $ref: "#/components/schemas/Artist" responses: "201": description: The newly created artist profile content: application/json: schema: $ref: "#/components/schemas/Artist" "400": description: Invalid username supplied /artists/{username}: get: summary: Info for a specific artist operationId: showArtistByUsername tags: - artists parameters: - name: username in: path required: true description: The username of the artist to retrieve schema: type: string responses: "200": description: Expected response to a valid request content: application/json: schema: $ref: "#/components/schemas/Artist" "404": description: Artist not found components: securitySchemes: bearerAuth: type: http scheme: bearer oauth2: type: oauth2 flows: authorizationCode: authorizationUrl: /oauth/authorize tokenUrl: /oauth/token scopes: artists.read: Grants read access artists.write: Grants write access schemas: Artist: type: object required: - id properties: id: type: string format: uuid description: Unique identifier for the artist
It is critical that the value of the hostname in the servers.url field of the OpenAPI specification is an exact match for the environment group hostname
of the Apigee environment where the MCP Discovery Proxy is deployed.
This match is required for the tools/list and tools/call calls to function correctly.
The following table shows the hostname configuration in the OpenAPI specification and the corresponding hostname configuration in the Apigee environment group:
| Component | Required Configuration | Example Value | Supporting Information |
|---|---|---|---|
| Apigee Environment Group | Hostnames must be configured in the environment group. | cymbal.products.com, internal.products.com |
Environment groups enable routing to a group of environments using a hostname. |
| OpenAPI Specification | The value of the servers.url field of the OpenAPI specification must be an exact match for the environment group hostname
of the Apigee environment where the MCP Discovery Proxy is deployed. |
https://cymbal.products.com |
If the servers.url host name does not match the hostname of the environment group corresponding
to the Apigee environment where the MCP Discovery Proxy is deployed, you will get an error when deploying the proxy. |
Now that you have an OpenAPI 3.0.x specification defining your API operations, you can create a new API proxy using the MCP Discovery Proxy template.
To create an MCP Discovery Proxy:
My first MCP Discovery Proxy.You can view the proxy's target and server endpoints by clicking View in the Endpoint summary column of the Revisions table. The Revision endpoint summary for the proxy revision you select displays the following information:
default proxy endpoint with a base path of /mcp displays. If additional hostnames or
environment groups are added to the proxy, those will also display here.default target connection is set to ORG_NAME.mcp.apigee.internal, where ORG_NAME is the name of your Apigee organization.
The target mcp.apigee.internal is also supported for backward compatibility.Before deploying your MCP Discovery Proxy, you can add security policies to enforce security requirements. We recommend that you secure access to your MCP Discovery Proxy using Oauth tokens or an API key.
This section describes how to add an OAuthV2 policy to the MCP Discovery Proxy. This ensures that all requests to the MCP Discovery Proxy are authenticated and authorized. If you want to use an API key instead, see Secure an API by requiring API keys for the recommended steps.
To configure token verification, place an OAuthV2 policy with the VerifyAccessToken operation at the very beginning of the API proxy flow (the beginning of the ProxyEndpoint Preflow). If placed there, access tokens are verified before any other processing takes place, and if a token is rejected, Apigee stops processing and returns an error to the client.
To add the VerifyAccessToken policy:
In the proxy flow editor, click Add policy step.

To deploy the MCP Discovery Proxy:
When you click Deploy, Apigee begins deploying the proxy and provisioning downstream components. During this time, which may take several minutes, the UI will show a Provisioning status for the deployment.
When the process is complete, the status changes to Deployed and the proxy is ready to handle traffic.
After the proxy is deployed, confirm that the value of the hostname in the servers.url field of the OpenAPI specification is an exact match for the environment group hostname
of the Apigee environment where the MCP Discovery Proxy is deployed.
Once your MCP Discovery Proxy is deployed, its API operations are automatically ingested into API hub and made discoverable as MCP tools.
To view your MCP tools in API hub:
Developers in your organization can now use filters or Semantic Search in API Hub to find relevant MCP tools using natural language queries.
In this step, you send a request to your MCP endpoint to initialize your MCP server and confirm that it is working as expected.
To initialize and test your MCP server, send the following request to your MCP endpoint:
curl -X POST "https://MCP_ENDPOINT_URL/mcp" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "MCP_PROTOCOL_VERSION" } }' \ -H "Authorization: Bearer TOKEN"
Replace the following:
MCP_ENDPOINT_URL: your MCP endpoint base URI. For example, cymbal.products.com.MCP_PROTOCOL_VERSION: the MCP protocol version. For example, 2025-11-25. See
Version Negotiation in the MCP specification for more information.TOKEN: OAuth 2.0 access tokenA successful response looks similar to the following:
{
"id":1,
"jsonrpc":"2.0",
"result":
{
"capabilities":
{
"tools":
{
"listChanged":false
}
},
"protocolVersion":"2025-11-25",
"serverInfo":
{
"name":"cymbal.products.com",
"version":"1.0.0"
}
}
}In this step, you send a request to the tools/list method to confirm the list of tools available in your MCP endpoint.
Send a request to the tools/list method for your Apigee proxy:
curl -X POST "https://MCP_ENDPOINT_URL/mcp" \ -H "Content-Type: application/json" \ -H "MCP-Protocol-Version: MCP_PROTOCOL_VERSION" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {} }' \ -H "Authorization: Bearer TOKEN"
Replace the following:
MCP_ENDPOINT_URL: your MCP endpoint base URI. For example, cymbal.products.com.MCP_PROTOCOL_VERSION: the MCP protocol version. For example, 2025-11-25.
See Protocol version header in the MCP specification for more information.TOKEN: OAuth 2.0 access tokenThe method returns all the tools that the MCP endpoint supports. A successful response looks similar to the following:
{ "id": 1, "jsonrpc": "2.0", "result": { "tools": [ { "description": "Returns a list of artists", "inputSchema": { "properties": { "id": { "description": "Unique identifier for the artist", "format": "uuid", "type": "string" } }, "type": "object" }, "name": "listArtists" }, { "description": "Create a new artist", "inputSchema": { "properties": { "id": { "description": "Unique identifier for the artist", "format": "uuid", "type": "string" } }, "type": "object" }, "name": "createArtist" }, { "description": "Info for a specific artist", "inputSchema": { "properties": { "id": { "description": "Unique identifier for the artist", "format": "uuid", "type": "string" } }, "type": "object" }, "name": "showArtistByUsername" } ] } }
Now that your endpoint is initialized, your MCP tools are discoverable by developers and agents using your API product.
You can monitor MCP traffic and view tool-level metrics using Apigee Analytics.
Apigee Analytics allows you to filter metrics to distinguish between standard API traffic and
MCP-specific traffic, and to see usage volume for tools/list versus
tools/call requests. For more information, see
Monitor and analyze MCP traffic in Apigee.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-07-23 UTC.