# GitHub Copilot `GitHub Copilot` is GitHub’s AI pair programmer, available as a CLI and a VS Code extension. Unlike the other MCP clients on this page, these two don’t share a config - the MCP server needs to be registered separately in each. Where you have a choice, register the MCP server with the CLI (`copilot mcp add`): it is the easiest place to apply the authentication options below, and the VS Code extension doesn’t always expose them. These instructions are not exhaustive, and MCP clients change quickly. For the latest options and behavior, check the client’s own documentation. #### NOTE The examples below use `http://localhost:8000/mcp` for a local install. Substitute your MCP server’s actual hostname and port if it differs. ## CLI Requires `GitHub Copilot CLI` installed. #### NOTE This is the basic command, for an MCP server with authentication off. If authentication is enabled, the command may need extra options; see `Authentication` below. Register the MCP server with the `copilot mcp add` command, using `--transport http`: ``` copilot mcp add --transport http OneTick-Cloud http://localhost:8000/mcp ``` This writes an entry to `~/.copilot/mcp-config.json`. Verify it was registered: ``` copilot mcp list ``` To remove it: ``` copilot mcp remove OneTick-Cloud ``` ### Authentication What to add depends on how the MCP server’s inbound auth is set up (`KX_MCP_AUTH`; see `MCP server authentication`). The IDE steps further down take the same options. | Server setup | What to do | |-------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Authentication off | Nothing. Use the command above. | | `jwks` with pre-registration (`Keycloak walkthrough`) | CLI: add an `oauth` block with the client ID to the MCP server’s entry in `~/.copilot/mcp-config.json`. VS Code: set `oauth.clientId` in `mcp.json`, or enter the client ID when prompted. Register the callback URL on the IdP client. See below. | | `jwks` with CIMD | Use pre-registration or `oidc_proxy`. | | `oidc_proxy` or `entra` | Nothing. Copilot discovers the login endpoints itself and opens a browser; the MCP server holds the client credentials. | | Headless or machine caller (no browser) | Add `--header "Authorization: Bearer "`. See below. | ### jwks with pre-registration `copilot mcp add` has no OAuth options, so register the MCP server as above and then add an `oauth` block to its entry in `~/.copilot/mcp-config.json`: ``` { "mcpServers": { "OneTick-Cloud": { "type": "http", "url": "http://localhost:8000/mcp", "oauth": { "clientId": "onetick-mcp", "callbackPort": 8765 } } } } ``` `callbackPort` fixes the port of the loopback callback. The port `8765` in the examples is arbitrary; use any free port and register the matching URI. Copilot’s redirect URI is `http://127.0.0.1:/`: the loopback IP (not `localhost`), the root path and a trailing slash, with no `/callback`. For port `8765`, register `http://127.0.0.1:8765/` on the IdP client; Keycloak matches the URI exactly, so a `/callback` URI registered for another client does not cover it. No client secret is needed for a public client. Then start the login from a Copilot CLI session with `/mcp`. Copilot CLI also asks for the `offline_access` scope on its own. A Keycloak client created in the admin console has it as an optional scope, so the login works. If your Keycloak client does not, Keycloak rejects the login with `Invalid scopes: offline_access`; add `offline_access` to the MCP client’s optional client scopes. To see the redirect URI Copilot is actually using, read the `redirectUri` field of the file for your MCP server under `~/.copilot/mcp-oauth-config/`. That file also holds credentials, so do not share it. #### NOTE An earlier Copilot CLI version ignored `oauth.clientId` and always registered dynamically (`copilot-cli#2717`, since closed). If the saved registration under `~/.copilot/mcp-oauth-config/` shows `"isStatic": false`, the client ID was ignored; update with `copilot update` first. ### Headless callers See `Headless / non-interactive clients` for how to get a token. Pass it as a static header: ``` copilot mcp add --transport http --header "Authorization: Bearer " OneTick-Cloud http://localhost:8000/mcp ``` The token is not refreshed. When it expires, request a new one and re-add the header. ## VS Code Requires `GitHub Copilot` in VS Code, signed in with a GitHub account that has Copilot access, and with agent mode enabled. #### NOTE VS Code does not use the CLI’s registration or `~/.copilot/mcp-config.json`. Register the MCP server again here, in VS Code’s own `mcp.json`, which has a different root key (`servers`) and its own OAuth settings and redirect URIs. 1. Click the **Manage** (gear) icon at the bottom left, then select **Profile (Default) → Profiles**. In the Profiles editor, select your active profile and double-click **MCP Servers** under **Contents**. (For the Default profile this is the user-level `mcp.json`, e.g. `%APPDATA%\Code\User\mcp.json` on Windows.) 2. This either opens `mcp.json`, or reports that the file wasn’t found - if so, click **Create File**. 3. Fill in the MCP server name, description, and URL: ``` { "servers": { "OneTick-Cloud": { "url": "http://localhost:8000/mcp" } }, "inputs": [] } ``` #### IMPORTANT The root key is `servers`, **not** `mcpServers` like Claude Code, Codex, and Cursor use. Copilot silently ignores a config file that uses the wrong key - if the MCP server doesn’t appear, this is the first thing to check. 1. Save the file. This results in an MCP server being enabled: `OneTick-Cloud`. 2. Click **Start**, which appears under the **servers** entry. 3. Verify the MCP server is connected: `Ctrl+Shift+P` → **MCP: List Servers**. 4. Open Chat to use the OneTick tools: press `Ctrl+Shift+P` and run **Chat: Open Chat**. Make sure the chat is in **Agent** mode. ### Authentication in VS Code The table under `Authentication` applies here too; only the details differ. For `jwks` with pre-registration, add an `oauth` block with the client ID to the MCP server’s entry in `mcp.json`: ``` { "servers": { "OneTick-Cloud": { "url": "http://localhost:8000/mcp", "oauth": { "clientId": "onetick-mcp" } } } } ``` Then start the MCP server (step 5). VS Code opens a browser for the login. * **Redirect URI:** VS Code sends `http://127.0.0.1:33418/` (loopback IP, fixed port, trailing slash). Register exactly that on the IdP client; VS Code has no setting to change the port. VS Code’s guidance also lists `https://vscode.dev/redirect`, used when VS Code runs in the browser; register it too if you need that. * **CIMD:** if the IdP advertises CIMD (Keycloak with the `cimd` feature does), VS Code sends its own metadata URL as the client ID and ignores `oauth.clientId`, so the login fails with `client_not_found`. Allow VS Code’s metadata hosts or start Keycloak without `cimd`; see the warning in `IdP setup: Keycloak (jwks)`. * **After changing the IdP or client ID,** VS Code may reuse a cached login. Remove the saved authentication for the MCP server (Command Palette → **Authentication: Manage Dynamic Authentication Providers**, or sign out under the **Accounts** menu), then restart the MCP server entry. * **Headless:** put an `Authorization` header in the entry’s `headers` object, ideally through an `inputs` variable so the token is not stored in the file. See `Headless / non-interactive clients`. ## Using the `OneTick Skill` #### NOTE The skill’s tool calls expect the MCP server to be named exactly `OneTick-Cloud` - which is why it was registered under that name in the steps above. Get the skill by installing the `onetick-knowledge` plugin: ``` copilot plugin marketplace add KxSystems/kx-skills copilot plugin install onetick-knowledge@kx-skills ``` To remove it: ``` copilot plugin uninstall onetick-knowledge@kx-skills copilot plugin marketplace remove kx-skills ``` As with Cursor, when multiple MCP servers of the same name are installed, the Copilot CLI currently gives priority to the plugin version instead of a user installed version. This is documented, intended behavior (`copilot-cli#1839` tracks a request to change it). Due to this, installing the `onetick-knowledge` plugin as-is is not suitable for use with GitHub Copilot at this time, since it bundles a competing `OneTick-Cloud` MCP server that Copilot will always prefer over your self-hosted one. This behaviour may change in future. Instead, the recommended workaround is to create your own Copilot CLI plugin using the `onetick-knowledge plugin` as a reference, pointing its bundled MCP server at your self-hosted server’s URL. This way the plugin’s bundled scripts and custom tools are still picked up, without the name conflict.