Gretl MCP logo

Gretl MCP

Runs Hansl and Gretl econometrics workflows through MCP with GUI access, package management, dataset summaries, OLS, and generated artifacts.

Install Gretl MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "gretl-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "gretl-mcp@latest"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 12 tools correctly ().

Overview

Gretl MCP MCP server connects MCP clients to Gretl through gretlcli and the visible Gretl desktop application. It runs Hansl scripts, raw commands, local .inp files, package operations, dataset summaries, and OLS models, returning structured output and generated artifact paths. GUI-based tools open Gretl by default, while configuration options support controlled CLI-only execution. Reach for it when an agent needs to automate, inspect, or reproduce local Gretl econometrics workflows.

Use cases

  • Run reproducible Hansl scripts from an MCP client
  • Automate forecasting and econometrics assignments
  • Inspect local datasets and estimate OLS models
  • Manage Gretl function packages
  • Generate plots and other workflow artifacts

Key features

  • Hansl script and raw Gretl command execution
  • Visible Gretl GUI launching
  • Capability and command-help discovery
  • Local dataset summaries and OLS estimation
  • Gretl package installation and building
  • Workspace and artifact path reporting

Tools12

What Gretl MCP lets your agent do. Expand a tool for its parameters.

Verified live~3.1k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

24/28 checks healthy over the last 112d

What it can do

From the 12 tools this server returned when we ran it.

Runs commands · 2Can delete or modify data · 1Read-only tools · 9
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age165 days
Maintainers1

Observed 2026-10-28 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · gretl-mcp@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars3Stargazers on the source repository.
npm downloads244Package downloads in the last 30 days.
Last commit5mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed12Callable tools this server registers over MCP.

How Gretl MCP works

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.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Gretl MCP

Gretl MCP is an MCP server that connects AI clients to Gretl econometrics software through gretlcli and the desktop GUI. Its tools check versions, discover capabilities, run Hansl/Gretl scripts and commands, execute .inp files, manage packages, look up help, summarize datasets, and estimate OLS models.

Install Node.js 20 or newer and Gretl 2026b or newer, then clone the repository, run npm install, and run npm run build. Configure an MCP client to launch the resulting dist/index.js with node, or use npx -y gretl-mcp@latest after npm publication.

Use GRETL_CLI and GRETL_GUI to specify the Gretl command-line and desktop executable paths. GRETLMCP_WORKSPACE_DIR selects the workspace directory, while GRETLMCP_OPEN_GUI, GRETLMCP_REQUIRE_GUI, and GRETLMCP_ENFORCE_GUI_ONLY control GUI behavior and headless execution.

Yes, Gretl MCP works with Cursor through the documented local JSON stdio configuration. Point the client to node and the built dist/index.js, then provide Gretl executable paths when they are not discoverable automatically.

Yes, it can run in CLI-only mode when displayInGretl and requireGui are disabled for a call, or when GRETLMCP_OPEN_GUI=false and GRETLMCP_REQUIRE_GUI=false are set. GUI-only enforcement prevents this behavior.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGretl MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/gretl-mcp?style=directory)](https://allmcps.com/mcp/gretl-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/gretl-mcp"><img src="https://allmcps.com/api/badge/gretl-mcp?style=directory" alt="Gretl MCP on AllMCPs" /></a>