Gretl MCP
v0.2.1Run Hansl/Gretl econometrics workflows via MCP with GUI launch and artifacts.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
gretl_version
Return the installed Gretl version by running gretlcli.
| Parameter | Type | Description |
|---|---|---|
gretlCliPath | string | Optional explicit path to gretlcli or gretlcli.exe. |
gretl_gui_version
Return the installed Gretl GUI version by running gretl.exe --version.
| Parameter | Type | Description |
|---|---|---|
gretlGuiPath | string | Optional explicit path to gretl or gretl.exe. |
timeoutSeconds | integer | Maximum time to wait for gretl.exe --version. Defaults to 10 seconds. |
gretl_gui_launch
Launch the visible Gretl desktop GUI, optionally opening a local dataset/script or running a provided script on startup.
| Parameter | Type | Description |
|---|---|---|
english | boolean | Force Gretl GUI to use English. |
filePath | string | Optional local dataset or script file to open in the Gretl GUI. |
gretlGuiPath | string | Optional explicit path to gretl or gretl.exe. |
newInstance | boolean | Launch a new Gretl GUI instance instead of reusing an existing one. |
runScript | boolean | When filePath points to a script, launch Gretl with --run filePath. |
safeMode | boolean | When script is provided, block shell-like commands and absolute file reads/writes. |
script | string | Optional Gretl/Hansl script to write and open with --run in the GUI. |
workspaceRoot | string | Optional directory where GUI script workspaces are created. |
gretl_run_script
Run any Gretl/Hansl script through gretlcli. By default this also requires opening the same workflow in the visible Gretl GUI.
| Parameter | Type | Description |
|---|---|---|
script * | string | Gretl/Hansl script to run. |
displayInGretl | boolean | Open a visible Gretl GUI script window for this run. Defaults to true outside CI. |
gretlCliPath | string | Optional explicit path to gretlcli or gretlcli.exe. |
gretlGuiPath | string | Optional explicit path to gretl or gretl.exe. |
guiNewInstance | boolean | Open a new Gretl GUI instance for the visible script. |
keepWorkspace | boolean | Keep the run workspace so generated artifacts remain available. |
requireGui | boolean | Require the visible Gretl GUI to open for this workflow. Defaults to true outside CI. |
safeMode | boolean | When true, blocks shell-like commands and absolute file writes. |
timeoutSeconds | integer | Maximum runtime in seconds. Defaults to 30, max 300. |
workspaceRoot | string | Optional directory where run workspaces are created. |
gretl_run_commands
Run one or more raw Gretl command lines. By default this also requires opening the same workflow in the visible Gretl GUI.
| Parameter | Type | Description |
|---|---|---|
commands * | array | Gretl command lines to run in order. |
displayInGretl | boolean | Open the generated command script in the visible Gretl GUI. Defaults to true outside CI. |
gretlCliPath | string | Optional explicit path to gretlcli or gretlcli.exe. |
gretlGuiPath | string | Optional explicit path to gretl or gretl.exe. |
guiNewInstance | boolean | Open a new Gretl GUI instance for the visible script. |
keepWorkspace | boolean | Keep the run workspace so generated artifacts remain available. |
requireGui | boolean | Require the visible Gretl GUI to open for this workflow. Defaults to true outside CI. |
safeMode | boolean | When true, blocks shell-like commands and absolute file writes. |
timeoutSeconds | integer | Maximum runtime in seconds. Defaults to 30, max 300. |
workspaceRoot | string | Optional directory where run workspaces are created. |
gretl_run_script_file
Run an existing local Gretl .inp script file with gretlcli. By default this also requires opening the same workflow in the visible Gretl GUI.
| Parameter | Type | Description |
|---|---|---|
scriptPath * | string | Path to an existing local Gretl .inp script. |
displayInGretl | boolean | Open the script file in the visible Gretl GUI after running. Defaults to true outside CI. |
gretlCliPath | string | |
gretlGuiPath | string | |
guiNewInstance | boolean | |
requireGui | boolean | Require the visible Gretl GUI to open for this workflow. Defaults to true outside CI. |
safeMode | boolean | When true, validates the script before running it. |
scriptOpt | number | Optional numeric value passed to Gretl as --scriptopt. |
timeoutSeconds | integer | |
workingDirectory | string | Working directory for the script. Defaults to the script file directory. |
gretl_capabilities
List Gretl commands, built-in functions, and package-management help from the installed Gretl version.
| Parameter | Type | Description |
|---|---|---|
displayInGretl | boolean | Open the generated help script in Gretl GUI. Defaults to false for this reference tool. |
gretlCliPath | string | |
gretlGuiPath | string | |
includeFunctions | boolean | Include Gretl's built-in accessors and functions from help functions. |
includePackageHelp | boolean | Include help for pkg and makepkg. |
timeoutSeconds | integer |
gretl_package
Install, query, run samples for, unload, remove, or index Gretl function/data packages using the native pkg command. By default this also requires opening the generated workflow in the visible Gretl GUI.
| Parameter | Type | Description |
|---|---|---|
action * | string | Gretl pkg action to perform. |
displayInGretl | boolean | Open the generated package command script in Gretl GUI. Defaults to true outside CI. |
gretlCliPath | string | |
gretlGuiPath | string | |
guiNewInstance | boolean | |
keepWorkspace | boolean | |
local | boolean | Use pkg --local for a local .gfn or .zip package file. |
packageName | string | Package name, local package path, URL, or addons for index. Required except index defaults to addons. |
quiet | boolean | Use pkg --quiet. |
requireGui | boolean | Require the visible Gretl GUI to open for this workflow. Defaults to true outside CI. |
staging | boolean | Use pkg --staging for package installs from Gretl staging. |
timeoutSeconds | integer | |
verbose | boolean | Use pkg --verbose. |
workspaceRoot | string |
gretl_make_package
Build a Gretl function package (.gfn or .zip) using the native makepkg command. By default this also requires opening the generated workflow in the visible Gretl GUI.
| Parameter | Type | Description |
|---|---|---|
packagePath * | string | Output path ending in .gfn or .zip. |
displayInGretl | boolean | Open the generated makepkg script in Gretl GUI. Defaults to true outside CI. |
gretlCliPath | string | |
gretlGuiPath | string | |
guiNewInstance | boolean | |
index | boolean | Write the auxiliary package XML index file. |
keepWorkspace | boolean | |
quiet | boolean | Use makepkg --quiet. |
requireGui | boolean | Require the visible Gretl GUI to open for this workflow. Defaults to true outside CI. |
timeoutSeconds | integer | |
translations | boolean | Write the auxiliary i18n C strings file. |
workspaceRoot | string |
gretl_help
Ask Gretl for command help, for example ols, summary, open, arima, or gnuplot. By default this also requires opening the help workflow in the visible Gretl GUI.
| Parameter | Type | Description |
|---|---|---|
commandName * | string | Gretl command name. |
displayInGretl | boolean | Open a visible Gretl GUI script window for this help request. Defaults to true outside CI. |
gretlCliPath | string | |
gretlGuiPath | string | |
requireGui | boolean | Require the visible Gretl GUI to open for this workflow. Defaults to true outside CI. |
gretl_dataset_summary
Open a Gretl-supported dataset file, return summary statistics, and open the same workflow in Gretl GUI by default.
| Parameter | Type | Description |
|---|---|---|
datasetPath * | string | Path to a CSV, gdt, Excel, Stata, SPSS, or other Gretl-supported dataset. |
displayInGretl | boolean | Open a visible Gretl GUI script window for this workflow. Defaults to true outside CI. |
gretlCliPath | string | |
gretlGuiPath | string | |
guiNewInstance | boolean | |
requireGui | boolean | Require the visible Gretl GUI to open for this workflow. Defaults to true outside CI. |
safeMode | boolean | |
timeoutSeconds | integer |
gretl_ols
Open a dataset, estimate an OLS model, and open the same workflow in Gretl GUI by default.
| Parameter | Type | Description |
|---|---|---|
datasetPath * | string | Path to a Gretl-supported dataset. |
dependentVariable * | string | Dependent variable name. |
independentVariables * | array | Independent variable names. |
displayInGretl | boolean | Open a visible Gretl GUI script window for this workflow. Defaults to true outside CI. |
gretlCliPath | string | |
gretlGuiPath | string | |
guiNewInstance | boolean | |
includeConstant | boolean | |
requireGui | boolean | Require the visible Gretl GUI to open for this workflow. Defaults to true outside CI. |
safeMode | boolean | |
timeoutSeconds | integer |