Skip to content
VS Code

Stata MCP Server for VS Code

io.github.aliveranme/stata-mcp

通过 pystata 驱动真实 Stata 的 MCP 服务器:数据加载/清洗/建模/诊断/图形导出,75 个工具覆盖完整计量工作流。

client:VS Code transport:stdio runtime:npm

Install Stata MCP Server in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "stata-home",
      "description": "STATA_HOME",
      "password": true
    },
    {
      "type": "promptString",
      "id": "stata-edition",
      "description": "STATA_EDITION",
      "password": true
    },
    {
      "type": "promptString",
      "id": "stata-allowed-roots",
      "description": "STATA_ALLOWED_ROOTS",
      "password": true
    }
  ],
  "servers": {
    "stata-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@aliveranme/stata-mcp"
      ],
      "env": {
        "STATA_HOME": "${input:stata-home}",
        "STATA_EDITION": "${input:stata-edition}",
        "STATA_ALLOWED_ROOTS": "${input:stata-allowed-roots}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

Stata MCP Server in other clients