Read-only MCP server for Linux system diagnostics.
uv sync # Install dependencies
uv run pytest # Run tests
uv run ruff check src tests # Lint
uv run pyright # Type check
make verify # All checks (required before commit)src/linux_mcp_server/tools/- MCP tools (logs, network, processes, services, storage, system_info)src/linux_mcp_server/commands.py- Command definitionssrc/linux_mcp_server/formatters.py/parsers.py- Output formatting and parsingtests/- Mirrors src structure
Code: PEP 8, type hints required, async/await for I/O, 120 char max, prefer Pydantic over dataclasses
Testing:
- Run
make verifybefore committing - Use parameterized tests and fixtures (shared fixtures go in
conftest.py) - Use
autospec=Truewhen patching;spec=<object>with MagicMock - 100% patch coverage for new code
Security (Critical):
- All tools must be read-only with
readOnlyHint=True - Validate all input, use allowlists for file paths, sanitize shell params
- Create tool in
src/linux_mcp_server/tools/using@mcp.tool(),@log_tool_call,@disallow_local_execution_in_containersdecorators - Register command in
commands.py - Write tests in
tests/tools/
See src/linux_mcp_server/tools/processes.py for reference.
Use Conventional Commits: <type>(<scope>): <subject>
Types: feat, fix, docs, test, refactor, perf, chore
PRs must be small and focused - one logical change per PR. Split large changes into incremental PRs.
Full details: docs/contributing.md | Architecture: docs/architecture.md | API: docs/api/