Full project access
Projects, datasets, do-files, Bantuity Check, cleaning, executions, and pipeline history through MCP tools in your IDE.
Model Context Protocol
The Bantuity MCP server connects coding tools to your Copilot projects: upload data, generate do-files, and run licensed local Stata with the same pipeline as the desktop application.
Coding agents stay in the IDE. Stata still runs only on your machine via the desktop connector.
Projects, datasets, do-files, Bantuity Check, cleaning, executions, and pipeline history through MCP tools in your IDE.
Start the Stata service in Bantuity Studio Light. Analysis runs only on your licensed Stata; jobs wait if the service is offline.
Failed runs can diagnose common issues, patch the do-file, and re-run. Use get_pipeline to review the trail.
One-time setup on the machine that runs your coding tool.
mcp/).cd path\to\stata-copilot\mcp python -m pip install -e .
bantuity-mcp # or: python -m bantuity_mcpThe process waits on stdio — that is correct for MCP hosts.
Optional environment variables in mcp/.env: BANTUITY_API_URL, BANTUITY_ADMIN_KEY, and BANTUITY_PROJECT_ID. See the package README for production values.
After pip install -e ., use the short form. Without install, use the Python + cwd form below.
Add to .mcp.json, Claude Desktop config, or Cursor MCP settings:
{
"mcpServers": {
"bantuity": {
"command": "bantuity-mcp",
"env": {
"BANTUITY_API_URL": "https://stata-copilot-api.onrender.com",
"BANTUITY_ADMIN_KEY": "123456"
}
}
}
}Project template also ships as stata-copilot/.mcp.json and mcp/examples/*.json.
Same idea — command + env. Fallback without global install:
{
"mcpServers": {
"bantuity": {
"command": "python",
"args": ["-m", "bantuity_mcp"],
"cwd": "C:\\Users\\YOU\\Desktop\\stata-copilot\\mcp",
"env": {
"PYTHONPATH": "src",
"BANTUITY_API_URL": "https://stata-copilot-api.onrender.com",
"BANTUITY_ADMIN_KEY": "123456"
}
}
}
}Set cwd to your real stata-copilot\\mcp path.
connector_status (online?).upload_dataset with a local CSV/DTA path, or use an existing project.bantuity_check, or chat(prompt=…, run=true, wait=true), or run_stata_code.get_execution / get_pipeline for logs, interpretation, and recovery attempts.One-shot helper: analyze_workflow(prompt, file_path, run=true) uploads (optional), chats, and waits for Stata + recovery.
Full list and env vars: mcp/README.md
healthwhoamiconnector_statuslist_projectscreate_projectensure_projectupload_datasetlist_datasetsactivate_datasetchatrun_stata_codebantuity_checkclean_datasetanalyze_workflowget_executionwait_executionlist_executionsget_pipelineread_project_filedashboard_recentInstall MCP for your IDE, keep the desktop Stata service running for live runs, or use the browser workspace for the same pipeline.