# GitHub Copilot

> Add the Stableship MCP server to GitHub Copilot, in Copilot CLI and VS Code, with a token.

GitHub Copilot connects to the Stableship MCP server with a token, in Copilot CLI and in VS Code, and reads `.github/copilot-instructions.md` and `AGENTS.md` from your repository. Once it is connected, ask it to fix what Stableship found; it reads each fix brief, fixes the code and asks Stableship to verify the fix.

> **Note** We have not yet tested GitHub Copilot with Stableship end to end. It connects over MCP with the steps below, taken from GitHub Copilot's own docs. If a step does not match what you see, tell us at support@stableship.ai.

## Connect

First make a token: in Stableship open **Settings**, then **Connections**, open **API tokens and connected apps**, and choose **Create token** with **Read findings and rules** and **Start checks and verify fixes**. Copy it: it starts with `sst_` and is shown once. Use it where these steps say `sst_your_token`.

Add this to `~/.copilot/mcp-config.json`, which Copilot CLI and VS Code both read:

```
{
  "mcpServers": {
    "stableship": {
      "type": "http",
      "url": "https://api.stableship.ai/mcp",
      "headers": {
        "Authorization": "Bearer sst_your_token"
      },
      "tools": [
        "*"
      ]
    }
  }
}
```

Keep the token out of your repository.

## Check it works

Start a new Copilot chat or session. Then ask GitHub Copilot to list your Stableship projects: it calls `list_projects` and names your app.

If it does not connect:

- Check the token was pasted whole.
- Run `/mcp` in Copilot CLI: Stableship should be listed.

## Keep the rules in your repository

Ask Copilot to call `get_repo_files` and commit what it returns: `.gate/rules.md`, `.gate/context.md`, a Stableship section in `AGENTS.md`, and the same section in `.github/copilot-instructions.md`. Stableship never writes to your repository, so your agent commits these.
