Every EnvisionSCADA server contains an MCP (Model Context Protocol) server at the address /mcp. Codex connects to it directly over HTTP or HTTPS. No additional software or proxy script is required.
Use the quick start to connect from a Codex session, or add the server in the MCP form of the Codex app 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. - Codex is installed: the ChatGPT desktop app, the Codex IDE extension or the Codex CLI.
- 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 Codex to connect
The fastest way to connect is to ask Codex. In a Codex session, type a request with the MCP address and an EnvisionSCADA user account. Codex then calls the MCP endpoint itself over HTTP. No token, setting or configuration file is required.
Replace <password> with the password of the account. The link points Codex 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/codex-mcp#instructions-for-ai-assistantsThis connection is available in that session only. Codex calls the tools through terminal commands and asks permission before it runs them, depending on its approval settings. Codex runs commands in a sandbox that blocks network access by default: approve the request to run the command with network access, or allow network access in the Codex settings. For a permanent connection, add the server as described below.
Step 1: Create the login token
Codex 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 Codex
Add the server through the MCP form of the Codex app. No file needs to be edited. The ChatGPT desktop app, the Codex IDE extension and the Codex CLI share their MCP servers, so the server is added once for all of them.
- Open Plugins, select the MCPs tab and click Add.
- Enter the name
envisionscadaand choose Streamable HTTP. - Next to URL, enter the MCP address, for example
http://localhost/mcp. Leave Bearer token env var empty. - Under Headers, enter
Authorizationin the first field and the value below in the second field, with<token>replaced by the result of Step 1. - Click Save.
Basic <token>Basic QWRtaW46QWRtaW4=Adjust 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.
Step 3: Check the connection
In a Codex session, type /mcp to see the connected servers. Then ask, for example: What is the status of the EnvisionSCADA server? Codex answers with the runtime and redundancy status of the server.
HTTPS and OAuth 2.0
Use HTTPS when Codex 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 Codex trusts.
With OAuth 2.0, Codex 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.
- Select Authenticate next to the server. The Authorize MCP access page of EnvisionSCADA opens in the browser.
- Sign in with an EnvisionSCADA account.
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
| 401 Unauthorized | Wrong user name or password in the token, or the Authorization header is missing | Repeat Step 1 with username:password and update the Authorization header of the server |
| 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 |
| Tools not visible in Codex | The session was started before the server was added or before EnvisionSCADA was running | Restart Codex |
| 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.