Integrations
Provides containerized deployment of the R Econometrics MCP server, allowing for easier setup and isolation of the required R environment and dependencies.
Uses Python as the interface language for the MCP server that connects R's econometric capabilities to AI assistants.
R Econometrics MCP Server
A Model Context Protocol (MCP) server that provides econometric modeling capabilities through R. This server enables AI assistants to perform sophisticated econometric analyses, including linear regression, panel data models, instrumental variables regression, and diagnostic tests.
Features
- Linear Regression: Run linear models with optional robust standard errors
- Panel Data Analysis: Fixed effects, random effects, pooling, between, and first-difference models
- Instrumental Variables: Estimate IV regression models
- Diagnostic Tests: Heteroskedasticity, autocorrelation, and functional form tests
- Resources: Reference documentation for econometric techniques
- Prompts: Pre-defined prompt templates for common econometric analyses
Installation
Prerequisites
- Python 3.8+
- R 4.0+
- R packages: plm, lmtest, sandwich, AER, jsonlite
Using Docker (Recommended)
- Build the Docker image:Copy
- Run the container:Copy
Manual Installation
- Install the required Python packages:Copy
- Install the required R packages:Copy
- Run the server:Copy
Usage with Claude Desktop
- Launch Claude Desktop
- Open the MCP Servers panel
- Add a new server with the following configuration:
- Name: R Econometrics
- Transport: stdio
- Command: path/to/python r_econometrics_mcp.py
- (Or if using Docker): docker run -i r-econometrics-mcp
Example Queries
Here are some example queries you can use with Claude once the server is connected:
Linear Regression
Panel Data Analysis
Instrumental Variables
Diagnostic Tests
Tools Reference
linear_model
Run a linear regression model.
Parameters:
formula
(string): The regression formula (e.g., 'y ~ x1 + x2')data
(object): Dataset as a dictionary/JSON objectrobust
(boolean, optional): Whether to use robust standard errors
panel_model
Run a panel data model.
Parameters:
formula
(string): The regression formula (e.g., 'y ~ x1 + x2')data
(object): Dataset as a dictionary/JSON objectindex
(array): Panel index variables (e.g., ['individual', 'time'])effect
(string, optional): Type of effects: 'individual', 'time', or 'twoways'model
(string, optional): Model type: 'within', 'random', 'pooling', 'between', or 'fd'
diagnostics
Perform model diagnostics.
Parameters:
formula
(string): The regression formula (e.g., 'y ~ x1 + x2')data
(object): Dataset as a dictionary/JSON objecttests
(array): Tests to run (e.g., ['bp', 'reset', 'dw'])
iv_regression
Estimate instrumental variables regression.
Parameters:
formula
(string): The regression formula (e.g., 'y ~ x1 + x2 | z1 + z2')data
(object): Dataset as a dictionary/JSON object
Resources
econometrics:formulas
: Information about common econometric model formulationseconometrics:diagnostics
: Reference for diagnostic testseconometrics:panel_data
: Guide to panel data analysis in R
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License
Acknowledgments
- The R Project and R Core Team
- Developers of the plm, lmtest, sandwich, and AER packages
- Anthropic for the Model Context Protocol
This server cannot be installed
Provides econometric modeling capabilities through R, enabling AI assistants to perform sophisticated analyses including linear regression, panel data models, instrumental variables regression, and diagnostic tests.