mcp-stata 1.2.2__tar.gz → 1.7.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mcp-stata might be problematic. Click here for more details.
- mcp_stata-1.7.7/.codex/skills/mcp-stata/SKILL.md +1 -0
- mcp_stata-1.7.7/.github/workflows/build-test.yml +88 -0
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/.github/workflows/version-sync.yml +1 -1
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/.gitignore +6 -1
- mcp_stata-1.7.7/CONTRIBUTING.md +217 -0
- mcp_stata-1.7.7/PKG-INFO +446 -0
- mcp_stata-1.7.7/README.md +410 -0
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/pyproject.toml +10 -4
- mcp_stata-1.7.7/pytest.ini +7 -0
- mcp_stata-1.7.7/scripts/clean_test.ps1 +79 -0
- mcp_stata-1.7.7/scripts/run_inspector.ps1 +4 -0
- mcp_stata-1.7.7/scripts/run_mcp_test_windows.ps1 +83 -0
- mcp_stata-1.7.7/scripts/test_build.sh +59 -0
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/server.json +2 -2
- mcp_stata-1.7.7/skill/SKILL.md +152 -0
- mcp_stata-1.7.7/src/mcp_stata/discovery.py +478 -0
- mcp_stata-1.7.7/src/mcp_stata/graph_detector.py +385 -0
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/src/mcp_stata/models.py +5 -1
- mcp_stata-1.7.7/src/mcp_stata/server.py +449 -0
- mcp_stata-1.7.7/src/mcp_stata/stata_client.py +2776 -0
- mcp_stata-1.7.7/src/mcp_stata/streaming_io.py +261 -0
- mcp_stata-1.7.7/src/mcp_stata/test_stata.py +54 -0
- mcp_stata-1.7.7/src/mcp_stata/ui_http.py +595 -0
- mcp_stata-1.2.2/.claude/skills/mcp-stata/SKILL.md +0 -1
- mcp_stata-1.2.2/.codex/skills/mcp-stata/SKILL.md +0 -1
- mcp_stata-1.2.2/.coverage +0 -0
- mcp_stata-1.2.2/PKG-INFO +0 -240
- mcp_stata-1.2.2/README.md +0 -207
- mcp_stata-1.2.2/pytest.ini +0 -4
- mcp_stata-1.2.2/skill/SKILL.md +0 -39
- mcp_stata-1.2.2/src/mcp_stata/discovery.py +0 -162
- mcp_stata-1.2.2/src/mcp_stata/server.py +0 -208
- mcp_stata-1.2.2/src/mcp_stata/stata_client.py +0 -536
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/.github/workflows/publish.yml +0 -0
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/LICENSE +0 -0
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/scripts/check_server_version.py +0 -0
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/scripts/sync_server_version.py +0 -0
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/src/mcp_stata/__init__.py +0 -0
- {mcp_stata-1.2.2 → mcp_stata-1.7.7}/src/mcp_stata/smcl/smcl2html.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
../../../skill/SKILL.md
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
name: Build Integration Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
workflow_dispatch: # Allow manual trigger
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build-test:
|
|
12
|
+
name: Test Build & Installation
|
|
13
|
+
# runs-on: ${{ matrix.os }}
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
# os: [ubuntu-latest, macos-latest, windows-latest]
|
|
18
|
+
os: [ubuntu-latest]
|
|
19
|
+
python-version: ["3.12"]
|
|
20
|
+
fail-fast: false
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout code
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
with:
|
|
26
|
+
fetch-depth: 0 # Fetch all history including tags
|
|
27
|
+
|
|
28
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
29
|
+
uses: actions/setup-python@v5
|
|
30
|
+
with:
|
|
31
|
+
python-version: ${{ matrix.python-version }}
|
|
32
|
+
|
|
33
|
+
- name: Install build dependencies
|
|
34
|
+
run: |
|
|
35
|
+
python -m pip install --upgrade pip
|
|
36
|
+
pip install build pytest pytest-cov packaging
|
|
37
|
+
|
|
38
|
+
- name: Install package dependencies
|
|
39
|
+
run: |
|
|
40
|
+
pip install -e .[dev]
|
|
41
|
+
timeout-minutes: 5
|
|
42
|
+
|
|
43
|
+
- name: Run all tests that don't require Stata
|
|
44
|
+
run: |
|
|
45
|
+
# Run all tests except those marked as requiring Stata
|
|
46
|
+
# This includes discovery, parsing, and build integration tests
|
|
47
|
+
pytest -v -m "not requires_stata"
|
|
48
|
+
timeout-minutes: 15
|
|
49
|
+
continue-on-error: false
|
|
50
|
+
|
|
51
|
+
- name: Build package
|
|
52
|
+
run: |
|
|
53
|
+
python -m build
|
|
54
|
+
timeout-minutes: 5
|
|
55
|
+
|
|
56
|
+
- name: Test installation in clean environment
|
|
57
|
+
shell: bash
|
|
58
|
+
run: |
|
|
59
|
+
# Create fresh venv
|
|
60
|
+
python -m venv test_venv
|
|
61
|
+
|
|
62
|
+
# Activate and install
|
|
63
|
+
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
|
64
|
+
source test_venv/Scripts/activate
|
|
65
|
+
else
|
|
66
|
+
source test_venv/bin/activate
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# Install built wheel
|
|
70
|
+
pip install dist/*.whl
|
|
71
|
+
|
|
72
|
+
# Test critical imports
|
|
73
|
+
python -c "from mcp_stata.server import main; print('[OK] Import successful')"
|
|
74
|
+
|
|
75
|
+
# Verify entry point
|
|
76
|
+
which mcp-stata || where mcp-stata
|
|
77
|
+
echo "[OK] Entry point installed"
|
|
78
|
+
timeout-minutes: 10
|
|
79
|
+
|
|
80
|
+
- name: Upload build artifacts
|
|
81
|
+
if: failure()
|
|
82
|
+
uses: actions/upload-artifact@v4
|
|
83
|
+
with:
|
|
84
|
+
name: build-artifacts-${{ matrix.os }}-py${{ matrix.python-version }}
|
|
85
|
+
path: |
|
|
86
|
+
dist/
|
|
87
|
+
*.log
|
|
88
|
+
retention-days: 7
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Contributing to mcp-stata
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to mcp-stata! This guide will help you set up your development environment, run tests, and understand the project structure.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Development Setup](#development-setup)
|
|
8
|
+
- [Building the Package](#building-the-package)
|
|
9
|
+
- [Testing](#testing)
|
|
10
|
+
- [Submitting Changes](#submitting-changes)
|
|
11
|
+
|
|
12
|
+
## Development Setup
|
|
13
|
+
|
|
14
|
+
### Prerequisites
|
|
15
|
+
|
|
16
|
+
- **Stata 17+** (required for integration tests)
|
|
17
|
+
- **Python 3.12+**
|
|
18
|
+
- **uv** (recommended) or pip
|
|
19
|
+
|
|
20
|
+
### Installation
|
|
21
|
+
|
|
22
|
+
1. Clone the repository:
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/tmonk/mcp-stata.git
|
|
25
|
+
cd mcp-stata
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. Install dependencies with uv:
|
|
29
|
+
```bash
|
|
30
|
+
# Install main dependencies
|
|
31
|
+
uv sync --no-install-project
|
|
32
|
+
|
|
33
|
+
# Install with development dependencies
|
|
34
|
+
uv sync --extra dev --no-install-project
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or with pip:
|
|
38
|
+
```bash
|
|
39
|
+
pip install -e .[dev]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
3. Set up Stata path (if auto-discovery doesn't work):
|
|
43
|
+
```bash
|
|
44
|
+
# macOS
|
|
45
|
+
export STATA_PATH="/Applications/StataNow/StataMP.app/Contents/MacOS/stata-mp"
|
|
46
|
+
|
|
47
|
+
# Windows
|
|
48
|
+
set STATA_PATH="C:\Program Files\Stata18\StataMP-64.exe"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Building the Package
|
|
52
|
+
|
|
53
|
+
### Local Build
|
|
54
|
+
|
|
55
|
+
Build the package locally to test distribution:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
python -m build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This creates wheel (`.whl`) and source distribution (`.tar.gz`) files in the `dist/` directory.
|
|
62
|
+
|
|
63
|
+
### Build Integration Tests
|
|
64
|
+
|
|
65
|
+
We have comprehensive build integration tests to catch dependency issues before release:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Run all build integration tests
|
|
69
|
+
pytest tests/test_build_integration.py -v -m slow
|
|
70
|
+
|
|
71
|
+
# Or use the convenience script
|
|
72
|
+
./scripts/test_build.sh
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
These tests:
|
|
76
|
+
- Build the package from source
|
|
77
|
+
- Install in a clean virtual environment
|
|
78
|
+
- Verify all critical imports work
|
|
79
|
+
- Check that entry points are installed correctly
|
|
80
|
+
- Catch dependency compatibility issues (like the httpx 0.28 incident)
|
|
81
|
+
|
|
82
|
+
## Testing
|
|
83
|
+
|
|
84
|
+
### Test Organization
|
|
85
|
+
|
|
86
|
+
Tests are organized with pytest markers:
|
|
87
|
+
|
|
88
|
+
- **`requires_stata`**: Tests that need Stata installed (integration, server, token efficiency tests)
|
|
89
|
+
- **`slow`**: Long-running tests (build integration tests)
|
|
90
|
+
- **`integration`**: Integration tests requiring external resources
|
|
91
|
+
|
|
92
|
+
### Running Tests
|
|
93
|
+
|
|
94
|
+
#### All Tests (requires Stata)
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pytest
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Tests Without Stata
|
|
101
|
+
|
|
102
|
+
Run all tests that don't require Stata (useful for CI or systems without Stata):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pytest -v -m "not requires_stata"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This runs:
|
|
109
|
+
- Discovery tests (finding Stata installations)
|
|
110
|
+
- SMCL/help parsing tests
|
|
111
|
+
- Build integration tests
|
|
112
|
+
|
|
113
|
+
### Test Coverage
|
|
114
|
+
|
|
115
|
+
Generate a coverage report:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
pytest --cov=mcp_stata --cov-report=html
|
|
119
|
+
open htmlcov/index.html # View the report
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Writing Tests
|
|
123
|
+
|
|
124
|
+
When adding new tests:
|
|
125
|
+
|
|
126
|
+
1. **Mark Stata-dependent tests**:
|
|
127
|
+
```python
|
|
128
|
+
import pytest
|
|
129
|
+
|
|
130
|
+
# At module level for all tests
|
|
131
|
+
pytestmark = pytest.mark.requires_stata
|
|
132
|
+
|
|
133
|
+
# Or for individual tests
|
|
134
|
+
@pytest.mark.requires_stata
|
|
135
|
+
def test_my_stata_feature():
|
|
136
|
+
pass
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
2. **Mark slow tests**:
|
|
140
|
+
```python
|
|
141
|
+
@pytest.mark.slow
|
|
142
|
+
def test_expensive_operation():
|
|
143
|
+
pass
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
3. **Platform-specific tests**:
|
|
147
|
+
```python
|
|
148
|
+
import sys
|
|
149
|
+
pytestmark = pytest.mark.skipif(sys.platform != "win32", reason="Windows only")
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Dependency Management
|
|
153
|
+
|
|
154
|
+
- Dependencies are managed in `pyproject.toml`
|
|
155
|
+
- Lock file: `uv.lock`
|
|
156
|
+
|
|
157
|
+
When adding dependencies:
|
|
158
|
+
|
|
159
|
+
1. Add to `pyproject.toml`
|
|
160
|
+
2. Run `uv lock` to update lock file
|
|
161
|
+
3. Add build integration tests if the dependency is critical
|
|
162
|
+
|
|
163
|
+
## Submitting Changes
|
|
164
|
+
|
|
165
|
+
### Pull Request Process
|
|
166
|
+
|
|
167
|
+
1. **Create a feature branch**:
|
|
168
|
+
```bash
|
|
169
|
+
git checkout -b feature/my-feature
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
2. **Make your changes** and add tests
|
|
173
|
+
|
|
174
|
+
3. **Run the full test suite**:
|
|
175
|
+
```bash
|
|
176
|
+
# With Stata
|
|
177
|
+
pytest
|
|
178
|
+
|
|
179
|
+
# Without Stata (as CI does)
|
|
180
|
+
pytest -v -m "not requires_stata"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
4. **Run build integration tests**:
|
|
184
|
+
```bash
|
|
185
|
+
./scripts/test_build.sh
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
5. **Commit with clear messages**:
|
|
189
|
+
```bash
|
|
190
|
+
git commit -m "Add feature: description of change"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
6. **Push and create a pull request**:
|
|
194
|
+
```bash
|
|
195
|
+
git push origin feature/my-feature
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### CI/CD
|
|
199
|
+
|
|
200
|
+
GitHub Actions automatically runs on all PRs:
|
|
201
|
+
|
|
202
|
+
- Runs all non-Stata tests (`pytest -v -m "not requires_stata"`)
|
|
203
|
+
- Tests on Ubuntu with Python 3.12
|
|
204
|
+
- Builds the package and tests installation
|
|
205
|
+
- Verifies critical imports and entry points
|
|
206
|
+
|
|
207
|
+
The CI workflow is defined in `.github/workflows/build-test.yml`.
|
|
208
|
+
|
|
209
|
+
## Getting Help
|
|
210
|
+
|
|
211
|
+
- **Issues**: [GitHub Issues](https://github.com/tmonk/mcp-stata/issues)
|
|
212
|
+
- **Discussions**: [GitHub Discussions](https://github.com/tmonk/mcp-stata/discussions)
|
|
213
|
+
- **Author**: [Thomas Monk](https://tdmonk.com)
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
By contributing to mcp-stata, you agree that your contributions will be licensed under the GNU Affero General Public License v3.0 or later.
|