# Gretl MCP [Health: Active]

**Category:** 🧮 Data Science Tools  
**Repository:** https://github.com/OndrejLapes/GretlMCP  
**GitHub Stars:** 3  
**npm Downloads (last month):** 244  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/gretl-mcp

## Description
Run Hansl/Gretl econometrics workflows via MCP with GUI launch and artifacts.

## Tools
Capabilities this server exposes over MCP:

- **gretl_version** — Return the installed Gretl version by running gretlcli.
- **gretl_gui_version** — Return the installed Gretl GUI version by running gretl.exe --version.
- **gretl_gui_launch** — Launch the visible Gretl desktop GUI, optionally opening a local dataset/script or running a provided script on startup.
- **gretl_run_script** — Run any Gretl/Hansl script through gretlcli. By default this also requires opening the same workflow in the visible Gretl GUI.
- **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.
- **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.
- **gretl_capabilities** — List Gretl commands, built-in functions, and package-management help from the installed Gretl version.
- **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.
- **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.
- **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.
- **gretl_dataset_summary** — Open a Gretl-supported dataset file, return summary statistics, and open the same workflow in Gretl GUI by default.
- **gretl_ols** — Open a dataset, estimate an OLS model, and open the same workflow in Gretl GUI by default.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "gretl-mcp": {
    "command": "npx",
    "args": ["-y","gretl-mcp@latest"]
  }
}
```

## Documentation

## What Gretl MCP MCP server does

Gretl MCP MCP server gives an MCP client access to Gretl econometrics workflows through a collection of focused tools. It can check whether the Gretl command-line program or desktop GUI is available, launch the GUI, inspect installed commands and functions, and retrieve help for Gretl commands.

Workflow tools accept generated Hansl scripts, raw Gretl command lines, or existing local `.inp` files. Higher-level helpers open a local dataset, return summary statistics, or estimate an OLS model. Responses can include Gretl output, workspace and script paths, GUI launch details, and generated artifacts such as plots produced by a workflow.

## How it works

The server uses `gretlcli` to execute Gretl operations and can also start the installed Gretl desktop application. By default, script, command, script-file, dataset, and OLS tools expect the GUI to open. A failed GUI launch can make a request unsuccessful even if the underlying CLI operation completed.

The default behavior is intended for visible, local workflows. Set request options or server configuration to permit headless execution when a desktop window is not appropriate, such as in CI. The server can also be placed in GUI-only mode so workflow requests cannot bypass the desktop application.

Script execution tools use `safeMode: true` by default. This blocks common shell-like commands and absolute file reads or writes, but it is not a complete sandbox. Disable the protection only for trusted local work. Dataset helper tools require existing local files and reject URLs.

## Setup and configuration

Gretl MCP MCP server requires Node.js 20 or newer, Gretl 2026b or newer, and an MCP client that supports stdio servers. Install Gretl separately and make `gretlcli` available. The server accepts optional paths through `GRETL_CLI` and `GRETL_GUI`; these point to the command-line executable and desktop executable respectively.

Build from the repository with `npm install` followed by `npm run build`, then configure the client to run the compiled `dist/index.js` with `node`. After npm publication, the documented alternative uses `npx -y gretl-mcp@latest`. `GRETLMCP_WORKSPACE_DIR` can select a directory for run workspaces.

`GRETLMCP_OPEN_GUI=false` disables default window opening, while `GRETLMCP_REQUIRE_GUI=false` allows CLI-only success when GUI access is disabled or unavailable. Set `GRETLMCP_ENFORCE_GUI_ONLY=true` to reject headless workflow requests. Equivalent command-line flags are available for executable paths, workspace selection, GUI-only mode, and headless access.

## Tools and capabilities

Available tools cover:

- Gretl and GUI version checks and visible GUI launch.
- Capability discovery for commands, functions, and package help.
- Hansl scripts, raw command lists, and local `.inp` files.
- Native `pkg` actions including install, query, sample execution, unload, remove, and index.
- Function-package creation as `.gfn` or `.zip` files through `makepkg`.
- Command help, local dataset summaries, and OLS estimation.

## Limitations and notes

The server is designed for local Gretl installations and local dataset files. Its documented transport is stdio, so the MCP client must support that transport. GUI-dependent defaults may be unsuitable for headless environments unless the relevant options are changed.

The safety mode is a guardrail rather than a full security boundary. Absolute paths and shell-like operations are restricted by default, but trusted-user judgment remains necessary when running arbitrary Hansl or when disabling safety checks. Gretl MCP MCP server also depends on the installed Gretl version and executable paths being valid.

_Full upstream README: https://allmcps.com/mcp/gretl-mcp/readme_

