MCP工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/brycewang-stanford/stata-code
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"mcp--": {
"command": "npx",
"args": ["-y", "stata-code"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 MCP工具 执行以下任务... Claude: [自动调用 MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"mcp__": {
"command": "npx",
"args": ["-y", "stata-code"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<p align="center"> <img src="https://raw.githubusercontent.com/brycewang-stanford/stata-code/main/branding/logo/horizontal@1024.png" alt="stata-code logo" width="520" /> </p>
<p align="center"> <a href="README.md"><strong>English</strong></a> | <a href="README.zh.md">中文</a> </p>
Requirements: Stata 17+ (with pystata shipped by Stata) and Python 3.10+.
```bash
git clone https://github.com/brycewang-stanford/stata-code.git cd stata-code pip install -e ".[mcp,kernel]"
> **Naming note.** The PyPI distribution is `stata-code` (hyphen), but
> the Python import is `stata_code` (underscore — Python identifiers
> can't contain hyphens). Same convention as `scikit-learn` →
> `import sklearn`. So: `pip install stata-code`,
> `from stata_code import run`.
Note: `pystata` is **not** on PyPI; it ships with Stata. `stata-code` auto-discovers it on macOS at `/Applications/Stata/utilities/pystata` and at equivalent Linux / Windows paths. If your install is elsewhere, add it to `PYTHONPATH` before importing.
Verify the local setup with the read-only doctor:
bash stata-code doctor stata-code doctor --json # machine-readable output stata-code doctor --no-stata-probe # skip live Stata initialization ```
The doctor reports the package/Python version, MCP and Jupyter extras, pystata discovery, console scripts on PATH, client/VS Code configuration hints, and a best-effort Stata version/edition probe. It never edits shell, Stata, Claude, or VS Code config.
---
claude mcp add stata-code --scope user -- stata-code-mcp
pip install "stata-code[kernel]"
Verify the kernel is registered:
bash jupyter kernelspec list
See examples/ for end-to-end cookbook entries: basic regression, DiD, graphs, multi-session, and large matrices.
claude mcp add stata-code --scope local -- stata-code-mcp
The companion extension is on the Marketplace as brycewang-stanford.stata-code-vscode. It spawns stata-code-mcp as a child process and adds syntax highlighting, an Outline view for **# sections and program define blocks, code-lens "Run cell" and "Run section" actions on .do files, a seven-view sidebar (sessions / last result / data variables / run history / logs / graphs / outputs) — including an agent-native equivalent of Stata's Variables window and an Outputs panel that surfaces the esttab tables and export files each run writes to disk — status-bar indicators, completions, help lookup, conservative variable rename, and inline diagnostics from the v1.0 typed errors.
```bash
code --install-extension brycewang-stanford.stata-code-vscode ```
Or open the Extensions sidebar in VS Code and search stata-code. The extension is also available from Open VSX so Cursor, Windsurf, and other VS Code-compatible editors can install it without going through the Microsoft Marketplace.
On first activation the extension probes for stata-code-mcp on PATH (and in any workspace .venv / venv). If nothing resolves, it shows a one-time install hint with the exact pip install "stata-code[mcp]" command — choose Don't show again to silence it for the installed extension version.
If the extension or an MCP client cannot find the server, run stata-code doctor --no-stata-probe in the same Python environment. It reports whether stata-code-mcp is on PATH and suggests absolute-path or python -m stata_code.mcp fallbacks for GUI clients whose PATH differs from your shell.
The extension recognizes two complementary structural markers inside .do files. Either can be mixed in the same file; they do not conflict.
| Marker | Purpose | Example |
|---|---|---|
* %% [title] | Cell boundary. Each marker gets a **▶ Run Cell** code-lens; "Run Cell" submits the lines between this marker and the next one. Compatible with the Jupyter-style cell convention used by kylebutts/vscode-stata. | * %% 02 model fit |
**# title … **###### title | Section heading, 1–6 levels deep. Each heading gets a **▶ Run Section** code-lens and contributes to the Outline view. "Run Section" submits the heading through the next equal- or higher-level heading, matching the hierarchical execution model from ZihaoVistonWang.stata-all-in-one. | **## DiD specification |
program define … end blocks are also surfaced in the Outline, nested under whichever section contains them.
The extension still requires the MCP extra on your system Python (pip install "stata-code[mcp]"), so that stata-code-mcp resolves on PATH and can import the MCP SDK. Stata 17+ and a valid Stata license are required as for any other frontend.
---
| stata-code | SepineTam/stata-mcp | hanlulong/stata-mcp | nbstata | |
|---|---|---|---|---|
| License | **MIT** | AGPL-3.0 | MIT | GPL-3.0 |
| Standalone MCP | ✓ | ✓ | bundled with VS Code | — |
| Jupyter kernel | ✓ | — | — | ✓ |
| Unified result schema | ✓ ([SCHEMA.md](SCHEMA.md)) | per-tool | per-tool | per-tool |
| Token-economy defaults | ✓ (log refs, graph refs) | — | — | — |
| Typed errors + suggestions | ✓ (31 kinds) | — | — | — |
| Multi-session | ✓ (Stata frames) | partial | — | — |
| Mature ecosystem | early | ✓ (statamcp.com, cookbook) | ✓ (11k installs) | ✓ |
stata-code is the younger, MIT-licensed, agent-native alternative in this problem space. Among the AGPL options, SepineTam's stata-mcp is currently more mature; stata-code is aimed at cases where copyleft contagion is unacceptable and agents need structured results.
---
高质量的MCP工具,易于使用
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,MCP工具 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | stata-code |
| Topics | mcp数据分析python |
| GitHub | https://github.com/brycewang-stanford/stata-code |
| License | MIT |
| 语言 | Python |
收录时间:2026-06-21 · 更新时间:2026-06-21 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端