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.
| Command | What it does |
|---|---|
license | Shows the license status. |
license install | Installs a license key, or removes the installed one, and shows the resulting status. |
mcp-server-http | Runs an MCP server over HTTP for an object store. Alias mcp-server. |
mcp-server-stdio | Runs 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
| Option | Effect |
|---|---|
-h, --help, -? | Shows help for the tool or for the command it follows. |
--version | Prints 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:
| Option | Default | Effect |
|---|---|---|
--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
license command in a command prompt, with a license installed.It prints one line per fact:
| # | Line | Shows |
|---|---|---|
| 1 | Profile | The license profile Prism runs with. |
| 2 | Status | Unlicensed (followed by a Reason line), Licensed or Invalid. |
| 3 | Licensed to, Company, Email | Whom the license is for. Only with an installed key. |
| 4 | Expires, Trial, Expired | The 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 machine | yes when the key belongs to another machine. Only then, so not in the capture. |
| 5 | License hash, Fallback reason | A 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. |
| 6 | Machine code | The code that identifies this machine to a license. |
| 7 | License file | The 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 option | Effect |
|---|---|
key | The license key itself. Optional when you use --key-file or --stdin. |
--key-file | Reads the key from this file. An empty file removes the installed license. |
--stdin | Reads 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 code | Meaning |
|---|---|
0 | The key is installed and valid, or the license was removed (the output starts with License removed.). |
-33 | The 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.” |
-1 | No 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:
| Option | Default | Effect |
|---|---|---|
--port, -p | 47821 | The 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
--port-search.| # | Line | Shows |
|---|---|---|
| 1 | Command | The command, the object store and --port-search 47821..47920. |
| 2 | Selected port | “Selected free port … from --port-search …”: the port the server took from the range, and how many ports it scanned. |
| 3 | Running | “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 code | Meaning |
|---|---|
0 | The server stopped normally. |
-30 | The 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 …).” |
-31 | Standard 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. |
-1 | An invalid option value, such as an unknown encoding or both port options, or a server that failed to start. |
1 | The 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 code | Meaning |
|---|---|
0 | The server stopped normally. |
-1 | An invalid option value, such as an unknown encoding, or a server that failed to start. |
1 | The command line could not be parsed, or the workspace does not exist. |
Exit codes
| Code | Meaning | Commands |
|---|---|---|
0 | OK. | All |
1 | The command line could not be parsed: an unknown command or option, a missing argument, or a workspace that does not exist. | All |
-1 | An error. Standard error says what went wrong. | All but license |
-30 | The MCP server's port is unavailable. | mcp-server-http |
-31 | Redirected standard input and output, which the HTTP server does not support. | mcp-server-http |
-33 | The 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.
- Save the key in a text file the script can read, such as
C:\keys\prism-for-cal.txt. -
Run this command:
StaticalPrismCALCmd.exe license install --key-file "C:\keys\prism-for-cal.txt" - Check the exit code:
0means the key is installed;-33means it was rejected, with the reason on standard error. - 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.
- Find the absolute path of your object store: an object text file or a folder of object files.
-
Open the agent's MCP configuration file, such as
.mcp.jsonfor Claude Code or.vscode/mcp.jsonfor GitHub Copilot in Visual Studio Code. -
Add an entry whose
commandisStaticalPrismCALCmd.exeand whoseargsaremcp-server-stdioand the path. Add--encodingand the filter options when your Prism settings use them. - 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.
Related
- MCP server: connect an agent, and every tool and resource the server offers.
- Activate license window: activate or remove a license in Prism.
- Settings page: the encoding and folder store filters the server options mirror.
- Installation: install the MSIX package that brings the tool.