stata-mcp
CLAUDE.md522 starsChanged 11 months agoMITView on GitHub
CRITICAL: Never use pkill -f stata_mcp_server.py directly! The MCP server runs on port 4000. Killing the server process incorrectly can terminate the current Claude Code session since Claude Code also connects to port 4000. Always use the restart script: This script: 1. Auto-detects VS Code, Cursor, or Antigravity extension directory 2. Copies updated source files to the installed extension 3. Sends graceful SIGTERM (not SIGKILL) to stop the server 4. Starts the server with correct settings 5. Verifies the server…
- Sends data out
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Always use the restart script:
- Very specific: line 25
Run the restart script: ./scripts/restart_server.sh
- Very specific: line 26
Test the server: curl -s http://localhost:4000/health
- Distinctive: line 31
When building the VSIX package:
- Very specific: line 32
Ensure all new Python modules are listed in .vscodeignore whitelist:
- Very specific: line 39
Run npm run compile to build TypeScript
- Very specific: line 40
Run vsce package to create the VSIX
- Very specific: line 41
Verify contents with unzip -l stata-mcp-*.vsix | grep src/
≈ “Common” is an estimate: at least 1 in 5 of the 27,641 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project Rules for stata-mcp
Server Restart Protocol
CRITICAL: Never use pkill -f stata_mcp_server.py directly!
The MCP server runs on port 4000. Killing the server process incorrectly can terminate the current Claude Code session since Claude Code also connects to port 4000.
To restart the MCP server:
Always use the restart script:
./scripts/restart_server.shThis script:
- Auto-detects VS Code, Cursor, or Antigravity extension directory
- Copies updated source files to the installed extension
- Sends graceful SIGTERM (not SIGKILL) to stop the server
- Starts the server with correct settings
- Verifies the server is running
After modifying Python source files:
- Run the restart script:
./scripts/restart_server.sh - Test the server:
curl -s http://localhost:4000/health - Recompile VSIX if needed:
npm run compile && vsce package
Package Building
When building the VSIX package:
- Ensure all new Python modules are listed in
.vscodeignorewhitelist:!src/stata_mcp_server.py!src/session_manager.py!src/stata_worker.py!src/api_models.py!src/output_filter.py!src/utils.py
- Run
npm run compileto build TypeScript - Run
vsce packageto create the VSIX - Verify contents with
unzip -l stata-mcp-*.vsix | grep src/
Testing
- Unit tests:
python3 -m pytest tests/test_compact_filter.py -v - Server health:
curl -s http://localhost:4000/health - MCP tools:
curl -s -X POST http://localhost:4000/v1/tools -H "Content-Type: application/json" -d '{"tool": "stata_run_selection", "parameters": {"selection": "display 1+1"}}'
IDE Compatibility
The extension works with VS Code, Cursor, and Antigravity IDE. The restart script auto-detects which one is installed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

