|
| 1 | +# Install GitHub MCP Server in AdaL CLI |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | + |
| 5 | +1. AdaL CLI installed — `npm install -g @sylphai/adal-cli` (requires Node.js 20+) |
| 6 | +2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with appropriate scopes |
| 7 | + |
| 8 | +## Option 1 — Shortcut (Easiest) |
| 9 | + |
| 10 | +AdaL CLI has a pre-configured shortcut for GitHub. Set your token before starting AdaL, then add the server: |
| 11 | + |
| 12 | +```bash |
| 13 | +# macOS / Linux |
| 14 | +export GITHUB_TOKEN="ghp_xxxx" |
| 15 | + |
| 16 | +# Windows (PowerShell) |
| 17 | +$env:GITHUB_TOKEN="ghp_xxxx" |
| 18 | +``` |
| 19 | + |
| 20 | +Then inside your AdaL session: |
| 21 | + |
| 22 | +```bash |
| 23 | +/mcp add github |
| 24 | +``` |
| 25 | + |
| 26 | +AdaL reads the `GITHUB_TOKEN` environment variable at startup. See [AdaL CLI MCP docs](https://docs.sylph.ai/features/mcp-support-proposed) for more info. |
| 27 | + |
| 28 | +## Option 2 — Remote GitHub MCP Server |
| 29 | + |
| 30 | +Connect directly to GitHub's hosted MCP server at `https://api.githubcopilot.com/mcp/` using a PAT header. |
| 31 | + |
| 32 | +<details> |
| 33 | +<summary>AdaL CLI Remote Server Connection</summary> |
| 34 | + |
| 35 | +```bash |
| 36 | +/mcp add github --transport http --url https://api.githubcopilot.com/mcp/ --header "Authorization:Bearer YOUR_GITHUB_PAT" |
| 37 | +``` |
| 38 | + |
| 39 | +Replace `YOUR_GITHUB_PAT` with your actual [GitHub Personal Access Token](https://github.com/settings/tokens). |
| 40 | + |
| 41 | +</details> |
| 42 | + |
| 43 | +## Option 3 — Local GitHub MCP Server (Docker) |
| 44 | + |
| 45 | +Run the server locally using Docker. |
| 46 | + |
| 47 | +### Prerequisites |
| 48 | + |
| 49 | +- [Docker](https://www.docker.com/) installed and running |
| 50 | +- [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with appropriate scopes |
| 51 | + |
| 52 | +<details> |
| 53 | +<summary>AdaL CLI Local Server Connection</summary> |
| 54 | + |
| 55 | +```bash |
| 56 | +/mcp add github --command docker --args "run,-i,--rm,-e,GITHUB_PERSONAL_ACCESS_TOKEN,ghcr.io/github/github-mcp-server" --env "GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_PAT" |
| 57 | +``` |
| 58 | + |
| 59 | +Replace `YOUR_GITHUB_PAT` with your actual [GitHub Personal Access Token](https://github.com/settings/tokens). |
| 60 | + |
| 61 | +</details> |
| 62 | + |
| 63 | +## Verify the Connection |
| 64 | + |
| 65 | +After adding the server, test it inside AdaL: |
| 66 | + |
| 67 | +``` |
| 68 | +/mcp |
| 69 | +``` |
| 70 | + |
| 71 | +Select the `github` server → **Test Connection**. You should see the available GitHub tools listed. |
| 72 | + |
| 73 | +## Troubleshooting |
| 74 | + |
| 75 | +- **"Connection failed"** — Verify your PAT is valid and has the required scopes (`repo`, etc.) |
| 76 | +- **Token not read (shortcut)** — Make sure `GITHUB_TOKEN` is set *before* starting AdaL; restart required if set after launch |
| 77 | +- **Docker errors** — Ensure Docker is running: `docker ps` |
| 78 | +- **Token not found (local)** — Confirm your PAT is correctly set in the `--env` flag |
| 79 | + |
| 80 | +For more details, see the main [README.md](../../README.md). |
0 commit comments