> For the complete documentation index, see [llms.txt](https://docs.p0.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.p0.dev/integrations/resource-integrations/agentic-gateway/mcp-server.md).

# MCP server

The **MCP server** component configures an upstream MCP server behind the [P0 AI Gateway](/readme/agentic-control-plane.md). Once an MCP server is configured, it is available to agents through the gateway. Every tool call is authenticated and checked against policy before reaching the upstream server.

## Prerequisites

* A registered [Gateway](/integrations/resource-integrations/agentic-gateway/gateway.md) component, and the gateway deployed in your environment. See [Deploying the P0 AI Gateway](/getting-started/deploying-the-p0-mcp-gateway.md).

## Types of MCP server

When you add a server, you set its **Definition**: a server predefined by P0, or a custom server you define yourself.

| Server                                                                                 | Type       | Description                                                                                                                                                                                         |
| -------------------------------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**AWS**](/integrations/resource-integrations/agentic-gateway/mcp-server/aws.md)       | Predefined | Exposes the AWS CLI to agents. Requires the [AWS OIDC](/integrations/resource-integrations/aws/aws-oidc.md) component.                                                                              |
| [**GCP**](/integrations/resource-integrations/agentic-gateway/mcp-server/gcp.md)       | Predefined | Exposes Google Cloud APIs to agents, with one server per Google Cloud service. Requires a [GCP Workload Identity Federation](/integrations/resource-integrations/google-cloud/gcp-wif.md) provider. |
| [**Custom**](/integrations/resource-integrations/agentic-gateway/mcp-server/custom.md) | Custom     | A server you define yourself, for any MCP server P0 does not ship a predefined definition for.                                                                                                      |

## Add an MCP server

Every MCP server starts with the same steps. The final configuration screen differs by server. Continue to the [AWS](/integrations/resource-integrations/agentic-gateway/mcp-server/aws.md), [GCP](/integrations/resource-integrations/agentic-gateway/mcp-server/gcp.md), or [Custom](/integrations/resource-integrations/agentic-gateway/mcp-server/custom.md) page once you reach it.

1. Navigate to **Integrations** on [p0.app](https://p0.app) and select **Agentic gateway**, then choose the **MCP server** component.

<figure><img src="/files/pkU6FQYexOfbjEM7YBV3" alt="Agentic gateway integration page listing the Gateway and MCP server components, not installed"><figcaption></figcaption></figure>

2. Click **Add server**.

<figure><img src="/files/1lDp6Mn8SDC8m94CH7du" alt="MCP server component page with an empty list of installed servers and an Add server button"><figcaption></figcaption></figure>

3. Enter the server details, then click **Next**:

<figure><img src="/files/zQaPomyHP0PvYQtmbcwP" alt="Form for installing a new server with fields for server identifier and gateway"><figcaption></figcaption></figure>

* **Server identifier**: a name for this server within P0.
* **Gateway**: the [registered gateway](/integrations/resource-integrations/agentic-gateway/gateway.md) that hosts this server.

4. Set the **Credential source**, which selects how the gateway authenticates to the upstream:
   * [**AWS IAM federation**](/integrations/resource-integrations/aws/aws-oidc.md)
   * [**GCP WIF federation**](/integrations/resource-integrations/google-cloud/gcp-wif.md)
   * **OAuth**
5. Set the **Definition**, which selects what the server actually exposes:
   * **P0**: a predefined server. Continue to its page, [AWS MCP server](/integrations/resource-integrations/agentic-gateway/mcp-server/aws.md) or [GCP MCP server](/integrations/resource-integrations/agentic-gateway/mcp-server/gcp.md).
   * **Custom**: a server you define yourself. See [Custom MCP server](/integrations/resource-integrations/agentic-gateway/mcp-server/custom.md).

### Configure with Terraform

Use the P0 Terraform provider to configure an MCP server outside the console. The [`p0_agentic_server`](https://registry.terraform.io/providers/p0-security/p0/latest/docs/resources/agentic_server) resource takes the hosting gateway's `id`, the server's own `id`, a `definition` (`p0` or `custom`), and a `credential` source (`aws`, `gcp`, or `oauth`) — the same choices as the console fields described earlier.

## Related docs

* [Connect an MCP client to the P0 AI Gateway](/integrations/resource-integrations/agentic-gateway/connect-an-mcp-client.md): Learn how to register a client and connect an agent to an MCP server through the gateway.
* [Use MCP servers with Claude Code](/integrations/resource-integrations/agentic-gateway/using-mcp-servers.md): Connect Claude Code to MCP servers managed by P0.
