agentleFS
hanlulonghanlulong/stata-mcp/CLAUDE.md

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
  1. Distinctive:

    Always use the restart script:

    line 11
  2. Very specific:

    Run the restart script: ./scripts/restart_server.sh

    line 25
  3. Very specific:

    Test the server: curl -s http://localhost:4000/health

    line 26
  4. Distinctive:

    When building the VSIX package:

    line 31
  5. Very specific:

    Ensure all new Python modules are listed in .vscodeignore whitelist:

    line 32
  6. Very specific:

    Run npm run compile to build TypeScript

    line 39
  7. Very specific:

    Run vsce package to create the VSIX

    line 40
  8. Very specific:

    Verify contents with unzip -l stata-mcp-*.vsix | grep src/

    line 41

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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.sh

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 is running

After modifying Python source files:

  1. Run the restart script: ./scripts/restart_server.sh
  2. Test the server: curl -s http://localhost:4000/health
  3. Recompile VSIX if needed: npm run compile && vsce package

Package Building

When building the VSIX package:

  1. Ensure all new Python modules are listed in .vscodeignore whitelist:
    • !src/stata_mcp_server.py
    • !src/session_manager.py
    • !src/stata_worker.py
    • !src/api_models.py
    • !src/output_filter.py
    • !src/utils.py
  2. Run npm run compile to build TypeScript
  3. Run vsce package to create the VSIX
  4. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.