### Install Stata Packages: Examples Source: https://github.com/sepinetam/mcp-for-stata/blob/master/plugins/stata-toolbox/skills/stata-skill/references/ado_package_install.md Demonstrates installing packages from SSC, GitHub, and a custom URL. Includes examples for specifying replacement and source. ```python # Install outreg2 from SSC ado_package_install("outreg2") # Install from GitHub without overwriting ado_package_install("user/repo", source="github", is_replace=false) # Install from a custom URL ado_package_install("custompkg", source="net", package_source_from="https://site.example/stata") ``` -------------------------------- ### Install Dependencies and Setup Development Environment Source: https://github.com/sepinetam/mcp-for-stata/blob/master/CLAUDE.md Installs project dependencies using uv and sets up the package in development mode. Verifies the installation by checking the version. ```bash # Install dependencies and create virtual environment uv sync # Install the package in development mode uv pip install -e . # Verify installation stata-mcp --version ``` -------------------------------- ### Quick Start: Core API Functions Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/api/overview.md Demonstrates basic usage of key MCP-for-Stata API functions including getting data info, installing packages, executing do-files, and reading log files. ```python from stata_mcp.api import ( stata_do, get_data_info, ado_package_install, read_log, stata_help, write_dofile, ) # Get data information info = get_data_info("/path/to/data.dta") # Install an enabled and approved package result = ado_package_install("outreg2", source="ssc") # Execute a do-file log = stata_do("/path/to/analysis.do") # Read log file content = read_log("/path/to/output.log") ``` -------------------------------- ### Quick Start: Use Stata Agent as a Tool Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/agent_as/agent_as_tool.md Initialize a StataAgent and convert it into a tool for use with a main Agent. This example assumes default OpenAI models. ```python import asyncio from agents import Agent from stata_mcp.agent_as.agent_as_tool import StataAgent # init stata agent and set as tool stata_agent = StataAgent() sa_tool = stata_agent.as_tool() # Create main Agent agent = Agent( ..., tools=[sa_tool], ) # Then run the agent as usual. async def main(): ... if __name__ == "__main__": asyncio.run(main()) ``` -------------------------------- ### Run MCP-for-Stata Commands with uvx Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/cli.md Examples of using uvx to manage and run MCP-for-Stata commands without a global installation. This includes checking the version, running diagnostics, executing do-files, starting the server, and installing to a client. ```bash uvx stata-mcp --version ``` ```bash uvx stata-mcp doctor ``` ```bash uvx stata-mcp tool do /path/to/analysis.do ``` ```bash uvx stata-mcp server ``` ```bash uvx stata-mcp install -c cursor ``` -------------------------------- ### Install MCP-for-Stata Manually Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/agents/openclaw.md Recommended installation using uvx or manual installation via pip. ```bash # Run directly with uvx (recommended) uvx stata-mcp tool --help # Or install and use upip install stata-mcp stata-mcp tool --help ``` -------------------------------- ### Install All Supported Clients with MCP Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/clients.md Automatically configure all supported AI clients by running `stata-mcp install --all`. ```bash stata-mcp install --all ``` -------------------------------- ### Install and Configure Node.js with nvm Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/01_install.md Installs Node.js version 20.19.5, sets it as the default, and makes it available for use. Also checks the installed versions of Node.js and npm. ```bash nvm install 20.19.5 # At least you should install 18+ nvm alias default 20 nvm use default node -v npm -v ``` -------------------------------- ### Quick Setup Environment Variables Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/configuration.md Common environment variables for quick setup, including debug mode, working directory, monitoring, and logging. ```bash # Enable debug mode export STATA_MCP__IS_DEBUG=true # Set working directory export STATA_MCP__CWD="/projects/my-analysis" # Enable monitoring with 8GB RAM limit export STATA_MCP__IS_MONITOR=true export STATA_MCP__RAM_LIMIT=8192 # Disable security guard (not recommended) export STATA_MCP__IS_GUARD=false # Enable console logging export STATA_MCP__LOGGING_CONSOLE_HANDLER_ON=true ``` -------------------------------- ### Install MCP-for-Stata using Beta Script (macOS/Linux) Source: https://github.com/sepinetam/mcp-for-stata/blob/master/README.md Installs MCP-for-Stata and automatically installs `uv` if it's missing. Run this command in your terminal. ```bash curl -fsSL https://raw.githubusercontent.com/SepineTam/mcp-for-stata/master/scripts/install.sh | bash ``` -------------------------------- ### Install to Specific Client Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/cli.md Installs MCP-for-Stata to a single, specified AI client using the '-c' or '--client' flag. Examples include 'claude-code' and 'cursor'. ```bash # Install to a specific client stata-mcp install -c claude-code stata-mcp install -c cursor ``` -------------------------------- ### Install uvx from PyPI with pipx Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/01_install.md Installs uvx from the Python Package Index (PyPI) using pipx, which is recommended for isolated installations. ```bash pipx install uv ``` -------------------------------- ### Install uvx from astral.sh Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/01_install.md Installs uvx using a script provided by astral.sh. This method downloads and executes an installation script directly. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Install Stata-MCP and Verify Installation Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/agent_examples/README.md Install the Stata-MCP package using pip and verify the installation by checking the version. ```bash git clone https://github.com/sepinetam/stata-mcp.git cd stata-mcp pip install -e . # You can find whether it is installed successfully by: stata-mcp --version ``` -------------------------------- ### Install MCP-for-Stata using Beta Script (Windows PowerShell) Source: https://github.com/sepinetam/mcp-for-stata/blob/master/README.md Installs MCP-for-Stata and automatically installs `uv` if it's missing. Run this command in PowerShell. ```powershell irm https://raw.githubusercontent.com/SepineTam/mcp-for-stata/master/scripts/install.ps1 | iex ``` -------------------------------- ### Install uvx with Homebrew Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/01_install.md Installs uvx, a Python version manager, using Homebrew. This is an alternative method to installing uvx. ```bash brew install uvx uvx --version ``` -------------------------------- ### Minimal PromptGenerator Example Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/agent_examples/task_prompt/README.md A minimal example demonstrating initialization with default parameters and generating both instructions and tasks. Data paths can be specified using natural language. ```python from prompt_generator import PromptGenerator generator = PromptGenerator() instructions = generator.instructions() tasks = generator.tasks( datas="use Stata default data", # you can use natural language to set teh paths of data. aims="Explore the relationship between a and b" ) print(instructions) print(tasks) ``` -------------------------------- ### Execute Self-contained Install Scripts Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/cli.md Demonstrates how to run the self-contained installation scripts for various platforms (Unix shells, macOS Finder, Windows PowerShell, Windows command line). These scripts bootstrap a Python toolchain and install stata-mcp. ```bash bash install.sh ``` ```bash powershell -ExecutionPolicy Bypass -File install.ps1 ``` -------------------------------- ### One-Click Installation for All Agents Source: https://github.com/sepinetam/mcp-for-stata/blob/master/README.md Installs MCP-for-Stata for all supported agents with a single command. No manual configuration is required. ```bash uvx stata-mcp install --all ``` -------------------------------- ### Install uv Package Runner Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/claude-plugin.md Install the 'uv' package runner, recommended for managing Python packages. Installation can be done via Homebrew or the official installer script. ```bash # Install via homebrew brew install uv ``` ```bash # Or via official installer curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Install MCP-for-Stata to Specific Client Source: https://github.com/sepinetam/mcp-for-stata/blob/master/plugins/stata-toolbox/skills/stata-skill/references/installation.md Install MCP-for-Stata to a specific AI client by specifying the client flag. ```bash uvx stata-mcp install -c codex ``` ```bash uvx stata-mcp install -c claude ``` ```bash uvx stata-mcp install -c cc ``` ```bash uvx stata-mcp install -c cursor ``` ```bash uvx stata-mcp install -c cline ``` ```bash uvx stata-mcp install -c gemini ``` ```bash uvx stata-mcp install -c opencode ``` ```bash uvx stata-mcp install -c openclaw ``` ```bash uvx stata-mcp install -c hermes ``` -------------------------------- ### Install Matplotlib Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/reports/ai_coding_ability/main.ipynb Install the matplotlib library if you intend to create figures. This command uses 'uv pip' for installation. ```python # if you want to make a figure about it, you should install matplotlib. # !uv pip install matplotlib ``` -------------------------------- ### Install stata-mcp Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/agent_as/agent_as_tool.md Install the stata-mcp package using pip or uv. ```bash pip install stata-mcp ``` ```bash uv add stata-mcp ``` -------------------------------- ### RAM Limit Environment Variable Examples Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/monitoring.md Examples of setting the RAM limit using environment variables, including no limit, a specific limit, and recommended values. ```bash # No limit (default) export STATA_MCP__RAM_LIMIT=-1 # 4 GB limit export STATA_MCP__RAM_LIMIT=4096 # 8 GB limit export STATA_MCP__RAM_LIMIT=8192 # 16 GB limit export STATA_MCP__RAM_LIMIT=16384 ``` -------------------------------- ### Install Single Client with MCP Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/clients.md Use `stata-mcp install` to automatically configure a specified client. Replace `` with a valid client key. ```bash stata-mcp install -c ``` -------------------------------- ### Add and Install Stata MCP Plugin Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/claude-plugin.md Add the Stata MCP plugin marketplace and install the 'stata-toolbox' plugin. The plugin can be installed to user, project, or local scope. ```bash # Add marketplace claude plugin marketplace add sepinetam/stata-mcp ``` ```bash # Install plugin to user scope (default) claude plugin install stata-toolbox ``` ```bash # Install to project scope (shared with team) claude plugin install stata-toolbox --scope project ``` ```bash # Install to local scope (gitignored) claude plugin install stata-toolbox --scope local ``` -------------------------------- ### Install Stata Package from Network Source Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/agents/openclaw.md Installs a Stata package from a network URL. Use --source net and provide the --package-source-from URL. ```bash # Install from network stata-mcp tool ado-install custompkg --source net --package-source-from "https://example.com/stata/" --yes ``` -------------------------------- ### Install uvx from PyPI with pip Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/01_install.md Installs uvx directly using pip. Note that a Rust toolchain might be required if a prebuilt wheel is not available for your platform. ```bash pip install uv ``` -------------------------------- ### Install Stata Package from GitHub Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/agents/openclaw.md Installs a Stata package from a GitHub repository. Specify --source github and the repository name. ```bash # Install from GitHub stata-mcp tool ado-install SepineTam/TexIV --source github --yes ``` -------------------------------- ### Install Stata MCP Plugin Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/usage.md Installs the stata-toolbox plugin for MCP server and Stata LSP configuration. ```bash claude plugin install stata-toolbox@stata-plugin-lib -s project ``` -------------------------------- ### List Installed MCP Servers Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/usage.md Verifies the installation of MCP servers by listing them. ```bash claude mcp list ``` -------------------------------- ### Install uvx from astral.sh with wget Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/01_install.md Installs uvx using a script from astral.sh, utilizing wget if curl is not available. This is an alternative to the curl method. ```bash wget -qO- https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Install stata-skill via OpenClaw Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/index.md Use this command to install the stata-skill from ClawHub. This is part of the OpenClaw integration. ```text Install `stata-skill` from ClawHub by @SepineTam. ``` -------------------------------- ### Install Stata Language Server (LSP) Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/claude-plugin.md Install the 'stata-language-server' globally using npm if it's not detected or if you need to ensure the latest version is available. ```bash npm install -g stata-language-server ``` -------------------------------- ### Install psutil Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/monitoring.md Ensure the psutil library is installed and meets the minimum version requirement (>= 6.0.0) for Stata MCP monitoring. ```bash uv pip install psutil>=6.0.0 ``` -------------------------------- ### Start MCP Server with Tool Profile Selection Source: https://github.com/sepinetam/mcp-for-stata/blob/master/CLAUDE.md Starts the Stata-MCP server, allowing selection of tool profiles (all tools or core tools) and transport methods. ```bash # Start with tool profile selection stata-mcp server # All tools, stdio (same as bare command) stata-mcp server --core # Core tools only (stata_do, get_data_info, help) stata-mcp server --all -t http # All tools, HTTP transport stata-mcp server --core -t http # Core tools, HTTP transport ``` -------------------------------- ### Install Stata Package Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/agents/openclaw.md Install an enabled and approved Stata package using the `ado-install` tool. The `--yes` flag bypasses confirmation prompts. ```bash stata-mcp tool ado-install outreg2 --yes ``` -------------------------------- ### Install Claude Plugin for MCP-for-Stata Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/usage.md Add the MCP-for-Stata marketplace registry and install the plugin globally for use with Claude Code. ```bash # Add marketplace registry claude plugin marketplace add sepinetam/stata-mcp # Install plugin globally claude plugin install stata-toolbox -s user ``` -------------------------------- ### Install Stata Package from SSC Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/agents/openclaw.md Installs an approved Stata package from the SSC archive. Use the --yes flag to skip interactive confirmation. ```bash # Install an approved SSC package stata-mcp tool ado-install outreg2 --yes ``` -------------------------------- ### Install to All Clients Explicitly Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/cli.md Installs MCP-for-Stata to all supported clients by explicitly using the '--all' flag. This is functionally equivalent to omitting the '-c' and '--json-file' flags. ```bash # Install to all clients explicitly stata-mcp install --all ``` -------------------------------- ### Operational Examples for Help Resource Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/mcp/resources.md Demonstrates how to use the help resource to fetch documentation for various Stata commands across different categories. ```python # Regression commands help("regress") help("logit") help("probit") # Panel data commands help("xtset") help("xtreg") help("xtmixed") # Data management help("merge") help("reshape") help("collapse") # Time series help("tsset") help("arima") help("varsoc") ``` -------------------------------- ### Install to Custom JSON Config Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/cli.md Installs MCP-for-Stata into a custom JSON configuration file specified by '--json-file'. This allows for managing installations in non-default locations or custom setups. ```bash # Install into a custom JSON config file stata-mcp install --json-file /path/to/config.json ``` -------------------------------- ### Basic Monitoring Setup Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/monitoring.md Enable monitoring using environment variables and run MCP-for-Stata. Monitoring is automatic and requires no code changes. ```bash export STATA_MCP__IS_MONITOR=true export STATA_MCP__RAM_LIMIT=8192 stata-mcp # or stata-mcp agent run ``` -------------------------------- ### Allowlist GitHub Repositories for Ado Installation Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/configuration.md Configure the security settings to allow specific GitHub repositories for ado package installations. This requires adding approved repositories to the allowlist and starting the MCP server with the --unsafe flag. ```toml [SECURITY] ADO_INSTALL_ALLOWED_GITHUB_REPOSITORIES = ["SepineTam/TexIV"] ``` -------------------------------- ### Add MCP-for-Stata Globally for Claude Code Source: https://github.com/sepinetam/mcp-for-stata/blob/master/README.md Installs MCP-for-Stata globally for the current user, making it available for use with Claude Code. This is a one-time setup. ```bash claude mcp add stata-mcp --scope user -- uvx stata-mcp ``` -------------------------------- ### Install MCP-for-Stata Skill Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/skills/openclaw.md Download the skill's Markdown file to a specified directory. This is a prerequisite for using the skill. ```bash mkdir -p /path/to/skill/base/stata-mcp-skill curl -o /path/to/skill/base/stata-mcp-skill/SKILL.md https://github.com/SepineTam/mcp-for-stata/raw/refs/heads/master/docs/agents/openclaw.md ``` -------------------------------- ### Install Stata-MCP in Claude Code Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/00_intro.md Use this command to add the stata-mcp package within the Claude Code environment. Ensure you have the necessary permissions and environment setup. ```bash claude mcp add stata-mcp uvx stata-mcp ``` -------------------------------- ### Install Client with Custom JSON Configuration Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/clients.md Configure a client using a custom JSON file, optionally specifying a nested JSON key path with `--json-index`. ```bash stata-mcp install -c --json-file /path/to/config.json stata-mcp install -c --json-file /path/to/config.json --json-index parent.child ``` -------------------------------- ### Plugin Configuration Example Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/claude-plugin.md Specifies the metadata and server configurations for a plugin package. Includes version, author, repository, and server definitions. ```json { "name": "stata-toolbox", "version": "0.1.0", "description": "The official working package of MCP-for-Stata plugin, including mcp config and stata lsp.", "author": { "name": "Song Tan", "email": "sepinetam@gmail.com", "url": "https://www.sepinetam.com" }, "homepage": "https://statamcp.com", "repository": "https://github.com/sepinetam/mcp-for-stata", "license": "AGPL-3.0", "keywords": ["stata", "econometrics", "empirical analysis"], "mcpServers": { ... }, "lspServers": { ... } } ``` -------------------------------- ### Example TOML Configuration File Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/configuration.md A sample configuration file demonstrating various settings for debugging, logging, help caching, security, project directories, and Stata-specific options. ```toml [DEBUG] IS_DEBUG = false [DEBUG.logging] LOGGING_ON = true LOGGING_CONSOLE_HANDLER_ON = false LOGGING_FILE_HANDLER_ON = true LOG_FILE = "~/.statamcp/stata_mcp_debug.log" MAX_BYTES = 10_000_000 BACKUP_COUNT = 5 [BETA] ENABLE_WRITE_DOFILE = false [HELP] IS_CACHE = true IS_SAVE = true [SECURITY] IS_GUARD = true ADO_INSTALL_ALLOWED_GITHUB_REPOSITORIES = [] [PROJECT] WORKING_DIR = "" CLEAN_LOG_DAYS = -1 FOLDER_TAG = ".statamcp" [MONITOR] IS_MONITOR = false MAX_RAM_MB = -1 [STATA] # Optional: Override automatic Stata detection # STATA_CLI = "/path/to/stata-mp" [data_info] metrics = ["obs", "mean", "stderr", "min", "max", "q1", "q3", "skewness", "kurtosis"] string_keep_number = 10 decimal_places = 3 hash_length = 12 ``` -------------------------------- ### Install Claude Code with npm Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/01_install.md Installs Claude Code globally using npm. This is the primary method for installing the tool. ```bash npm install -g @anthropic-ai/claude-code ``` -------------------------------- ### Install Homebrew Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/01_install.md Installs Homebrew, a package manager for macOS, using a bash script. This is a prerequisite for installing other development tools. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Configure Unified Settings via Environment Variables Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/usage.md Quickly set up MCP-for-Stata configurations, including working directory, security guard, RAM monitoring, and RAM limit, using environment variables. ```bash # Quick setup with environment variables export STATA_MCP__CWD="/projects/my-analysis" export STATA_MCP__IS_GUARD=true export STATA_MCP__IS_MONITOR=true export STATA_MCP__RAM_LIMIT=16384 ``` -------------------------------- ### Install MCP-for-Stata with Codex CLI Source: https://github.com/sepinetam/mcp-for-stata/blob/master/README.md Use this command to install MCP-for-Stata via the Codex CLI. Ensure you have uv installed. ```bash uvx stata-mcp install -c codex ``` -------------------------------- ### Install Claude Code Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/claude-plugin.md Install the Claude Code application using the official installer script. This is a prerequisite for using the Stata plugin. ```bash # macOS/Linux curl -fsSL https://claude.ai/install.sh | bash ``` ```powershell # Windows irm https://claude.ai/install.ps1 | iex ``` -------------------------------- ### TOML Environment Configuration with All Features Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/clients.md Example of a TOML environment configuration enabling all security, monitoring, and logging features. ```toml env.STATA_MCP__CWD = "/path/to/project" env.STATA_MCP__IS_GUARD = "true" env.STATA_MCP__IS_MONITOR = "true" env.STATA_MCP__RAM_LIMIT = "8192" env.STATA_MCP__LOGGING_CONSOLE_HANDLER_ON = "true" ``` -------------------------------- ### Manual Agent Setup for Evaluation Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/Evaluation.md An alternative method for setting up an agent manually using the OpenAI client if you prefer not to use AgentRunner directly. Requires manual extraction of data. ```python # If you prefer to set up the agent manually from openai import OpenAI from agents import Agent, Runner client = OpenAI(api_key="your-api-key") agent = Agent( instructions="You are a helpful assistant specialized in Stata analysis.", model="gpt-3.5-turbo" ) result = client.agent.run(agent, input=YOUR_TASK) # Then extract data manually as needed ``` -------------------------------- ### Install Stata Package without Replacing Existing Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/agents/openclaw.md Installs a Stata package but prevents replacement of existing files. Useful for checking installation status. ```bash # Don't replace existing package (useful for checking installation status) stata-mcp tool ado-install estout --yes --is-replace false ``` -------------------------------- ### List Installed Claude Plugins Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/claude-plugin.md Verify that the Stata plugin is loaded by listing all installed Claude plugins. This command confirms the successful installation and availability of the plugin. ```bash # List installed plugins claude plugin list ``` -------------------------------- ### Marketplace Manifest Example Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/claude-plugin.md Defines the structure for a plugin library registry. Includes library name, owner details, and a list of plugins. ```json { "name": "stata-plugin-lib", "owner": { "name": "Song Tan", "email": "sepinetam@gmail.com" }, "plugins": [ { "name": "stata-toolbox", "source": "./plugins/stata-toolbox", "description": "The official working package of MCP-for-Stata plugin, including mcp config and stata lsp." } ] } ``` -------------------------------- ### Install Stata Package from SSC Source: https://github.com/sepinetam/mcp-for-stata/blob/master/plugins/stata-toolbox/skills/stata-skill/references/ado_package_install.md Installs a Stata package from the SSC archive. This is the default source. Consider checking if the package is already installed to avoid unnecessary downloads. ```python ado_package_install("outreg2") ado_package_install("reghdfe") ado_package_install("estout", is_replace=false) ``` -------------------------------- ### Programmatic RAM Monitoring Setup Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/monitoring.md Instantiate RAMMonitor with a specific limit and pass it to StataDo for programmatic monitoring. ```python from stata_mcp.monitor import RAMMonitor from stata_mcp.core.stata import StataDo # Create monitor with 8GB limit monitor = RAMMonitor(max_ram_mb=8192) # Pass to StataDo stata = StataDo( dofile_path="analysis.do", monitors=[monitor] # Optional: list of monitors ) # Execution is automatically monitored result = stata.execute() ``` -------------------------------- ### Verify Installation Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/cli.md Check if the stata-mcp CLI is installed and accessible by displaying its version. ```bash stata-mcp --version ``` -------------------------------- ### Install Stata Package Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/mcp/tools.md Installs a Stata package from various sources like SSC, GitHub, or a network URL. Use this to manage Stata package installations programmatically. Ensure the 'unsafe' profile is enabled for this tool. ```python def ado_package_install(package: str, source: str = "ssc", is_replace: bool = False, package_source_from: str | None = None) -> str: ... ``` ```python # SSC package installation ado_package_install("outreg2", source="ssc") ``` ```python # GitHub package installation ado_package_install("sepinetam/texiv", source="github") ``` ```python # Network installation ado_package_install("custompkg", source="net", package_source_from="https://example.com/stata") ``` ```python # Force reinstall ado_package_install("estout", source="ssc", is_replace=True) ``` -------------------------------- ### Install Stata Package from GitHub Source: https://github.com/sepinetam/mcp-for-stata/blob/master/plugins/stata-toolbox/skills/stata-skill/references/ado_package_install.md Installs a Stata package from a GitHub repository. The repository must follow Stata package conventions and be listed in the allowlist. GitHub packages do not receive security protection, so inspect them before installation. ```python ado_package_install("SepineTam/TexIV", source="github") ``` -------------------------------- ### Add New Configuration Option Source: https://github.com/sepinetam/mcp-for-stata/blob/master/CONTRIBUTING.md Example of how to implement a new configuration option in the project's configuration system. This involves defining a property that retrieves a configuration value, potentially from environment variables, with a default and a validator. ```python MY_NEW_OPTION: return self._get_config_value( config_keys=["SECTION", "MY_OPTION"], env_var="STATA_MCP__MY_OPTION", default=False, converter=self._to_bool, validator=lambda x: isinstance(x, bool) ) ``` -------------------------------- ### Project-based MCP Server Installation Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/usage.md Installs the stata-mcp MCP server scoped to a specific project directory. ```bash cd ~/Documents/MyResearchProject claude mcp add stata-mcp --env STATA_MCP__CWD=$(pwd) --scope project -- uvx --directory $(pwd) stata-mcp ``` -------------------------------- ### JSON Environment Configuration with Security and Monitoring Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/clients.md Example of a JSON environment configuration enabling security guard and RAM monitoring. ```json "env": { "STATA_MCP__CWD": "/path/to/project", "STATA_MCP__IS_GUARD": "true", "STATA_MCP__IS_MONITOR": "true", "STATA_MCP__RAM_LIMIT": "8192" } ``` -------------------------------- ### Create and Execute a Stata Do-file Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/api/overview.md Demonstrates how to write a Stata do-file programmatically and then execute it using the stata_do function. Ensure the do-file path is correctly specified. ```python dofile_path = write_dofile(""" use \"/data/survey.dta\", clear regress income age education estat hettest """) # Execute it result = stata_do(dofile_path) ``` -------------------------------- ### Start MCP Server with Stdout/Stdin Transport Source: https://github.com/sepinetam/mcp-for-stata/blob/master/CLAUDE.md Starts the Stata-MCP server using the default stdio transport. ```bash # Start MCP server with stdio transport (default) stata-mcp ``` -------------------------------- ### Install to All Supported Clients Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/cli.md Installs MCP-for-Stata to all supported AI clients without specifying individual clients or a JSON file. This is the default behavior when no client or JSON file options are provided. ```bash # Install to all supported clients (no -c, no --json-file) stata-mcp install ``` -------------------------------- ### Install Claude Code with Homebrew (Beta) Source: https://github.com/sepinetam/mcp-for-stata/blob/master/source/docs/Usages/ClaudeCode/01_install.md Installs Claude Code using Homebrew. This method is noted as being in beta. ```bash brew install --cask claude-code ``` -------------------------------- ### get_data_info Operational Examples Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/mcp/tools.md Demonstrates various ways to call the get_data_info function, including local files, remote URLs, and specific encodings. ```python # Local file analysis get_data_info("/data/econometrics/survey.dta") get_data_info("~/Documents/exports/quarterly.csv", vars_list=["gdp", "inflation", "unemployment"]) ``` ```python # Remote data ingestion get_data_info("https://repository.org/datasets/panel_data.xlsx") ``` ```python # Encoded source handling get_data_info("/data/legacy/latin1_data.csv", encoding="latin1") ``` -------------------------------- ### Install SSC Package Source: https://github.com/sepinetam/mcp-for-stata/blob/master/plugins/stata-toolbox/skills/stata-skill/SKILL.md Requests approval to install a package from the SSC archive. Ensure the package name is correct. ```python ado_package_install("outreg2") ``` -------------------------------- ### Troubleshooting Configuration Loading: Check Config File Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/configuration.md Verify the existence of the TOML configuration file in the default location. ```bash ls ~/.statamcp/config.toml ``` -------------------------------- ### Install MCP-for-Stata Skills in OpenClaw Source: https://github.com/sepinetam/mcp-for-stata/blob/master/docs/agents/openclaw.md Use this message to instruct OpenClaw to install MCP-for-Stata skills from the provided URL. ```text Install MCP-for-Stata Skills from https://docs.statamcp.com/skills/openclaw ```