eviews-mcp
eviews-mcp
EViews를 Python에서 구동하고, Model Context Protocol을 통해 LLM 클라이언트에 노출합니다.
이 패키지에는 두 가지가 포함되어 있습니다:
라이브러리. 스크립트와 노트북용
EViews클래스 — 워크파일 생성, 모델 추정, 결과를 텍스트 또는 pandas DataFrame으로 읽기.MCP 서버. 동일한 기능을 도구로 제공하여, 어시스턴트가 실제 EViews 세션에서 계량경제학 작업을 수행할 수 있게 합니다.
Windows의 EViews 13에서 빌드 및 테스트되었습니다. EViews 10–14는 동일한 COM 인터페이스를 통해 올바르게 인식됩니다.
처음이신가요? EViews 연구자 가이드는 깨끗한 머신에서 완성된 ARDL 연구까지 안내하며, 모든 명령과 출력이 실제 EViews 세션에서 검증되었습니다. Python 지식은 필요하지 않습니다.
설치
pip install eviews-mcppandas 지원 포함:
pip install "eviews-mcp[pandas]"또는 클론에서 개발용으로:
git clone https://github.com/merwanroudane/MCP_EVIEWS.git
cd MCP_EVIEWS
pip install -e .[dev]Windows와 로컬 EViews 설치가 필요합니다. COM 자동화를 통해 EViews를 구동하기 때문입니다.
Related MCP server: econstats-mcp
라이브러리 사용
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.080모든 EViews 뷰를 텍스트로
show는 뷰를 받으므로 진단에 추가 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와 impulse는 기본적으로 그래프를 그립니다. (t) 변형은 EViews에 테이블 형식을 요청합니다. ARDL 공적분 관계와 같이 스풀로 고정되는 뷰는 COM으로 읽을 수 없으므로, show는 해당 뷰에 대해 텍스트 덤프로 대체합니다.
숫자가 필요할 때는 table()이 전체 배정밀도로 원시 행을 반환하고, value()는 하나의 숫자를 반환합니다:
rows = ev.table("eq1") # tuple of row tuples
r2 = ev.value("eq1.@r2") # 0.9947015...
beta = ev.value("eq1.@coefs(2)")결과를 텍스트가 아닌 데이터로
show는 읽기 위한 테이블을 포맷합니다. 다음은 테스트, 표 작성 또는 다른 곳에 전달하기 위해 숫자를 반환합니다:
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.9858630667863459적분 차수는 정상성이 될 때까지 차분을 통해 테스트합니다:
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, ...}]}options를 전달하여 테스트를 선택할 수 있습니다: "pp"는 Phillips-Perron, "kpss"는 KPSS, "adf, trend"는 추세를 추가합니다. KPSS는 귀무가설을 반대로 하므로 보고된 차수는 적용되지 않습니다.
표준 사후 추정 배터리를 한 번에:
report = ev.diagnose("eq1")
report["summary"]
# 'All 3 diagnostics pass at the 0.05 level.'Breusch-Godfrey, White, Jarque-Bera 각각의 통계량, p-값, 귀무가설 기각 여부. 실행할 수 없는 테스트는 report["skipped"]에 EViews가 제공한 이유와 함께 나열되므로 요약이 실제로 확인된 양을 과장하지 않습니다.
이러한 판정은 선택한 유의수준에서 p-값을 읽습니다. 이는 사양이 타당하다는 것을 입증하지 않습니다 — 구조적 변화, 계절성, 짧은 표본은 모두 이러한 테스트를 오도할 수 있습니다.
pandas 양방향
frame = ev.to_dataframe(["gdp", "k", "l"]) # indexed 1990Q1, 1990Q2, ...
frame.corr()다시 쓸 때 DatetimeIndex 또는 PeriodIndex가 페이지 빈도와 범위를 결정하므로 날짜가 정렬됩니다:
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")숫자가 아닌 열은 전체 프레임을 실패시키지 않고 건너뜁니다.
그래프
그래프는 텍스트로 렌더링할 수 없으므로 파일로 작성합니다:
ev.export_object("phillips", "residuals.png", view="resids")그래프 형식: png, jpg, pdf, emf, wmf, bmp, gif, eps, tex.
테이블 형식: csv, rtf, txt, html.
오류
EViews는 프로그램 내 줄 번호를 포함하여 실패를 정확히 보고하며, 해당 메시지는 변경 없이 전달됩니다:
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.생성된 프로그램은 실행마다 임의의 이름을 가지므로 해당 부분만 달라집니다.
MCP 서버 사용
eviews-mcp 명령을 MCP 클라이언트에 등록합니다:
{
"mcpServers": {
"eviews": {
"command": "eviews-mcp"
}
}
}Claude Code의 경우:
claude mcp add eviews -- eviews-mcp도구
도구 | 용도 |
| 연결, 버전, 활성 워크파일. 디버깅 시 여기서 시작하세요. |
| 인스턴스를 버리고 새로 시작합니다. |
| EViews 창을 표시하거나 숨깁니다. |
| 빈도와 범위로 새 페이지를 만듭니다. |
|
|
| 하나 또는 모든 열린 워크파일을 닫습니다. |
| 이름, 페이지, 빈도, 범위, 표본. |
| EViews 유형으로 필터링 가능한 목록. |
| 추정 표본을 설정합니다. |
| 주요 도구. EViews 프로그램 코드 블록을 실행합니다. |
| 인수와 함께 기존 |
| 단일 명령줄. |
| 모든 객체를 텍스트 테이블로 렌더링합니다. |
| 표현식에서 하나의 값을 가져옵니다. |
| 유형 및 시리즈에 대한 통계. |
| 계수를 깔끔한 숫자 테이블로 반환합니다. |
| 차분을 통해 테스트한 적분 차수. |
| 계열 상관, 이분산성 및 정규성. |
| 시리즈를 정렬된 테이블 또는 전체 정밀도 CSV로 반환합니다. |
| 시리즈에 값을 씁니다. |
|
|
| 시리즈를 파일로 씁니다. |
| 객체를 저장합니다 — 그래프를 검색하는 방법입니다. |
run_eviews_code는 결과를 에코하지 않습니다. EViews는 프로그램 출력을 자체 로그 창으로 보내며 COM에서 접근할 수 없기 때문입니다. 명명된 객체로 추정하고 show를 호출하세요.
알아두면 좋은 동작
이들은 라이브러리가 처리하는 EViews 특성으로, COM 코드를 직접 작성하는 사람들을 놀라게 하므로 문서화되었습니다.
쓰기는 활성 표본을 존중합니다.
smpl 2000m3 2000m6아래에서 12개 값을 쓰면 4개만 배치되고 나머지는 조용히 NA가 됩니다. 따라서 쓰기는 기본적으로 전체 페이지를 대상으로 합니다. 현재 표본을 사용하려면sample=""을 전달하세요.save는 파일 확장자를 무시합니다.graph.save "out.png"는 EMF 데이터를 씁니다. 형식은 명시적으로 전달되며, 파일을 생성하지 않는 저장은 성공을 보고하는 대신 예외를 발생시킵니다.상대 경로는 호출 프로세스가 아닌 EViews를 기준으로 해석됩니다. 따라서 경로는 전달되기 전에 절대 경로로 변환됩니다.
날짜가 있는 프레임이 페이지를 결정합니다. 열린 80행 페이지에 12행 분기 프레임을 쓰면 값이 잘못된 날짜에 배치될 수 있으므로, 프레임과 일치하는 페이지가 대신 생성됩니다.
로그 리디렉션 없음.
output명령은 고정된 객체 이름을 요구하며 그렇지 않으면 아무것도 쓰지 않으므로 로그를 캡처할 수 없습니다. 결과는 객체를 테이블로 고정하고 읽는 방식으로 얻습니다.GetScalar/PutScalar/GetString없음. 이들은 EViews COM 인터페이스에 전혀 없습니다.Get이 이를 대체하고 유형을 추론합니다.단일 COM 스레드. MCP는 동기 도구를 스레드 풀에 분산하며, COM 포인터는 아파트먼트 간에 유효하지 않으므로 모든 EViews 호출은 단일 아파트먼트 초기화 스레드로 집중됩니다.
열린 워크파일로 가져오기는 파일을 해당 페이지 길이로 조용히 잘라냅니다. 따라서 가져오기는 기본적으로 새 워크파일을 생성합니다. 현재 페이지로 병합하는 것은 선택 사항입니다.
EViews는 열 수 있는 워크파일 수를 제한하며 그 이상은 생성을 거부하므로, 긴 세션을 건강하게 유지하기 위해
close_workfile이 존재합니다.
테스트
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는 기본적으로 오프라인 스위트를 실행합니다. 라이브 스위트는 EViews 라이선스가 필요하므로 선택 사항입니다.
라이선스
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