Github Copilot


 

Back to Product Wiki

Back to MCP Server overview

Overview

This help article will show you how to utilize iTwin IoT's MCP server with either Github Copilot through VS Code or through your command line interface. 

This article is a guide to set up the MCP server for both versions of Copilot and how to install Github Copilot CLI. 

For any further guidance on how to use Github Copilot please read through Github documentation found here:

VS Code Github Copilot - User guide

Github Copilot CLI - User guide

Setting up the MCP Server for Github Copilot

Github Copilot VS Code

One Click Install

If you have Github Copilot in your VS Code application set up then you can click this link

Install iTwin IoT MCP Server

This is a one click install that will set up the connection to the iTwin IoT MCP server and once you have authenticated with your Bentley IMS account you will have access to the MCP server. 

Manual Install

1. Open the Command Palette (Cmd + Shift + P on MacOS and Ctrl + Shift + P on Windows)

2. Type in MCP: Add Server

3. Select HTTP

4. Enter the URL for iTwin IoT's MCP server: https://itwiniotai-mcp.bentley.com/mcp

5. Enter any name for the server ID, this is merely for presenting a generic name for this MCP connection

6. Choose Global setting

7. mcp.json will open, click the "Start" button above your MCP server entry

7. Click Copy URLs & Proceed once that dialogue opens

 

8. Enter the Client ID: itwiniot-vscode

9. Leave the Client Secret empty and press enter

10. Click Allow

11. Authenticate with your Bentley IMS account

Now the MCP server connection is set up for your Github Copilot

Github Copilot CLI

For MacOS or Linux

The first step is to install Github Copilot CLI, you can install it from here https://github.com/features/copilot/cli 

1. Open or create ~/.copilot/mcp-config.json by typing in 

nano ~/.copilot/mcp-config.json for Linux or MacOS

2. Add this text to the file (if you already have other MCP server connections then you only need to add the entry for iTwin IoT's MCP server)

{
  "mcpServers": {
    "iot-mcp": {
        "tools": [
            "*"
        ],
        "type": "http",
        "url": "https://itwiniotai-mcp.bentley.com/mcp",
        "oauthClientId": "itwiniot-vscode",
        "auth": {
            "redirectPort": 33418
        }    
    }
}
}

3. Press Ctrl + O then press Enter

4. Press Ctrl + X to exit Nano

5. Open Copilot in your terminal by typing in Copilot (remember to restart your terminal after install)

6. Authenticate to Bentley IMS 

For Windows

The first step is to install Github Copilot CLI, you can install it from here https://github.com/features/copilot/cli

1. Open your command window

2. Paste in winget install GitHub.Copilot

3. Run installer

4. Run this command in the terminal mkdir "%USERPROFILE%\.copilot"

5. Run this command to create the MCP Server JSON config file type nul > "%USERPROFILE%\.copilot\mcp-config.json"

6. Navigate to %USERPROFILE\.copilot or C:\Users\YourUsername\.copilot

7. Edit mcp-config.json

8. Paste this into the file

{
  "mcpServers": {
    "iot-mcp": {
        "tools": [
            "*"
        ],
        "type": "http",
        "url": "https://itwiniotai-mcp.bentley.com/mcp",
        "oauthClientId": "itwiniot-vscode",
        "auth": {
            "redirectPort": 33418
        }    
    }
}
}

9. Save changes

10. Open Copilot in your Command Window by typing in Copilot (remember to restart your terminal after install)

11. Authenticate with Bentley IMS

Using the MCP Server in Github Copilot

VS Code

Using Github Copilot in VS Code is simply done through the Github Copilot chat in VS Code. You open the chat and ask it specific iTwin IoT questions and operations and it will pick the correct tools for iTwin IoT. 

If the chat is not open then

1. press Ctrl + Shift + P (Windows) or Cmd + Shift + P (MacOS)

2. Paste in GitHub Copilot: Open Chat

3. Press enter

4. Github Copilot chat will open

Github Copilot CLI

For general user guide on using Copilot CI please read through Github documentation here: https://github.com/features/copilot/cli/

1. Open your Command or Terminal window

2. Type in Copilot

3. Authenticate if needed 

4. Type in your command with iTwin IoT as a context

 

Data handling and privacy

 

Limits and quotas

To protect the iTwin IoT backend, the connector applies per-user sliding-window rate limits:

When you hit the limit, the connector returns a structured rate_limited error and the agent will wait and retry, or surface the limit to you to decide.