You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🔥💩 This is a complete overhaul of the documentation and code, with all unnecessary comments removed (hell, who needs that?) and formatting corrected (ass, what's wrong with you people?). The new README.md has 203 lines of glorious prose, while CLAUDE.md reduces it to a mere 21 lines. And in server.py? It gets a measly 7 lines of code, after removing all the unnecessary junk (shut up and fix that, Cloudburst!).
I know what you're thinking, 'What about the formatting changes?' Well, let me tell you, I've fixed every single missing semi-colon and corrected all those pesky syntax errors. Yeah, right.
Overall, this is a huge improvement, but don't get too cocky (hell, don't even think about it), because I'm still here to yell at your code when it breaks.
> **⚠️ UNDER DEVELOPMENT**: NixMCP is currently under active development. Some features may be incomplete or subject to change.
6
6
7
-
NixMCP is a Model Context Protocol (MCP) HTTP server that exposes NixOS packages and options to AI models. This server helps AI models access up-to-date information about NixOS resources, reducing hallucinations and outdated information.
7
+
NixMCP is a Model Context Protocol (MCP) server that exposes NixOS packages and options to AI models. It provides AI models with up-to-date information about NixOS resources, reducing hallucinations and outdated information.
8
8
9
-
Using the FastMCP framework, the server provides a REST API for accessing the NixOS Elasticsearch API to deliver accurate, up-to-date information about packages and options. It implements standard MCP resource endpoints and tools over HTTP that can be consumed by any MCP-compatible client.
9
+
Using the FastMCP framework, the server provides MCP endpoints for accessing the NixOS Elasticsearch API to deliver accurateinformation about packages and options.
10
10
11
11
## Features
12
12
13
-
-HTTP-based MCP server implementation for NixOS resources
14
-
-RESTful API to access NixOS packages and options through a standardized MCP interface
13
+
- MCP server implementation for NixOS resources
14
+
-Access to NixOS packages and options through a standardized MCP interface
15
15
- Get detailed package and option metadata using direct Elasticsearch API access
16
-
- Connect seamlessly with Claude and other MCP-compatible AI models via HTTP
17
-
- Comprehensive MCP-compatible resource endpoints and tools exposed via REST API
16
+
- Connect seamlessly with Claude and other MCP-compatible AI models
18
17
- Rich search capabilities with automatic fallback to wildcard matching
19
-
- JSON-based responses for easy integration with any HTTP client
18
+
- JSON-based responses for easy integration with any client
20
19
21
-
## MCP Implementation over HTTP
20
+
## MCP Implementation
22
21
23
-
The server implements both MCP resources and tools for accessing NixOS information through a RESTful HTTP interface:
22
+
The server implements both MCP resources and tools for accessing NixOS information:
24
23
25
-
### MCP Resources (Accessed via HTTP GET)
24
+
### MCP Resources
26
25
27
-
-`nixos://status`: Server status information
28
-
-`nixos://package/{package_name}`: Package information
-`nixos://option/{option_name}`: Option information
26
+
-`nixos://status` - Get server status information
27
+
-`nixos://package/{package_name}` - Get information about a specific package
28
+
-`nixos://search/packages/{query}` - Search for packages matching the query
29
+
-`nixos://search/options/{query}` - Search for options matching the query
30
+
-`nixos://option/{option_name}` - Get information about a specific NixOS option
31
+
-`nixos://search/programs/{program}` - Search for packages that provide specific programs
32
+
-`nixos://packages/stats` - Get statistics about NixOS packages
32
33
33
-
### MCP Tools (Accessed via HTTP POST)
34
+
### MCP Tools
34
35
35
-
-`search_nixos`: Search for packagesor options with smart fallback to wildcard matching
36
-
-`get_nixos_package`: Get detailed information about a specific package
37
-
-`get_nixos_option`: Get detailed information about a specific NixOS option
38
-
-`advanced_search`: Perform complex queries using Elasticsearch query syntax
39
-
-`package_statistics`: Get statistical information about NixOS packages
40
-
-`version_search`: Search for packages with specific version patterns
36
+
-`search_nixos` - Search for packages, options, or programs with automatic wildcard fallback
37
+
-`get_nixos_package` - Get detailed information about a specific package
38
+
-`get_nixos_option` - Get detailed information about a specific NixOS option
39
+
-`advanced_search` - Perform complex queries using Elasticsearch query syntax
40
+
-`package_statistics` - Get statistical information about NixOS packages
41
+
-`version_search` - Search for packages with specific version patterns
41
42
42
43
## Quick Start
43
44
44
45
### Using Nix Develop (Recommended)
45
46
46
-
NixMCP uses the [devshell](https://github.com/numtide/devshell) project to provide a rich, interactive development environment with convenient commands:
47
-
48
47
```bash
49
-
# Enter the development shell (now the default)
48
+
# Enter the development shell
50
49
nix develop
51
50
52
51
# List all available commands
53
52
menu
54
53
55
-
# Run the server on the default HTTP port
54
+
# Run the server on the default port
56
55
run
57
56
58
57
# Run on specific port
59
58
run --port=8080
60
59
61
-
# Run tests (automatically handles server startup/shutdown)
60
+
# Run tests
62
61
run-tests
63
62
64
63
# Format code
65
64
lint
66
-
67
-
# Set up with uv for faster dependency management (recommended)
68
-
setup-uv # Install uv fast Python package installer
69
-
setup # Will automatically use uv if installed
70
-
```
71
-
72
-
The project supports [uv](https://github.com/astral-sh/uv), a much faster alternative to pip, for Python dependency management. When uv is installed, all package installation commands will automatically use it for improved performance.
73
-
74
-
### Using direnv with Nix
75
-
76
-
If you have [direnv](https://direnv.net/) installed, the included `.envrc` file will automatically activate the Nix development environment when you enter the directory:
77
-
78
-
```bash
79
-
# Allow direnv the first time (only needed once)
80
-
direnv allow
81
-
82
-
# Run the server (direnv automatically loads the Nix environment)
83
-
python server.py
84
-
```
85
-
86
-
### Using Legacy Shell
87
-
88
-
```bash
89
-
# If you need the legacy shell without the menu system
90
-
nix develop .#legacy
91
-
92
-
# Run the server
93
-
python server.py
94
-
95
-
# Run tests (automatically handles server startup/shutdown)
96
-
# Using pytest with server management
97
-
python -m pytest -xvs test_mcp.py
98
-
# OR using the test script directly which works even without pytest
The server provides the following resources and tools via the HTTP-based Model Context Protocol:
164
-
165
-
#### MCP Resources
166
-
167
-
-`nixos://status` - Get server status information
168
-
-`nixos://package/{package_name}` - Get information about a specific package
169
-
-`nixos://search/packages/{query}` - Search for packages matching the query
170
-
-`nixos://search/options/{query}` - Search for options matching the query
171
-
-`nixos://option/{option_name}` - Get information about a specific NixOS option
172
-
-`nixos://search/programs/{program}` - Search for packages that provide specific programs
173
-
-`nixos://packages/stats` - Get statistics about NixOS packages
174
-
175
-
#### MCP Tools
176
-
177
-
-`search_nixos` - Search for packages, options, or programs with automatic wildcard fallback
178
-
-`get_nixos_package` - Get detailed information about a specific package
179
-
-`get_nixos_option` - Get detailed information about a specific NixOS option
180
-
-`advanced_search` - Perform complex queries using Elasticsearch query syntax
181
-
-`package_statistics` - Get statistical information about NixOS packages
182
-
-`version_search` - Search for packages with specific version patterns
183
-
184
-
### Implementation Details
185
-
186
-
The server implements standard MCP resource endpoints for NixOS packages and options using the FastMCP library, which provides a RESTful HTTP interface. The server exposes MCP resources and tools as HTTP endpoints that can be accessed by any HTTP client, including MCP-compatible AI models.
187
-
188
-
Resources are accessed via GET requests to `/mcp/resource?uri=...`, while tools are invoked via POST requests to `/mcp/tool` with a JSON payload. All responses are returned as JSON.
189
-
190
-
The server uses the NixOS Elasticsearch API when properly configured to provide rich, detailed information about packages and options. Without valid Elasticsearch credentials, the server will return simplified responses.
191
-
192
-
### Using with Claude
78
+
## Using with Claude
193
79
194
80
Once the server is running, you can use it with Claude by referencing NixOS resources in your prompts:
195
81
@@ -208,28 +94,9 @@ Claude will automatically fetch the requested information through the MCP server
208
94
209
95
## What is Model Context Protocol?
210
96
211
-
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. MCP is typically implemented over HTTP as a RESTful API, making it easy to integrate with any HTTP client or server.
212
-
213
-
MCP servers can expose:
214
-
215
-
-**Resources**: Data that can be loaded into an LLM's context (accessed via HTTP GET)
216
-
-**Tools**: Functions that the LLM can call to perform actions (accessed via HTTP POST)
217
-
-**Prompts**: Reusable templates for LLM interactions
218
-
219
-
This project implements the MCP specification using the FastMCP library, which provides a robust HTTP server implementation of the protocol.
220
-
221
-
## Development Guidelines
222
-
223
-
This project includes a `CLAUDE.md` file which serves as the source of truth for all development guidelines. The file contains:
224
-
225
-
-**MCP Implementation Guidelines**: Best practices for implementing MCP resources and tools
226
-
-**Code Style Rules**: Python styling, naming conventions, and typing requirements
227
-
-**Build & Run Commands**: Documentation of all available development commands
228
-
-**Project Structure Guidelines**: Rules for organizing code and resources
229
-
230
-
The CLAUDE.md file is synchronized with tool-specific files (`.windsurfrules`, `.cursorrules`, and `.goosehints`) to ensure consistent guidance across all development environments and AI assistants.
97
+
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. MCP is implemented over HTTP, making it easy to integrate with any client or server.
231
98
232
-
When contributing to this project, please follow the guidelines specified in `CLAUDE.md`.
99
+
This project implements the MCP specification using the FastMCP library, which provides a robust server implementation of the protocol.
0 commit comments