Every EnvisionSCADA server contains an MCP (Model Context Protocol) server at the address /mcp. GitHub Copilot connects to it directly over HTTP or HTTPS. No additional software or proxy script is required.
This article describes GitHub Copilot, the desktop application for Windows, macOS and Linux, and the Copilot CLI, which share their MCP servers, and Copilot in Visual Studio Code. Use the quick start to connect from a session, or add the server for a permanent connection.
A new installation runs on port 80, so the MCP address on the same computer is:
http://localhost/mcpBefore you start
- EnvisionSCADA is running. Open
http://localhostin a browser to check this. - GitHub Copilot or the Copilot CLI (command
copilot) is installed and signed in to a GitHub account with Copilot access. - An EnvisionSCADA user account. Members of the Administrators group get the configuration and design tools; other users get the read-only runtime tools. A new installation contains the user Admin with password Admin.
Quick start: ask Copilot to connect
The fastest way to connect is to ask Copilot. In a session of GitHub Copilot, or in Copilot Chat in Agent mode in Visual Studio Code, type a request with the MCP address and an EnvisionSCADA user account. Copilot then calls the MCP endpoint itself over HTTP. No token or configuration is required.
Replace <password> with the password of the account. The link points Copilot to the section Instructions for AI assistants at the end of this article, which describes how to call the endpoint.
Connect to the EnvisionSCADA MCP server at http://localhost/mcp with user Admin and password <password>. Follow https://www.envisionscada.com/KnowledgeBase/how-to/github-copilot-mcp#instructions-for-ai-assistantsThis connection is available in that session only. Copilot calls the tools through terminal commands and asks for approval according to its tool permission level. For a permanent connection, add the server as described below.
Step 1: Create the login token
Copilot logs in with HTTP Basic authentication. The MCP form asks for the login as a token. Run the command below in PowerShell to convert the user name and password into a token. Replace Admin:<password> with your own user name and password, separated by a colon. Copy the result, it is used in Step 2. For the user Admin with password Admin of a new installation, the result is QWRtaW46QWRtaW4=.
[Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("Admin:<password>"))Step 2: Add the server in GitHub Copilot
Add the server through the MCP form of GitHub Copilot. No file needs to be edited.
- Click Customize in the sidebar and open the MCP tab.
- Click Add in the top right corner.
- Enter a Server name, for example
EnvisionSCADA, and select the Server type HTTP. - Next to URL, enter the MCP address, for example
http://localhost/mcp. - Under Headers, enter
Authorizationas Name and the value below as Value, with<token>replaced by the result of Step 1. Leave OAuth Client ID empty. - Click Save.
Basic <token>Basic QWRtaW46QWRtaW4=Instead of the app, the server can be added with the Copilot CLI: run copilot, type /mcp add and fill in the same values in the form (server type HTTP, URL, and {"Authorization": "Basic <token>"} under HTTP Headers), or use the command below. Servers added in the Copilot CLI are also available in GitHub Copilot.
copilot mcp add --transport http --header "Authorization: Basic <token>" envisionscada http://localhost/mcpAdjust the address to your situation:
| EnvisionSCADA runs on another computer | Replace localhost with the computer name or IP address | http://192.168.1.20/mcp |
| EnvisionSCADA runs on another port | Add the port to the address | http://localhost:8080/mcp |
| EnvisionSCADA uses HTTPS | Use the https address | https://scada.example.com/mcp |
No rows match the filter.
.mcp.json that is shared through Git.Step 3: Check the connection
In GitHub Copilot, click Customize in the sidebar and open the Installed tab. The server is listed and its switch is on.
Then ask in a session, for example: What is the status of the EnvisionSCADA server? Copilot answers with the runtime and redundancy status of the server.
HTTPS and OAuth 2.0
Use HTTPS when GitHub Copilot connects to EnvisionSCADA on another computer, so that the login is encrypted on the network. Use the https address in Step 2, with a certificate issued by a certificate authority that the computer running GitHub Copilot trusts.
With OAuth 2.0, GitHub Copilot signs in through the Authorize MCP access page of EnvisionSCADA instead of storing the login token. Turn on Enable MCP OAuth 2.0 in the MCP OAuth section of the Parameters page first. AI apps accept OAuth over plain HTTP only for localhost. The parameters, the endpoints and the server actions that sign clients out are described under HTTPS and OAuth 2.0 in Setup Claude Code MCP Integration.
- Add the server in Step 2 without the Authorization header and leave OAuth Client ID empty.
- When GitHub Copilot connects, the Authorize MCP access page of EnvisionSCADA opens in the browser.
- Sign in with an EnvisionSCADA account.
Visual Studio Code
Copilot in Visual Studio Code reads its MCP servers from an mcp.json file. Create the file .vscode\mcp.json in the workspace folder with the content below. To register the server for all workspaces, run MCP: Open User Configuration from the Command Palette and add the same content there. The token is not stored in the file: Visual Studio Code asks for it once when the server starts and keeps it in its secure storage.
{
"servers": {
"envisionscada": {
"type": "http",
"url": "http://localhost/mcp",
"headers": {
"Authorization": "Basic ${input:envisionscada-token}"
}
}
},
"inputs": [
{
"type": "promptString",
"id": "envisionscada-token",
"description": "EnvisionSCADA login token",
"password": true
}
]
}- Run MCP: List Servers from the Command Palette, select
envisionscadaand start it. Review the trust prompt before you accept it. - Enter the token from Step 1 when Visual Studio Code asks for EnvisionSCADA login token.
- Open Copilot Chat, select Agent mode and enable the tools of
envisionscadaunder Configure Tools.
Instructions for AI assistants
This section is written for the AI assistant that receives the quick start request. Connect to the EnvisionSCADA MCP endpoint directly over HTTP as described below. The connection works in the current session, without registering the server and without a restart. Ask the user for the password when the request contains <password>, and do not store the password in project files.
- Send every request as HTTP POST to the MCP address from the request, for example
http://localhost/mcp, with the headersContent-Type: application/json,Accept: application/json, text/event-streamandAuthorization: Basic <base64 of user:password>. Basic authentication is also accepted when OAuth 2.0 is turned on in EnvisionSCADA. - The body is JSON-RPC 2.0. Call
initializefirst, thentools/listto read the tool names and their input schemas, thentools/callwithnameandarguments. Call the toolget_server_statusto confirm the connection. - The server is stateless and returns no
Mcp-Session-Id. Every request is independent. - Responses are Server-Sent Events. Join the lines that start with
data:and parse them as JSON. - Write a small reusable helper script once and call it for each request. Pass the tool arguments through a JSON file, not as a command-line string: quoting on the command line strips the inner double quotes, and the server then answers HTTP 500 with
"id": null. - Use only the tool names and fields that
tools/listreturns. When a configuration write fails withUnknown field, callget_config_entity_type_schemafor the entity type and use the exact field names it returns. - Members of the Administrators group get the configuration, design and runtime tools; other users get the read-only runtime tools. HTTP 401 means a wrong user name or password.
- For an https address whose certificate is not trusted, ask the user how to continue instead of turning off certificate validation.
PowerShell helper for Windows, tested against EnvisionSCADA, and example calls:
param(
[Parameter(Mandatory)] [string] $Url, # e.g. http://localhost/mcp
[Parameter(Mandatory)] [string] $User,
[Parameter(Mandatory)] [string] $Password,
[Parameter(Mandatory)] [string] $Method, # initialize | tools/list | tools/call
[string] $Tool, # tool name for tools/call
[string] $ArgsFile # JSON file with the tool arguments
)
$token = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes("${User}:${Password}"))
$params = @{}
if ($Method -eq 'initialize') {
$params = @{ protocolVersion = '2025-06-18'; capabilities = @{}; clientInfo = @{ name = 'ai-helper'; version = '1' } }
} elseif ($Method -eq 'tools/call') {
$arguments = if ($ArgsFile) { Get-Content -Raw $ArgsFile | ConvertFrom-Json } else { @{} }
$params = @{ name = $Tool; arguments = $arguments }
}
$body = @{ jsonrpc = '2.0'; id = 1; method = $Method; params = $params } | ConvertTo-Json -Depth 50 -Compress
$response = Invoke-WebRequest -UseBasicParsing -Uri $Url -Method Post -ContentType 'application/json' `
-Headers @{ Authorization = "Basic $token"; Accept = 'application/json, text/event-stream' } `
-Body ([Text.Encoding]::UTF8.GetBytes($body))
$text = [Text.Encoding]::UTF8.GetString($response.RawContentStream.ToArray())
$data = ($text -split "`n" | Where-Object { $_ -like 'data:*' } | ForEach-Object { $_.Substring(5).Trim() }) -join ''
if (-not $data) { $data = $text }
$data# Write the tool arguments to a file, never on the command line
Set-Content -Path args.json -Value '{"subscribeVars":["Pump1_Speed"]}' -Encoding UTF8
.\mcp.ps1 -Url http://localhost/mcp -User Admin -Password <password> -Method initialize
.\mcp.ps1 -Url http://localhost/mcp -User Admin -Password <password> -Method tools/list
.\mcp.ps1 -Url http://localhost/mcp -User Admin -Password <password> -Method tools/call -Tool get_server_status
.\mcp.ps1 -Url http://localhost/mcp -User Admin -Password <password> -Method tools/call -Tool get_data -ArgsFile args.jsonOn macOS and Linux, send the same request with curl:
curl -s -X POST http://localhost/mcp \
-u 'Admin:<password>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_server_status","arguments":{}}}'Troubleshooting
| Server missing under Installed, or its switch is off | The form was not saved, or the server is disabled | Add the server again in the MCP tab, or turn on its switch under Installed |
| Connection refused | EnvisionSCADA is not running, or the address or port is wrong | Open the address without /mcp in a browser and check that EnvisionSCADA responds |
| 401 Unauthorized | Wrong user name or password in the token, or the header was not entered | Repeat Step 1 with username:password and update the Authorization header of the server |
| Tools not visible in Copilot Chat in Visual Studio Code | Copilot Chat is not in Agent mode, or the tools are not enabled | Select Agent mode and enable the tools of envisionscada |
| Configuration and design tools missing | The user is not a member of the Administrators group | Use an account of the Administrators group in Step 1 |
No rows match the filter.