Reference manual

Command line

StaticalPrismCALCmd.exe is Prism for C/AL's command-line tool. You use it to show and install a license, and to run the MCP server for AI agents without a Prism window.

The Prism for C/AL MSIX package registers StaticalPrismCALCmd.exe as an execution alias, so it runs from any command prompt or script, whatever PATH holds. The MSI package installs the 3.x release, which this manual does not describe.

CommandWhat it does
licenseShows the license status.
license installInstalls a license key, or removes the installed one, and shows the resulting status.
mcp-server-httpRuns an MCP server over HTTP for an object store. Alias mcp-server.
mcp-server-stdioRuns an MCP server over standard input and output, for an agent that starts the server itself.

Help and common options

Put -h after the tool for a list of commands and the exit codes, or after a command for that command's help:

StaticalPrismCALCmd.exe -h
StaticalPrismCALCmd.exe license install -h
OptionEffect
-h, --help, -?Shows help for the tool or for the command it follows.
--versionPrints the version of the tool.

The tool prints a banner with its version first. It leaves the banner out when it runs an MCP server and when its output is redirected, so the output of a script stays clean.

The MCP server commands take a workspace argument: the path of an object text file (.txt) or of a folder of object files. A path that does not exist stops the command with Workspace not found and exit code 1. Both MCP server commands also take these options:

OptionDefaultEffect
--encoding The system's OEM code page The encoding of the exported object files: a name such as windows-1252 or a code page number such as 850. Give the value of the Default object encoding setting when you have set one in Prism.
--file-include-filter Every file Folder stores only: loads only the files whose name matches. Use * and ? as wildcards and | between names, as in "*.txt". The same as the File name inclusion filter setting.
--file-exclude-filter None Folder stores only: skips the files whose name matches, in the same syntax. The same as the File name exclusion filter setting.
--directory-exclude-filter None Folder stores only: skips the folders whose name matches, in the same syntax. The same as the Directory name exclusion filter setting.
--log-file, -lf mcp-server.log in %LOCALAPPDATA%\Statical\Prism for mcp-server-http, mcp-server-stdio.log in the same folder for mcp-server-stdio The log file. It starts a new file at about 5 MB and keeps the last 6 files.
--log-level, -ll Information The lowest level written to the log: Verbose, Debug, Information, Warning, Error or Fatal.

The command-line server does not read Prism's settings. Give it the encoding and filters your workspace window uses, so an agent sees the same objects you do. A value other than the default is echoed when the server starts.

license

Shows the license status of Prism for C/AL on this machine. It takes no arguments or options and always exits with 0.

StaticalPrismCALCmd.exe license
The license command in a command prompt, with a license installed.

It prints one line per fact:

#LineShows
1ProfileThe license profile Prism runs with.
2StatusUnlicensed (followed by a Reason line), Licensed or Invalid.
3Licensed to, Company, EmailWhom the license is for. Only with an installed key.
4Expires, Trial, ExpiredThe expiry date (yyyy-MM-dd), and yes or no for a trial and for an expired key. Only with an installed key.
–Not valid on this machineyes when the key belongs to another machine. Only then, so not in the capture.
5License hash, Fallback reasonA fingerprint of the installed key. For a key that is not valid, the reason, such as “The license key is not for Prism for C/AL”; Prism then runs with limited features.
6Machine codeThe code that identifies this machine to a license.
7License fileThe license file the tool read.

license install

Installs a license key, checks it, and prints the resulting status as license does. It saves the key in the same place the Activate license window does, so Prism and every running MCP server use it without a restart.

Argument or optionEffect
keyThe license key itself. Optional when you use --key-file or --stdin.
--key-fileReads the key from this file. An empty file removes the installed license.
--stdinReads the key from standard input.

Give the key exactly once: as the argument, with --key-file or with --stdin. Use one of the two options in a script, so the key does not appear on a command line.

StaticalPrismCALCmd.exe license install --key-file "C:\keys\prism-for-cal.txt"
type "C:\keys\prism-for-cal.txt" | StaticalPrismCALCmd.exe license install --stdin
Exit codeMeaning
0The key is installed and valid, or the license was removed (the output starts with License removed.).
-33The key was rejected. Standard error says why: “License key rejected: …”, “License key has expired (…).”, “License key is not valid on this machine (machine code: …).” or “License key is not valid.”
-1No key or more than one source was given, the key file could not be read, standard input was empty, the key could not be saved, or the license could not be removed. Standard error says which.

mcp-server-http

Runs an MCP server over HTTP for an object store, at http://localhost:<port>, without a Prism window. It is the same server the MCP server page describes. The alias mcp-server runs the same command.

Syntax:

StaticalPrismCALCmd.exe mcp-server-http <workspace> [options]

It takes the common options and these:

OptionDefaultEffect
--port, -p47821The port to listen on, from 1 to 65535. Not together with --port-search.
--port-search Not used Takes the first free port in a range: N..M, N.. (up to 65535) or a single port N, such as 47821..47920. The server prints the port it selected. Not together with --port.
StaticalPrismCALCmd.exe mcp-server-http "C:\NAV\Cronus" --port 47821
StaticalPrismCALCmd.exe mcp-server "C:\NAV\Cronus.txt" --port-search 47821..47920 --encoding windows-1252
The HTTP server started with --port-search.
#LineShows
1CommandThe command, the object store and --port-search 47821..47920.
2Selected port“Selected free port … from --port-search …”: the port the server took from the range, and how many ports it scanned.
3Running“MCP server is running on http://localhost:” and the port.

The server prints “MCP server is running on http://localhost:47821” and builds the symbol index in the background. A tool call that needs the index waits up to 20 seconds for it. Press Ctrl+C to stop the server; it then prints MCP server stopped.

Exit codeMeaning
0The server stopped normally.
-30The port is in use, or no port in the --port-search range is free. The message names the program that holds a port when Prism can tell: “Port 47821 is unavailable (…). Held by … (pid …).”
-31Standard input and output are both redirected, which means an MCP client tried to start the HTTP server as a stdio server. The message explains how to use mcp-server-stdio instead.
-1An invalid option value, such as an unknown encoding or both port options, or a server that failed to start.
1The command line could not be parsed, or the workspace does not exist.

mcp-server-stdio

Runs an MCP server that talks over its standard input and output. You do not run it yourself: you put it in an agent's MCP configuration, and the agent starts it whenever it needs the server. It works with Prism closed.

Syntax:

StaticalPrismCALCmd.exe mcp-server-stdio <workspace> [options]

It takes the common options and no port options.

StaticalPrismCALCmd.exe mcp-server-stdio "C:\NAV\Cronus" --encoding 850 --file-include-filter "*.txt"

Every start builds the symbol index again, which takes a while on a large object store, and a tool call that needs the index waits up to 20 seconds for it. When one Prism window is open on the store anyway, connect the agent to that window's HTTP server instead. The server stops when its standard input closes or on Ctrl+C, and writes its messages to standard error, never to standard output.

Exit codeMeaning
0The server stopped normally.
-1An invalid option value, such as an unknown encoding, or a server that failed to start.
1The command line could not be parsed, or the workspace does not exist.

Exit codes

CodeMeaningCommands
0OK.All
1The command line could not be parsed: an unknown command or option, a missing argument, or a workspace that does not exist.All
-1An error. Standard error says what went wrong.All but license
-30The MCP server's port is unavailable.mcp-server-http
-31Redirected standard input and output, which the HTTP server does not support.mcp-server-http
-33The license key was rejected: invalid, expired, or not valid on this machine.license install

Install a license from a script

Use this to license Prism for C/AL on a machine without opening Prism, for example when you set up machines from a script. You need the license key in a text file.

  1. Save the key in a text file the script can read, such as C:\keys\prism-for-cal.txt.
  2. Run this command:
    StaticalPrismCALCmd.exe license install --key-file "C:\keys\prism-for-cal.txt"
  3. Check the exit code: 0 means the key is installed; -33 means it was rejected, with the reason on standard error.
  4. Delete the key file if it should not stay on the machine.
StaticalPrismCALCmd.exe license install --key-file "C:\keys\prism-for-cal.txt"
if %errorlevel% neq 0 (echo License not installed & exit /b 1)
del "C:\keys\prism-for-cal.txt"

The output shows Status: Licensed and the license file Prism now reads. A key bound to another machine is rejected; StaticalPrismCALCmd.exe license prints the Machine code of this one.

Run the MCP server over stdio for an agent

Use this when an agent should reach your C/AL objects without a Prism window open. The agent starts the server itself, so there is nothing to keep running.

  1. Find the absolute path of your object store: an object text file or a folder of object files.
  2. Open the agent's MCP configuration file, such as .mcp.json for Claude Code or .vscode/mcp.json for GitHub Copilot in Visual Studio Code.
  3. Add an entry whose command is StaticalPrismCALCmd.exe and whose args are mcp-server-stdio and the path. Add --encoding and the filter options when your Prism settings use them.
  4. Save the file and start a new agent session. Ask a question that names a C/AL object.
{
  "mcpServers": {
    "prism-cronus-3f9a1c": {
      "type": "stdio",
      "command": "StaticalPrismCALCmd.exe",
      "args": [
        "mcp-server-stdio",
        "C:\\NAV\\Cronus",
        "--encoding",
        "850"
      ]
    }
  }
}

The agent's first call that needs the symbol index waits while the server builds it. The MCP Server page in a workspace window writes this entry for you, with the path filled in; see Connect an agent.