# Connect GitHub Copilot coding agent to aicharged.io

> GitHub Copilot coding agent in a repository: MCP configuration in the repo settings and the key as an agent secret.

## At a glance

| Kind | Sign-in | Platforms | Status | Verified |
|---|---|---|---|---|
| AI assistants | API key (Bearer) | Web | works today | 2026-10-22 |

- MCP: `https://aicharged.io/api/v1/mcp`
- Docs: https://docs.github.com/en/copilot

## Recipe

1. In the repository open Settings → Copilot → MCP servers.
2. Paste the MCP configuration below and save.
3. Add the agent secret COPILOT_MCP_AICHARGED_KEY with your API key (the COPILOT_MCP_ prefix is required).

Repository settings → Copilot → MCP servers:

```json
{
  "mcpServers": {
    "aicharged": {
      "type": "http",
      "url": "https://aicharged.io/api/v1/mcp",
      "tools": [
        "*"
      ],
      "headers": {
        "Authorization": "Bearer $COPILOT_MCP_AICHARGED_KEY"
      }
    }
  }
}
```

Agents secret:

```text
COPILOT_MCP_AICHARGED_KEY=<API_KEY>
```

[Client documentation](https://docs.github.com/en/copilot)

## Authentication

- Send `Authorization: Bearer <API_KEY>` with every request. Create a key at https://aicharged.io/admin/account/api-keys.
- OAuth 2.1 (PKCE S256) is available for clients that cannot send a static key (ChatGPT).
- Without a key the endpoint answers 401 with a WWW-Authenticate header that points to https://aicharged.io/.well-known/oauth-protected-resource.

All 51 clients: https://aicharged.io/connect.md

HTML version: https://aicharged.io/connect/copilot-agent
