Skip to content

Commit f51f32c

Browse files
committed
feat: Add context awareness and intelligent improvements to MCP tools
Based on Claude Code Task feedback, this commit implements major improvements: Context Awareness: - Add NixOSContext class to track state between tool calls - Tools can now reference previous search results (e.g., show(1) for first result) - versions() and compare() can use context when package name omitted - install() auto-detects appropriate installation method User Experience: - Add concise parameter to reduce output verbosity for experienced users - Deduplicate search results and group multiple versions of same package - Improve error messages with 'did you mean' suggestions - Better which() tool accuracy with query prioritization Code Quality: - Add comprehensive test suite (376 tests total) - Standardize output formatting with format_output() function - Update CLAUDE.md with code quality commands - Fix linting issues (ruff check passes) These changes make the MCP tools significantly more intelligent and user-friendly, reducing repetitive typing and providing helpful suggestions when things go wrong.
1 parent eaca02d commit f51f32c

File tree

5 files changed

+903
-144
lines changed

5 files changed

+903
-144
lines changed

CLAUDE.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,27 @@ mypy mcp_nixos/
6262

6363
## Testing Approach
6464

65-
- 367+ async tests using pytest-asyncio
65+
- 376+ async tests using pytest-asyncio
6666
- Real API calls (no mocks) for integration tests
6767
- Unit tests marked with `@pytest.mark.unit`
6868
- Integration tests marked with `@pytest.mark.integration`
6969
- Tests ensure plain text output (no XML/JSON leakage)
7070

71+
## Code Quality Commands
72+
73+
When making changes, always run:
74+
```bash
75+
# Lint and format
76+
ruff check mcp_nixos/ --fix
77+
ruff format mcp_nixos/
78+
79+
# Run tests
80+
pytest tests/
81+
82+
# Type check (note: some type issues are known and non-critical)
83+
mypy mcp_nixos/
84+
```
85+
7186
## Local Development with MCP Clients
7287

7388
Create `.mcp.json` in project root (already gitignored):

0 commit comments

Comments
 (0)