> 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/gateway.md).

# Gateway

The **Gateway** component registers a deployed [P0 AI Gateway](/readme/agentic-control-plane.md) with P0. Once registered, P0 recognizes the gateway's identity, pushes it the definitions of the [MCP servers](/integrations/resource-integrations/agentic-gateway/mcp-server.md) it should host, and enforces policy at runtime. The gateway ships access logs directly to the system of your choice. You register one Gateway component per gateway deployment.

## Prerequisites

* An existing P0 account at [p0.app](https://p0.app/).
* A deployed P0 AI Gateway. See [Deploying the P0 AI Gateway](/getting-started/deploying-the-p0-mcp-gateway.md). You need the gateway's public URL and its OAuth server endpoint from that deployment.

## Register the gateway

### Through the console

1. Navigate to **Integrations** on [p0.app](https://p0.app) and select **Agentic gateway**, then choose the **Gateway** 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 gateway**.

<figure><img src="/files/KJx3RGpNtWSfLYg68odJ" alt="Gateway component page with an empty list of installed gateways and an Add gateway button"><figcaption></figcaption></figure>

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

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

* **Gateway identifier**: a name for this gateway within P0.
* **Agentic gateway URL**: The public URL where your gateway runs. MCP clients connect to MCP servers through this gateway URL.

4. Enter the **OAuth server endpoint** then click **Finish**:

<figure><img src="/files/otvIucpmE8iaCGwkY8ZI" alt="Second step of gateway configuration showing the read-only gateway URL and the OAuth server endpoint field"><figcaption></figcaption></figure>

* **OAuth server endpoint**: the public URL of your gateway's OAuth server, typically the same as the **Agentic gateway URL**. It must be publicly accessible and serve `.well-known/jwks.json`. P0 uses this endpoint as the gateway's token issuer to verify the requests it receives, so it must exactly match the issuer your deployed OAuth server presents.

5. The gateway now appears with the state **Installed**.

<figure><img src="/files/pUFUd6ZkJqJPoYkt1scJ" alt="Installed gateways list showing the new gateway with state Installed"><figcaption></figcaption></figure>

## How it works

After registration, the gateway periodically calls P0 to sync its configuration. P0 returns the set of [MCP servers](/integrations/resource-integrations/agentic-gateway/mcp-server.md) configured for this gateway, and the gateway reconciles them, adding newly configured servers and removing ones that are no longer configured. No servers are available through the gateway until you configure them.

## Next steps

* Configure the [MCP servers](/integrations/resource-integrations/agentic-gateway/mcp-server.md) this gateway should front.
* [Connect an MCP client to the P0 AI Gateway](/integrations/resource-integrations/agentic-gateway/connect-an-mcp-client.md).
