{"id":29114086,"url":"https://github.com/finite-sample/rmcp","last_synced_at":"2025-07-29T10:11:31.938Z","repository":{"id":284616052,"uuid":"955516717","full_name":"finite-sample/rmcp","owner":"finite-sample","description":"R MCP Server","archived":false,"fork":false,"pushed_at":"2025-05-01T01:43:12.000Z","size":67,"stargazers_count":25,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-29T11:08:03.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/finite-sample.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"citation.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-26T19:03:30.000Z","updated_at":"2025-06-26T14:51:20.000Z","dependencies_parsed_at":"2025-03-26T20:22:55.133Z","dependency_job_id":"8335ac58-9abe-4f13-956f-89f64d3dc194","html_url":"https://github.com/finite-sample/rmcp","commit_stats":null,"previous_names":["gojiplus/rmcp","finite-sample/rmcp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/finite-sample/rmcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Frmcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Frmcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Frmcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Frmcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/finite-sample","download_url":"https://codeload.github.com/finite-sample/rmcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Frmcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267668843,"owners_count":24124972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-29T11:06:04.728Z","updated_at":"2025-07-29T10:11:31.930Z","avatar_url":"https://github.com/finite-sample.png","language":"Python","funding_links":[],"categories":["📚 Projects (1974 total)","Data Science Tools","Scientific Research Tools"],"sub_categories":["MCP Servers","How to Submit"],"readme":"## R MCP Server\n\n[![PyPI version](https://img.shields.io/pypi/v/rmcp.svg)](https://pypi.org/project/rmcp/)\n[![Downloads](https://pepy.tech/badge/rmcp)](https://pepy.tech/project/rmcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA Model Context Protocol (MCP) server that provides advanced econometric modeling and data analysis capabilities through R. This server enables AI assistants to perform sophisticated econometric and statistical analyses seamlessly, helping you quickly gain insights from your data.\n\n## Features\n\n- **Linear Regression:** Run linear models with optional robust standard errors.\n- **Panel Data Analysis:** Estimate fixed effects, random effects, pooling, between, and first-difference models.\n- **Instrumental Variables:** Build and estimate IV regression models.\n- **Diagnostic Tests:** Assess heteroskedasticity, autocorrelation, and model misspecification.\n- **Descriptive Statistics:** Generate summary statistics for datasets using R’s summary() functionality.\n- **Correlation Analysis:** Compute Pearson or Spearman correlations between variables.\n- **Group-By Aggregations:** Group data by specified columns and compute summary statistics using dplyr.\n- **Resources:** Access reference documentation for various econometric techniques.\n- **Prompts:** Use pre-defined prompt templates for common econometric analyses.\n\n\n## Installation\n\n### Using Docker (Recommended)\n\n1. Build the Docker image:\n   ```bash\n   docker build -t r-econometrics-mcp .\n   ```\n\n2. Run the container:\n\n```bash\ndocker run -it r-econometrics-mcp\n```\n\n### Manual Installation\n\nInstall the required Python packages:\n\n```bash\npip install -r requirements.txt\n```\n\nInstall the required R packages (if you run the server outside a container):\n\n```R\ninstall.packages(c(\"plm\", \"lmtest\", \"sandwich\", \"AER\", \"jsonlite\"), repos=\"https://cloud.r-project.org/\")\n```\n\nRun the server:\n\n```bash\npython rmcp.py\n```\n\n## Usage\n\nThe server communicates via standard input/output. When you run:\n\n```bash\npython rmcp.py\n```\n\nit starts and waits for JSON messages on standard input. To test the server manually, create a file (for example, test_request.json) with a compact (single-line) JSON message.\n\n### Example Test\nCreate test_request.json with the following content (a one-line JSON):\n\n```json\n{\"tool\": \"linear_model\", \"args\": {\"formula\": \"y ~ x1\", \"data\": {\"x1\": [1,2,3,4,5], \"y\": [1,3,5,7,9]}, \"robust\": false}}\n```\n\nThen run:\n\n```bash\ncat test_request.json | python rmcp.py\n```\n\nOutput\n\n```\n{\"coefficients\": {\"(Intercept)\": -1, \"x1\": 2}, \"std_errors\": {\"(Intercept)\": 2.8408e-16, \"x1\": 8.5654e-17}, \"t_values\": {\"(Intercept)\": -3520120717017444, \"x1\": 23349839270207356}, \"p_values\": {\"(Intercept)\": 5.0559e-47, \"x1\": 1.7323e-49}, \"r_squared\": 1, \"adj_r_squared\": 1, \"sigma\": 2.7086e-16, \"df\": [2, 3, 2], \"model_call\": \"lm(formula = formula, data = data)\", \"robust\": false}\n```\n## Usage with Claude Desktop\n\n1. Launch Claude Desktop\n2. Open the MCP Servers panel\n3. Add a new server with the following configuration:\n   - Name: R Econometrics\n   - Transport: stdio\n   - Command: path/to/python r_econometrics_mcp.py\n   - (Or if using Docker): docker run -i r-econometrics-mcp\n\n## Example Queries\n\nHere are some example queries you can use with Claude once the server is connected:\n\n### Linear Regression\n\n```\nCan you analyze the relationship between price and mpg in the mtcars dataset using linear regression?\n```\n\n### Panel Data Analysis\n\n```\nI have panel data with variables gdp, investment, and trade for 30 countries over 20 years. Can you help me determine if a fixed effects or random effects model is more appropriate?\n```\n\n### Instrumental Variables\n\n```\nI'm trying to estimate the causal effect of education on wages, but I'm concerned about endogeneity. Can you help me set up an instrumental variables regression?\n```\n\n### Diagnostic Tests\n\n```\nAfter running my regression model, I'm concerned about heteroskedasticity. Can you run appropriate diagnostic tests and suggest corrections if needed?\n```\n\n## Tools Reference\n\n### linear_model\n\nRun a linear regression model.\n\n**Parameters**:\n- `formula` (string): The regression formula (e.g., 'y ~ x1 + x2')\n- `data` (object): Dataset as a dictionary/JSON object\n- `robust` (boolean, optional): Whether to use robust standard errors\n\n### panel_model\n\nRun a panel data model.\n\n**Parameters**:\n- `formula` (string): The regression formula (e.g., 'y ~ x1 + x2')\n- `data` (object): Dataset as a dictionary/JSON object\n- `index` (array): Panel index variables (e.g., ['individual', 'time'])\n- `effect` (string, optional): Type of effects: 'individual', 'time', or 'twoways'\n- `model` (string, optional): Model type: 'within', 'random', 'pooling', 'between', or 'fd'\n\n### diagnostics\n\nPerform model diagnostics.\n\n**Parameters**:\n- `formula` (string): The regression formula (e.g., 'y ~ x1 + x2')\n- `data` (object): Dataset as a dictionary/JSON object\n- `tests` (array): Tests to run (e.g., ['bp', 'reset', 'dw'])\n\n### iv_regression\n\nEstimate instrumental variables regression.\n\n**Parameters**:\n- `formula` (string): The regression formula (e.g., 'y ~ x1 + x2 | z1 + z2')\n- `data` (object): Dataset as a dictionary/JSON object\n\n## Resources\n\n- `econometrics:formulas`: Information about common econometric model formulations\n- `econometrics:diagnostics`: Reference for diagnostic tests\n- `econometrics:panel_data`: Guide to panel data analysis in R\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nMIT License\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinite-sample%2Frmcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinite-sample%2Frmcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinite-sample%2Frmcp/lists"}