@@ -24,6 +24,7 @@ Official repository: [https://github.com/utensils/mcp-nixos](https://github.com/
2424- **Tools**: Search, info, and statistics tools
2525- **Utils**: Cross-platform helpers and cache management
2626- **Server**: FastMCP server implementation
27+ - **Pre-Cache**: Command-line option to populate cache data during setup/build
2728
2829### Implementation Guidelines
2930
@@ -50,6 +51,12 @@ Official repository: [https://github.com/utensils/mcp-nixos](https://github.com/
5051- Strict null safety with defensive programming
5152- Detailed error logging and user-friendly messages
5253- Support wildcard searches and handle empty results
54+ - Cross-platform compatibility:
55+ - Use pathlib.Path for platform-agnostic path handling
56+ - Check sys.platform before using platform-specific features
57+ - Handle file operations with appropriate platform-specific adjustments
58+ - Use os.path.join() instead of string concatenation for paths
59+ - Ensure tests work consistently across Windows, macOS, and Linux
5360
5461## API Reference
5562
@@ -96,6 +103,11 @@ Official repository: [https://github.com/utensils/mcp-nixos](https://github.com/
96103 - Integration tests: `@pytest.mark.integration`
97104 - Slow tests: `@pytest.mark.slow`
98105 - Async tests: `@pytest.mark.asyncio`
106+ - Cross-platform testing:
107+ - CI runs tests on Linux, macOS, and Windows
108+ - Linux and macOS tests use flake.nix for development environment
109+ - Windows tests use Python's venv with special dependencies (pywin32)
110+ - All tests must be platform-agnostic or include platform-specific handling
99111- Run specific test categories:
100112 - Unit tests only: `nix run .#run-tests -- --unit`
101113 - Integration tests only: `nix run .#run-tests -- --integration`
@@ -110,6 +122,17 @@ Official repository: [https://github.com/utensils/mcp-nixos](https://github.com/
110122 - All tests must check for both default OS cache paths and test-specific paths
111123 - The gitignore file excludes `mcp_nixos_test_cache/` and `*test_cache*/` patterns
112124
125+ ### Logging Tests
126+ - Prefer direct behavior verification over implementation details
127+ - When testing log level filtering:
128+ - Use `isEnabledFor()` assertions for level checks (platform-independent)
129+ - Use mock handlers with explicit level settings
130+ - Test both logger configuration and actual handler behavior
131+ - Avoid patching internal logging methods (`_log`) which vary by platform
132+ - Add clear error messages to assertions
133+ - Prevent test flakiness by avoiding sleep/timing dependencies
134+ - Use clean logger fixtures to prevent test interaction
135+
113136### Dependency Management
114137- Project uses `pyproject.toml` for dependency specification (PEP 621)
115138- Core dependencies:
@@ -125,9 +148,15 @@ Official repository: [https://github.com/utensils/mcp-nixos](https://github.com/
125148- Install: `pip install mcp-nixos`, `uv pip install mcp-nixos`, `uvx mcp-nixos`
126149- Claude Code configuration: Add to `~/.config/claude/config.json`
127150- Interactive shell: `python mcp_shell.py` (manual testing and tool exploration)
151+ - Docker deployment:
152+ - Standard use: `docker run --rm ghcr.io/utensils/mcp-nixos`
153+ - Docker image includes pre-cached data for immediate startup
154+ - Build with pre-cache: `docker build -t mcp-nixos .`
155+ - Deployed on Smithery.ai as a hosted service
128156- Development:
129157 - Environment: `nix develop`
130158 - Run server: `run`
159+ - Pre-cache data: `python -m mcp_nixos --pre-cache`
131160 - Tests: `run-tests`, `run-tests --unit`, `run-tests --integration`
132161 - Code quality: `lint`, `typecheck`, `format`
133162 - Stats: `loc`
0 commit comments