|
1 |
| -# MCP-NixOS: v0.3.1 Release Notes |
| 1 | +# MCP-NixOS: v0.4.0 Release Notes |
2 | 2 |
|
3 | 3 | ## Overview
|
4 | 4 |
|
5 |
| -MCP-NixOS v0.3.1 is a patch release that fixes critical issues with the Home Manager and NixOS tools when used through Claude's Model Context Protocol (MCP) interface. |
| 5 | +MCP-NixOS v0.4.0 introduces significant architectural improvements, focusing on resolving critical issues with channel switching and context management. This release also includes a completely redesigned prompt system following Model Context Protocol (MCP) best practices for dynamic discovery. |
6 | 6 |
|
7 |
| -## Changes in v0.3.1 |
| 7 | +## Changes in v0.4.0 |
8 | 8 |
|
9 |
| -### 🐛 Bug Fixes |
| 9 | +### 🚀 Major Enhancements |
10 | 10 |
|
11 |
| -- **Fixed Home Manager context handling in MCP interface**: Resolved issues where Home Manager tools would fail with `'str' object has no attribute 'request_context'` error when accessed through Claude's MCP interface |
12 |
| -- **Improved context type validation**: Added proper type checking with `isinstance(ctx, str)` to handle both server request contexts and string contexts from MCP |
13 |
| -- **Enhanced error handling in tool registration**: Modified MCP tool registration to dynamically import the proper context when string contexts are passed |
14 |
| -- **Restored dependency lock file**: Added `uv.lock` to ensure consistent dependencies across all environments, fixing missing `psutil` dependency issues |
| 11 | +- **Fixed Channel Switching Functionality**: Resolved issues with channel switching between stable and unstable NixOS versions, ensuring accurate data retrieval for different channels |
| 12 | +- **Improved Context Management**: Completely refactored context management to eliminate type confusion and provide consistent handling across all tools |
| 13 | +- **Dynamic Discovery Tools**: Implemented discovery tools following MCP best practices, enabling AI to explore available capabilities dynamically |
| 14 | +- **Redesigned MCP Prompt**: Replaced the extensive documentation with a concise, principle-based prompt that emphasizes proper tool usage patterns |
15 | 15 |
|
16 |
| -## Technical Details |
| 16 | +### 🛠️ Implementation Details |
| 17 | + |
| 18 | +- **Channel Validation**: Added proper validation to ensure channel switching actually retrieves distinct data |
| 19 | +- **Context Type Consistency**: Standardized context handling across NixOS, Home Manager, and Darwin tools |
| 20 | +- **Enhanced Parameter Documentation**: Improved documentation for the `ctx` parameter across all tools |
| 21 | +- **Comprehensive Testing**: Added new tests for channel switching and context handling |
17 | 22 |
|
18 |
| -The fundamental issue occurred in the context handling within the MCP-NixOS integration: |
| 23 | +## Technical Details |
19 | 24 |
|
20 |
| -1. **Inconsistent Context Types**: The Home Manager tools were originally designed to handle `request_context` objects from the internal server, but when called through Claude's MCP interface, they received a string context instead. |
| 25 | +The release addresses two main architectural issues: |
21 | 26 |
|
22 |
| -2. **Type Mismatch Error**: This led to the error `'str' object has no attribute 'request_context'` when the tools tried to access `ctx.request_context` on a string. |
| 27 | +1. **Channel Switching Failure**: Previously, switching between channels (like "unstable" and "24.11") didn't properly change the Elasticsearch index, resulting in identical data regardless of channel selection. This has been fixed with proper verification of channel differences. |
23 | 28 |
|
24 |
| -3. **Two-Layer Context Problem**: The issue existed in both: |
25 |
| - - The direct tool functions |
26 |
| - - The MCP tool registration wrappers |
| 29 | +2. **Context Management Chaos**: The codebase had inconsistent handling of the `ctx` parameter across different tools, sometimes treating it as a request context object and other times as a string identifier. This has been standardized with proper type checking and appropriate handling for all context types. |
27 | 30 |
|
28 |
| -The fix required implementing proper type checking in both the tool functions themselves and in their MCP registration wrappers, along with appropriate handling for string contexts by dynamically importing the proper context object. |
| 31 | +3. **Dynamic Discovery**: Following MCP best practices, tools now support dynamic discovery rather than requiring hardcoded documentation in the prompt, making the system more maintainable and scalable. |
29 | 32 |
|
30 | 33 | ## Installation
|
31 | 34 |
|
32 | 35 | ```bash
|
33 | 36 | # Install with pip
|
34 |
| -pip install mcp-nixos==0.3.1 |
| 37 | +pip install mcp-nixos==0.4.0 |
35 | 38 |
|
36 | 39 | # Install with uv
|
37 |
| -uv pip install mcp-nixos==0.3.1 |
| 40 | +uv pip install mcp-nixos==0.4.0 |
38 | 41 |
|
39 | 42 | # Install with uvx
|
40 |
| -uvx mcp-nixos==0.3.1 |
| 43 | +uvx mcp-nixos==0.4.0 |
41 | 44 | ```
|
42 | 45 |
|
43 | 46 | ## Usage
|
|
0 commit comments