> For the complete documentation index, see [llms.txt](https://docs.edgegap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgegap.com/docs/mcp-integration.md).

# MCP Integration

Connect AI coding agents to Edgegap through MCP servers, exposing a troubleshooting toolkit for your game server deployments.

MCP servers expose a convenient troubleshooting toolkit for your custom coding AI agents.

## 👉 Supported Features

{% hint style="success" %}
**New users - start with** [Unity](/unity.md)**,** [Unreal Engine](/unreal-engine.md)**, or** [Godot](/godot.md)**.** Using MCP server is recommended only after you have a working containerized game server uploaded to a container registry.
{% endhint %}

Use our MCP server when:

* **Containerizing your game server** - your agent writes a Dockerfile for your build (or checks the one you have) against Edgegap's requirements, then pushes the image to your private Edgegap container registry.
* **Deploying a dedicated server** - create an application and version, deploy close to your players, and get the connection details.
* **Building a CI/CD pipeline** - test your deployments and teardown from a build system.
* **Troubleshooting a game server issue** with your own coding agent: inspecting app versions and deployment status, reading container logs, or reproducing a failed deployment.
* **Running a host-client game** - create a relay session if your game is built with one player as host. See [Dedicated Servers or Relays?](https://github.com/edgegap/edgegap-mcp#dedicated-servers-or-relays) first.

{% hint style="warning" %}
Out of scope / not supported by MCP: building server linux executable; configuring matchmaking; server browser; lobbies; managed clusters; private fleets; relays; or billing.
{% endhint %}

{% hint style="info" %}
If you need help, [please reach out to us over Discord](https://discord.gg/MmJf8fWjnt). For live games support see our [ticketing system](https://edgegap.atlassian.net/servicedesk/customer/portal/3).
{% endhint %}

### Example prompts

* *"Write a Dockerfile for my three.js server build, then push it and deploy a server near me."*
* *"Check my Dockerfile for Edgegap and fix any problems."*
* *"My deployment failed. Read the logs and tell me why."*
* *"My game uses host-client networking. Set up an Edgegap relay for two players."*

## 🚀 Installation

MCP server installation is very simple:

1. Install the MCP server for [#popular-agents](#popular-agents "mention") or with [#custom-integration](#custom-integration "mention").
2. Generate and attach an API token for your agent to use with our MCP server:

Generate (and view) your secret tokens for Edgegap API in [Dashboard - User Settings / Tokens](https://app.edgegap.com/user-settings?tab=tokens).

Add your secret token with each API request as an HTTP header (include the word `token`):

`Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`

{% hint style="danger" %}
**Do not integrate Edgegap API endpoints in game client, as your API token provides unlimited access to your account. See** [Integration](/docs/api/integration.md) **for secure client-facing API endpoints and functions.**
{% endhint %}

{% hint style="success" %}
In case your secret tokens are compromised or leaked, delete and re-create them from dashboard.
{% endhint %}

### Popular Agents

Install Edgegap MCP server in your preferred agentic IDE: <a href="cursor://anysphere.cursor-deeplink/mcp/install?name=Edgegap&#x26;config=eyJ1cmwiOiJodHRwczovL21jcC5lZGdlZ2FwLmRldi9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiIifX0%3D" class="button secondary" data-icon="cursor">Cursor</a><a href="vscode:mcp/install?%7B%22name%22%3A%22Edgegap%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.edgegap.dev%2Fmcp%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22%22%7D%7D" class="button secondary" data-icon="vscode">VS Code</a>

#### Claude Code

```bash
claude mcp add --transport http edgegap https://mcp.edgegap.dev/mcp \
  -H "Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62" --scope user
```

#### ChatGPT Codex

```bash
codex mcp add edgegap --url https://mcp.edgegap.dev/mcp
```

#### mcp.json

Most agentic IDEs also support integration by pasting JSON configuration:

{% code title="mcp.json" %}

```json
{
    "mcpServers": {
        "Edgegap": {
            "type": "http",
            "url": "https://mcp.edgegap.dev/mcp",
            "headers": {
                "Authorization": "token xxxxxxxx-e458-4592-b607-c2c28afd8b62"
            }
        }
    }
}
```

{% endcode %}

### Custom Integration

The official repository is the single source of truth for custom integration of our MCP server:

{% embed url="<https://github.com/edgegap/edgegap-mcp>" %}

Install remote Edgegap MCP server in your agent's virtualized environment (never in your project!):

{% code title="node using npx package" %}

```json
{
  "command": "npx",
  "args": ["-y", "mcp-remote", "https://mcp.edgegap.dev/mcp", "--transport", "http-only"]
}
```

{% endcode %}

{% code title="python using uvx package" %}

```json
{
  "command": "uvx",
  "args": ["mcp-proxy", "--transport", "streamablehttp", "https://mcp.edgegap.dev/mcp"]
}
```

{% endcode %}

## 🚨 Troubleshooting

Review common error codes and learn how to unlock your integration.

### 401 Unauthorized

Your MCP integration is most likely not including the Authorization header correctly.

### 403 Forbidden

Your MCP integration is likely using the template token or a deleted token. Please validate that the token value used by your integration matches exactly the token displayed in dashboard.

### 424 Image Could Not Be Pulled

Edgegap could not pull your container image. Check the repository, image name, and tag, and if the tag was pushed (ask your agent to list registry tags). For images in the Edgegap registry, the image name must include your project, e.g. `my-project/my-game-server`.

### Registry Credentials Unavailable

If your agent can't retrieve registry credentials, [request them in the dashboard under **Container Registry**](https://app.edgegap.com/registry-management/repositories/list), or push to another registry Edgegap can pull from (Docker Hub, GitHub, AWS ECR, GCP, GitLab). See [External Registries](https://docs.edgegap.com/docs/tools-and-integrations/docker/external-registries).

### Server Starts Locally but Not on Edgegap

Ask your agent to validate your server configuration, or to generate a new Dockerfile. The most common causes are an image built on Apple Silicon without `docker build --platform linux/amd64`, a server listening on a different port than the version exposes, or a UDP transport configured as TCP.

### Other API Errors

Please consult our [API Reference](/docs/api.md) for possible error responses for individual API endpoints.

{% hint style="info" %}
If you need help, [please reach out to us over Discord](https://discord.gg/MmJf8fWjnt). For live games support see our [ticketing system](https://edgegap.atlassian.net/servicedesk/customer/portal/3).
{% endhint %}
