Skip to main content

Connect GitHub Copilot CLI

Use GitHub Copilot CLI with models, MCP tools, and skills through Unity Gateway. The Unity Gateway CLI (ug) handles workspace sign-in and configuration. You can also configure the connections manually.

Prerequisites​

You need your Databricks workspace URL and access to the models, MCP services, and skills you want to use. For manual setup, install GitHub Copilot CLI and have a Databricks personal access token.

If your admin has already configured your device, follow your organization's setup instructions.

Use the Unity Gateway CLI​

Install ug, then run this command from your project directory:

Bash
ug copilot

Follow the prompts to select your workspace and sign in. The command opens GitHub Copilot CLI with a configured model. Start working with the same prompts and commands you already use.

To start with a different model available in your workspace:

Bash
ug copilot --model "<model-name>"

Use the model's full Unity Catalog name, such as system.ai.claude-sonnet-4-6. The current ug integration configures Claude and GPT models for Copilot CLI.

Configure models manually​

Set these variables in your terminal:

Bash
export COPILOT_PROVIDER_TYPE="openai"
export COPILOT_PROVIDER_BASE_URL="https://<workspace-hostname>/ai-gateway/mlflow/v1"
export COPILOT_PROVIDER_BEARER_TOKEN="<databricks-pat>"
export COPILOT_MODEL="system.ai.claude-sonnet-4-6"
export COPILOT_OFFLINE="true"

Replace the hostname, token, and model name. The openai provider type selects the gateway's Chat Completions API, including when you use a Claude model. Offline mode disables connections to GitHub's servers; model requests still go to Unity Gateway.

Start Copilot CLI from the same terminal:

Bash
copilot

See GitHub's custom model provider documentation for these settings.

Add MCP tools​

To use system.ai.dbsql, system.ai.sandbox, or system.ai.web_search, an account admin must enable the Unity Gateway beta from the account console Previews page. See Manage account previews.

Use the Unity Gateway CLI​

Run:

Bash
ug mcp add --agents copilot

Select the services you want to add, then start a new session with ug copilot. Inside Copilot, enter /mcp to see connected servers. Ask the agent to use a tool by describing what you need.

ug copilot loads the MCP connections registered by ug. Keep using it to start your sessions.

Configure MCP services manually​

Merge this entry into ~/.copilot/mcp-config.json:

JSON
{
"mcpServers": {
"dbsql": {
"type": "http",
"url": "https://<workspace-hostname>/ai-gateway/mcp-services/system.ai.dbsql",
"headers": {
"Authorization": "Bearer <databricks-pat>"
},
"tools": ["*"]
}
}
}

Replace the hostname and token. For another service, use a unique server name and replace system.ai.dbsql with its three-part Unity Catalog name. Keep existing server entries, then restart Copilot CLI.

See GitHub's MCP documentation.

Add skills​

Use the Unity Gateway CLI​

Download published skills:

Bash
ug skills add

Choose the skills you want to use. Copilot CLI reads the downloads from ~/.agents/skills/. Start a new session, or enter /skills reload, then use /skills list to see them. Re-run the download command to get updated versions.

Configure skills manually​

For skill files you already have, place the complete folder, including SKILL.md and bundled files, in ~/.agents/skills/ or your project's .github/skills/. See GitHub's skills documentation.

To access the published skill registry through MCP, add a second server using the MCP configuration above. Name it databricks-skill-registry and use this URL with the same bearer authentication:

Text
https://<workspace-hostname>/ai-gateway/skills/

Keep the trailing slash. Restart Copilot CLI and ask it to use a published skill by its full name. Registry skills are accessed through MCP; /skills list shows installed skills.

Unity Gateway skills are in Beta. See Govern skills for enablement and permissions.

Troubleshooting​

A model request fails: Check the gateway URL, token expiration, full model name, and model permissions. The current ug integration excludes Gemini models from Copilot CLI because of a request compatibility issue.

An MCP server is missing: If you registered it with ug, restart with ug copilot. For manual setup, check ~/.copilot/mcp-config.json and the connection details in /mcp.

A downloaded skill is missing: Check that its folder contains SKILL.md in a supported directory, then enter /skills reload.

For workspace sign-in or ug setup problems, run ug doctor.

Next steps​