
Connexion avec GitHub Copilot CLI
GitHub Copilot CLI — copilot in the terminal, with MCP via command or file.
Ce contenu est disponible en anglais.
Quel MCP allez-vous connecter ? Les commandes ci-dessous s'adaptent à votre choix.
- 1
Install the Copilot CLI
Requires Node.js 22 or later. Via npm, on any system:
npm install -g @github/copilotRésultat attendu : On Windows there's also winget install GitHub.Copilot; on macOS and Linux, brew install --cask copilot-cli.
- 2
Open it and sign in
Run copilot in the terminal. On the first run, use /login to sign in with your GitHub account.
copilot - 3
Generate your API key
Sign in to app.newalgorithm.io with your account, open Keys & apps and generate a key. It is shown only once: copy it and store it somewhere safe.
Key formatna_live_xxxxxxxxxxxxxxxxx - 4
Add NewAlgorithm
Straight from the terminal, without entering the interactive session, replacing YOUR_API_KEY with the key you generated:
copilot mcp add --transport http --header "Authorization: Bearer YOUR_API_KEY" NewAlgorithm-TOTVS https://totvs.mcp.newalgorithm.io/mcpRésultat attendu : The server is saved to your user configuration, in ~/.copilot/mcp-config.json, and works in any folder.
- 5
Or write the configuration directly
Same result, useful for reviewing or versioning per project (.mcp.json or .github/mcp.json at the repository root):
~/.copilot/mcp-config.json{ "mcpServers": { "NewAlgorithm-TOTVS": { "type": "http", "url": "https://totvs.mcp.newalgorithm.io/mcp", "headers": { "Authorization": "Bearer na_live_xxxxxxxxxxxxxxxxx" }, "tools": ["*"] } } } - 6
Confirm
From the terminal, listing every configuration source:
copilot mcp listRésultat attendu : NewAlgorithm-TOTVS http https://totvs.mcp.newalgorithm.io/mcp
- 7
Or inside the session
In the interactive session, /mcp show lists the servers and the state of each one; /mcp add opens the form to register another one without leaving the terminal.
/mcp show
The user-level mcp-config.json lives outside the repository — it's the right place for the key. If you choose the project's .mcp.json, it's versioned along with the code: never leave the Bearer token there in plain text.
Détails sur l'authentification et les outils dans la Documentation.