|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- `server/` – MCP server implementation. Main entry: `server/zenml_server.py`; treat `server/lib/` as vendored support code (avoid edits unless necessary). |
| 5 | +- `scripts/` – Developer utilities: `format.sh` (ruff) and `test_mcp_server.py` (smoke test). |
| 6 | +- `assets/` – Images and static assets. |
| 7 | +- Root files – `README.md`, `manifest.json`, `mcp-zenml.dxt` (DXT package), CI in `.github/workflows/`. |
| 8 | + |
| 9 | +## Build, Test, and Development Commands |
| 10 | +- Run server locally: `uv run server/zenml_server.py` |
| 11 | +- Smoke test (local): `uv run scripts/test_mcp_server.py server/zenml_server.py` |
| 12 | +- Format & lint: `bash scripts/format.sh` (ruff check + import sort + format) |
| 13 | +- CI mirrors the smoke test via GitHub Actions and requires Python 3.12. |
| 14 | + |
| 15 | +## Coding Style & Naming Conventions |
| 16 | +- Language: Python 3.12+. Indentation: 4 spaces. |
| 17 | +- Use snake_case for functions/variables, PascalCase for classes, UPPER_SNAKE_CASE for constants. |
| 18 | +- Keep imports tidy; `scripts/format.sh` enforces ruff rules and import sorting. |
| 19 | +- Logging: prefer `logging` to stderr; avoid printing from MCP tool functions except returning strings/JSON. Keep logs minimal to avoid MCP JSON protocol interference. |
| 20 | + |
| 21 | +## Testing Guidelines |
| 22 | +- Primary test: `scripts/test_mcp_server.py` exercises MCP connection, initialization, and basic tools. |
| 23 | +- Run locally with `uv run ...`; CI runs on PRs and a scheduled workflow. |
| 24 | +- If adding tests, follow descriptive names (e.g., `test_<area>_behavior.py`) and place alongside existing script tests under `scripts/` or add a `tests/` folder. Keep tests fast and network-light; mock ZenML calls when feasible. |
| 25 | + |
| 26 | +## Commit & Pull Request Guidelines |
| 27 | +- Commits: concise, imperative subject (e.g., "Update README", "Add smoke test"), group related changes. |
| 28 | +- PRs: include a clear description, link related issues, and add logs/screenshots for failures or tool output when relevant. Ensure CI passes (smoke test and formatting). |
| 29 | + |
| 30 | +## Security & Configuration Tips |
| 31 | +- Required env vars to run tools: `ZENML_STORE_URL`, `ZENML_STORE_API_KEY`. |
| 32 | +- Prefer `uv` for isolated runs. Do not log secrets; scrub values in examples and CI output. |
| 33 | +- Avoid modifying `server/lib/` unless you understand downstream effects. |
| 34 | + |
0 commit comments