Skip to content
LyraShield AIOpen beta

Updated

GitHub Copilot CLI

GitHub Copilot CLI reads MCP server configuration from ~/.copilot/mcp-config.json (global), .mcp.json (project), or .github/mcp.json (project). You can also manage servers with the copilot mcp add command.

Install with the CLI (fastest)

Run npx lyrashield install copilot-cli from your project root. It detects Copilot CLI, writes the correct config automatically, and never inlines your API key into a file you might commit. Add --dry-run first to preview the change with no write, or run npx lyrashield doctor afterward to confirm it's configured correctly.

npx lyrashield install copilot-cli

Prefer to see exactly what gets written, or set it up without Node.js? Configure it by hand below.

Local stdio setup

Add the following to ~/.copilot/mcp-config.json or .mcp.json. Create the file if it does not exist.

Add the following to .mcp.json. Recommended: run npx lyrashield login --oauth once; the local MCP server reads the selected workspace credential from ~/.lyrashield/credentials.json.

{
  "mcpServers": {
    "lyrashield": {
      "command": "npx",
      "args": [
        "-y",
        "@lyrashield/mcp"
      ],
      "env": {
        "LYRASHIELD_API_URL": "https://app.lyrashieldai.com"
      },
      "type": "local"
    }
  }
}
One-line install: the CLI writes exactly the configuration above.
npx lyrashield install copilot-cli

Important gotchas

  • Copilot CLI stdio entries use `type: "local"` (or `"stdio"`); remote uses `type: "http"`.
  • Each entry may carry a `tools` array (e.g. ["*"]) to allowlist server tools.
  • GitHub's own MCP server is built in — you don't add it manually.
type field: Copilot CLI stdio entries use "type": "local" (or "stdio"). Each entry may also carry a tools array (e.g. ["*"]) to allowlist server tools. GitHub's own built-in MCP server does not need to be added manually.

Remote HTTP setup

For environments where you prefer not to run a local process, connect to the remote endpoint.

Add the following to .mcp.json. Replace <LYRASHIELD_API_KEY> with your workspace API key.

{
  "mcpServers": {
    "lyrashield": {
      "url": "https://app.lyrashieldai.com/api/mcp",
      "headers": {
        "Authorization": "Bearer <LYRASHIELD_API_KEY>"
      },
      "type": "http"
    }
  }
}
Read-only vs. read-and-write: Remote mutating tools (scan triggers, finding submissions, report creation) require an explicit OAuth write scope or write-capable API key, plus a human out-of-band approval. Read-only inspection tools work with any key.

Verify the connection

Run copilot mcp list to confirm the lyrashield server is registered. Ask Copilot: "What LyraShield tools do you have access to?" to confirm the server is connected.

Requirements: Node.js 20+ and a LyraShield workspace API key. The@lyrashield/mcp package is published on npm, sonpx -y @lyrashield/mcp resolves directly.