eviews-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@eviews-mcpRun a unit root test on gdp and report the p-value"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
eviews-mcp
Drive EViews from Python, and expose it to LLM clients over the Model Context Protocol.
Documentation site · Researcher guide · PyPI
Two things in one package:
A library. An
EViewsclass for scripts and notebooks — build workfiles, estimate models, read results back as text or pandas DataFrames.An MCP server. The same capabilities as tools, so an assistant can do econometrics in a real EViews session.
Built and tested against EViews 13 on Windows; EViews 10–14 resolve correctly through the same COM interface.
New to this? The EViews Researcher Guide takes you from a clean machine to a finished ARDL study, with every command and every output verified against a real EViews session. No Python knowledge assumed.
Install
pip install eviews-mcpWith pandas support:
pip install "eviews-mcp[pandas]"Or from a clone, for development:
git clone https://github.com/merwanroudane/MCP_EVIEWS.git
cd MCP_EVIEWS
pip install -e .[dev]Requires Windows and a local EViews installation, since it drives EViews through COM automation.
Related MCP server: econstats-mcp
Library use
from eviews_mcp import EViews
with EViews() as ev:
ev.create_workfile("q", "1990q1", "2020q4")
ev.run("""
series k = 100 + @trend + 3*@nrnd
series l = 50 + 0.5*@trend + 2*@nrnd
series gdp = 10 + 0.6*k + 0.3*l + 2*@nrnd
equation eq1.ls gdp c k l
""")
print(ev.show("eq1"))
print(ev.value("eq1.@r2"))Dependent Variable: GDP
Method: Least Squares
Included observations: 124
Variable Coefficient Std. Error t-Statistic Prob.
C 9.58073 0.829252 11.5535 2.90e-21
K 0.591693 0.0333819 17.7250 1.99e-35
L 0.322394 0.0673315 4.78816 4.81e-06
R-squared 0.994702 Mean dependent var 131.080Any EViews view, as text
show takes a view, so diagnostics need no extra API:
ev.show("eq1", "wald c(2)=c(3)") # coefficient restriction test
ev.show("eq1", "resids(t)") # residual table
ev.show("eq1", "coefcov") # coefficient covariance
ev.show("eq1", "auto(2)") # Breusch-Godfrey serial correlation
ev.show("eq1", "white") # White heteroskedasticity test
ev.show("gdp", "uroot") # unit root test
ev.show("gdp", "correl") # correlogram
ev.show("ardl1", "cointrel") # ARDL long-run relationship
ev.show("var1", "impulse(t)") # impulse response table
ev.show("var1", "testexog") # Granger causalityresids and impulse draw graphs by default; the (t) variants ask EViews
for the table form. Views that freeze into a spool rather than a table -- the
ARDL cointegrating relationship among them -- cannot be read over COM at all,
so show falls back to a text dump for those.
For the numbers rather than the layout, table() returns raw rows at full
double precision, and value() returns one number:
rows = ev.table("eq1") # tuple of row tuples
r2 = ev.value("eq1.@r2") # 0.9947015...
beta = ev.value("eq1.@coefs(2)")Results as data, not just text
show formats a table for reading. These return the numbers instead, for
testing, tabulating, or passing to something else:
ev.coefficients("eq1")
# [{'variable': 'LNK', 'coefficient': 0.549198724914677,
# 'std_error': 0.023936158605687322, 't_stat': 22.94431341143375,
# 'p_value': 5.677925593821611e-41}, ...]
ev.fit("eq1")["R-squared"] # 0.9858630667863459Order of integration, tested down through differences until stationary:
ev.unit_root("lngdp")
# {'series': 'LNGDP', 'order_of_integration': 1, 'conclusion': 'I(1)',
# 'steps': [{'difference': 0, 'statistic': -0.5001, 'p_value': 0.8856, ...},
# {'difference': 1, 'statistic': -12.1778, 'p_value': 0.0001, ...}]}Pass options to choose the test: "pp" for Phillips-Perron, "kpss" for
KPSS, "adf, trend" to add a trend. KPSS reverses the null, so the reported
order does not apply to it.
The standard post-estimation battery in one call:
report = ev.diagnose("eq1")
report["summary"]
# 'All 3 diagnostics pass at the 0.05 level.'Breusch-Godfrey, White and Jarque-Bera, each with its statistic, p-value and
whether the null is rejected. A test that cannot run is listed under
report["skipped"] with the reason EViews gave, so the summary never overstates
how much was actually checked.
These verdicts read p-values against a level you choose. They do not establish that a specification is sound -- structural breaks, seasonality and short samples all mislead these tests.
pandas both ways
frame = ev.to_dataframe(["gdp", "k", "l"]) # indexed 1990Q1, 1990Q2, ...
frame.corr()Writing back, a DatetimeIndex or PeriodIndex decides the page frequency and
span, so dates stay aligned:
import numpy as np
import pandas as pd
rng = np.random.default_rng(7)
index = pd.period_range("2005Q1", periods=40, freq="Q")
unemployment = 7.0 - 0.05 * np.arange(40) + rng.normal(0, 0.4, 40)
df = pd.DataFrame(
{"unemployment": unemployment,
"inflation": 9.0 - 0.9 * unemployment + rng.normal(0, 0.5, 40)},
index=index,
)
ev.from_dataframe(df) # creates a quarterly 2005Q1-2014Q4 page
ev.run("equation phillips.ls inflation c unemployment")Non-numeric columns are skipped rather than failing the whole frame.
Graphs
Graphs cannot be rendered as text, so write them to a file:
ev.export_object("phillips", "residuals.png", view="resids")Graph formats: png, jpg, pdf, emf, wmf, bmp, gif, eps, tex.
Table formats: csv, rtf, txt, html.
Errors
EViews reports failures precisely, including the line number inside a program, and those messages are passed through unchanged:
ev.run("""series ok = 1
broken_command
""")EViewsError: BROKEN_COMMAND is not defined or is an illegal command in "BROKEN_COMMAND"
in MCP_77B699157F3B.PRG on line 2.The generated program is given a random name each run, so only that part varies.
MCP server use
Register the eviews-mcp command with your MCP client:
{
"mcpServers": {
"eviews": {
"command": "eviews-mcp"
}
}
}For Claude Code:
claude mcp add eviews -- eviews-mcpTools
Tool | Purpose |
| Connection, version, active workfile. Start here when debugging. |
| Discard the instance and start clean. |
| Show or hide the EViews window. |
| New page by frequency and range. |
| Open and save |
| Close one or all open workfiles. |
| Name, page, frequency, range, sample. |
| Inventory, filterable by EViews type. |
| Set the estimation sample. |
| Main tool. Run a block of EViews program code. |
| Run an existing |
| A single command line. |
| Render any object as a text table. |
| One value from an expression. |
| Type, plus statistics for a series. |
| Coefficients as a clean table of numbers. |
| Order of integration, tested down through differences. |
| Serial correlation, heteroskedasticity and normality. |
| Series as an aligned table or full-precision CSV. |
| Write values into a series. |
| Read |
| Write series to a file. |
| Save an object — the way to retrieve graphs. |
Results are not echoed by run_eviews_code, because EViews sends program
output to its own log window where COM cannot reach it. Estimate into a named
object and call show on it.
Behaviour worth knowing
These are EViews characteristics that the library handles for you, documented because they surprise people writing COM code directly.
Writes respect the active sample. Under
smpl 2000m3 2000m6, writing 12 values lands 4 and silently leaves the rest NA. Writes therefore default to the whole page; passsample=""to opt into the current sample instead.saveignores the file extension.graph.save "out.png"writes EMF data. The format is passed explicitly, and a save that produces no file raises rather than reporting success.Relative paths resolve against EViews, not the calling process, so paths are made absolute before they are handed over.
A dated frame governs the page. Writing a 12-row quarterly frame into an open 80-row page would land the values on the wrong dates, so a page matching the frame is created instead.
No log redirection. The
outputcommand requires a frozen object name and otherwise writes nothing at all, so it cannot capture a log. Results come from freezing an object into a table and reading that.No
GetScalar/PutScalar/GetString. These are not on the EViews COM interface at all.Getcovers them and infers the type.One COM thread. MCP dispatches synchronous tools across a thread pool, and a COM pointer is not valid across apartments, so every EViews call is funnelled onto a single apartment-initialised thread.
Importing into an open workfile truncates the file to that page's length, silently. Imports therefore create a new workfile by default; merging into the current page is opt-in.
EViews limits how many workfiles may be open and then refuses to create another, so
close_workfileexists to keep long sessions healthy.
Tests
python tests/test_offline.py # 27 tests, no EViews needed
python tests/test_live.py # 25 tests, drives the MCP tool layer
python tests/test_live_client.py # 58 tests, drives the library APIpytest runs the offline suite by default; the live suites are opt-in because
they need an EViews licence.
Licence
MIT. Copyright (c) 2026 Merwan Roudane.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceAn MCP server that lets Large Language Models interact with Stata software to perform regression analysis and other statistical operations.4243AGPL 3.0
- FlicenseNot gradedqualityDmaintenanceEconomic data MCP server that connects FRED, BLS, BEA, IMF, World Bank, and ECB to any MCP-compatible client, with built-in methodology rules to guide LLMs in selecting appropriate economic indicators.
- AlicenseNot gradedqualityDmaintenanceEconometrics MCP server for regression, causal inference, time series, panel data, machine learning, and broader statistical analysis workflows.10MIT
- AlicenseAqualityBmaintenanceDeterministic time-series statistics for AI agents. This MCP server gives any LLM agent unit-tested statistical tools — anomaly detection, changepoint detection, seasonal decomposition, stationarity/trend tests, data-quality audits, baseline forecasts — with schema-validated structured output and no arbitrary code execution.17MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/merwanroudane/MCP_EVIEWS'
If you have feedback or need assistance with the MCP directory API, please join our Discord server