arch-ops-server 0.1.3__tar.gz → 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,250 @@
1
+ Metadata-Version: 2.3
2
+ Name: arch-ops-server
3
+ Version: 3.0.0
4
+ Summary: MCP server bridging AI assistants with Arch Linux ecosystem (Wiki, AUR, official repos)
5
+ Keywords: arch-linux,mcp,model-context-protocol,aur,pacman,wiki,ai-assistant
6
+ Author: Nihal
7
+ Author-email: Nihal <2tv8xupqg@mozmail.com>
8
+ License: GPL-3.0-only OR MIT
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: System Administrators
12
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: System :: Archiving :: Packaging
19
+ Classifier: Topic :: System :: Systems Administration
20
+ Requires-Dist: mcp>=1.0.0
21
+ Requires-Dist: httpx>=0.27.0
22
+ Requires-Dist: beautifulsoup4>=4.12.0
23
+ Requires-Dist: lxml>=5.0.0
24
+ Requires-Dist: markdownify>=0.12.0
25
+ Requires-Dist: pytest>=8.0.0 ; extra == 'dev'
26
+ Requires-Dist: pytest-asyncio>=0.23.0 ; extra == 'dev'
27
+ Requires-Dist: pytest-cov>=4.1.0 ; extra == 'dev'
28
+ Requires-Dist: pytest-mock>=3.12.0 ; extra == 'dev'
29
+ Requires-Dist: httpx>=0.27.0 ; extra == 'dev'
30
+ Requires-Python: >=3.11
31
+ Provides-Extra: dev
32
+ Description-Content-Type: text/markdown
33
+
34
+ # Arch Linux MCP Server
35
+
36
+ <a href="https://glama.ai/mcp/servers/@nihalxkumar/arch-mcp">
37
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/@nihalxkumar/arch-mcp/badge" />
38
+ </a>
39
+
40
+ **Disclaimer:** Unofficial community project, not affiliated with Arch Linux.
41
+
42
+ A [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server that bridges AI assistants with the Arch Linux ecosystem. Enables intelligent, safe, and efficient access to the Arch Wiki, AUR, and official repositories for AI-assisted Arch Linux usage on Arch and non-Arch systems.
43
+
44
+ Leverage AI to get output for digestible, structured results that are ready for follow up questions and actions.
45
+
46
+ 📖 [Complete Documentation with Comfy Guides](https://nxk.mintlify.app/arch-mcp)
47
+
48
+ ## Sneak Peak into what's available
49
+
50
+ <details open>
51
+ <summary>Claude Desktop (no terminal)</summary>
52
+
53
+ ![Claude Desktop Demo](assets/claudedesktop_signalcli.gif)
54
+
55
+ </details>
56
+
57
+ <details>
58
+ <summary>VS Code (with terminal)</summary>
59
+
60
+ ![VS Code Demo](assets/vscode_notesnook.gif)
61
+
62
+ </details>
63
+
64
+ ### Resources (URI-based Access)
65
+
66
+ Direct access to Arch ecosystem data via custom URI schemes:
67
+
68
+ #### Documentation & Search
69
+ | URI Scheme | Example | Returns |
70
+ |------------|---------|---------|
71
+ | `archwiki://` | `archwiki://Installation_guide` | Markdown-formatted Wiki page |
72
+
73
+ #### Package Information
74
+ | URI Scheme | Example | Returns |
75
+ |------------|---------|---------|
76
+ | `archrepo://` | `archrepo://vim` | Official repository package details |
77
+ | `aur://*/info` | `aur://yay/info` | AUR package metadata (votes, maintainer, dates) |
78
+ | `aur://*/pkgbuild` | `aur://yay/pkgbuild` | Raw PKGBUILD with safety analysis |
79
+
80
+ #### System Packages (Arch only)
81
+ | URI Scheme | Example | Returns |
82
+ |------------|---------|---------|
83
+ | `pacman://installed` | `pacman://installed` | System installed packages list |
84
+ | `pacman://orphans` | `pacman://orphans` | Orphaned packages |
85
+ | `pacman://explicit` | `pacman://explicit` | Explicitly installed packages |
86
+ | `pacman://groups` | `pacman://groups` | All package groups |
87
+ | `pacman://group/*` | `pacman://group/base-devel` | Packages in specific group |
88
+ | `pacman://database/freshness` | `pacman://database/freshness` | Package database sync status |
89
+
90
+ #### System Monitoring & Logs
91
+ | URI Scheme | Example | Returns |
92
+ |------------|---------|---------|
93
+ | `system://info` | `system://info` | System information (kernel, memory, uptime) |
94
+ | `system://disk` | `system://disk` | Disk space usage statistics |
95
+ | `system://services/failed` | `system://services/failed` | Failed systemd services |
96
+ | `system://logs/boot` | `system://logs/boot` | Recent boot logs |
97
+ | `pacman://log/recent` | `pacman://log/recent` | Recent package transactions |
98
+ | `pacman://log/failed` | `pacman://log/failed` | Failed package transactions |
99
+
100
+ #### News & Updates
101
+ | URI Scheme | Example | Returns |
102
+ |------------|---------|---------|
103
+ | `archnews://latest` | `archnews://latest` | Latest Arch Linux news |
104
+ | `archnews://critical` | `archnews://critical` | Critical news requiring manual intervention |
105
+ | `archnews://since-update` | `archnews://since-update` | News since last system update |
106
+
107
+ #### Configuration
108
+ | URI Scheme | Example | Returns |
109
+ |------------|---------|---------|
110
+ | `config://pacman` | `config://pacman` | Parsed pacman.conf configuration |
111
+ | `config://makepkg` | `config://makepkg` | Parsed makepkg.conf configuration |
112
+ | `mirrors://active` | `mirrors://active` | Currently configured mirrors |
113
+ | `mirrors://health` | `mirrors://health` | Mirror configuration health status |
114
+
115
+ ### Tools (Executable Functions)
116
+
117
+ #### Package Search & Information
118
+ | Tool | Description | Platform |
119
+ |------|-------------|----------|
120
+ | `search_archwiki` | Query Arch Wiki with ranked results | Any |
121
+ | `search_aur` | Search AUR (relevance/votes/popularity/modified) | Any |
122
+ | `get_official_package_info` | Get official package details (hybrid local/remote) | Any |
123
+
124
+ #### Package Lifecycle Management
125
+ | Tool | Description | Platform |
126
+ |------|-------------|----------|
127
+ | `check_updates_dry_run` | Check for available updates | Arch only |
128
+ | `install_package_secure` | Install with security checks (blocks malicious packages) | Arch only |
129
+ | `remove_package` | Remove single package (with deps, forced) | Arch only |
130
+ | `remove_packages_batch` | Remove multiple packages efficiently | Arch only |
131
+
132
+ #### Package Analysis & Maintenance
133
+ | Tool | Description | Platform |
134
+ |------|-------------|----------|
135
+ | `list_orphan_packages` | Find orphaned packages | Arch only |
136
+ | `remove_orphans` | Clean orphans (dry-run, exclusions) | Arch only |
137
+ | `verify_package_integrity` | Check file integrity (modified/missing files) | Arch only |
138
+ | `list_explicit_packages` | List user-installed packages | Arch only |
139
+ | `mark_as_explicit` | Prevent package from being orphaned | Arch only |
140
+ | `mark_as_dependency` | Allow package to be orphaned | Arch only |
141
+
142
+ #### Package Organization
143
+ | Tool | Description | Platform |
144
+ |------|-------------|----------|
145
+ | `find_package_owner` | Find which package owns a file | Arch only |
146
+ | `list_package_files` | List files in package (regex filtering) | Arch only |
147
+ | `search_package_files` | Search files across packages | Arch only |
148
+ | `list_package_groups` | List all groups (base, base-devel, etc.) | Arch only |
149
+ | `list_group_packages` | Show packages in specific group | Arch only |
150
+
151
+ #### System Monitoring & Diagnostics
152
+ | Tool | Description | Platform |
153
+ |------|-------------|----------|
154
+ | `get_system_info` | System info (kernel, memory, uptime) | Any |
155
+ | `check_disk_space` | Disk usage with warnings | Any |
156
+ | `get_pacman_cache_stats` | Package cache size and age | Arch only |
157
+ | `check_failed_services` | Find failed systemd services | systemd |
158
+ | `get_boot_logs` | Retrieve journalctl boot logs | systemd |
159
+ | `check_database_freshness` | Check package database sync status | Arch only |
160
+
161
+ #### Transaction History & Logs
162
+ | Tool | Description | Platform |
163
+ |------|-------------|----------|
164
+ | `get_transaction_history` | Recent package transactions (install/upgrade/remove) | Arch only |
165
+ | `find_when_installed` | Package installation history | Arch only |
166
+ | `find_failed_transactions` | Failed package operations | Arch only |
167
+ | `get_database_sync_history` | Database sync events | Arch only |
168
+
169
+ #### News & Safety Checks
170
+ | Tool | Description | Platform |
171
+ |------|-------------|----------|
172
+ | `get_latest_news` | Fetch Arch Linux news from RSS | Any |
173
+ | `check_critical_news` | Find critical news (manual intervention required) | Any |
174
+ | `get_news_since_last_update` | News posted since last system update | Arch only |
175
+
176
+ #### Mirror Management
177
+ | Tool | Description | Platform |
178
+ |------|-------------|----------|
179
+ | `list_active_mirrors` | Show configured mirrors | Arch only |
180
+ | `test_mirror_speed` | Test mirror latency | Arch only |
181
+ | `suggest_fastest_mirrors` | Recommend optimal mirrors by location | Any |
182
+ | `check_mirrorlist_health` | Verify mirror configuration | Arch only |
183
+
184
+ #### Configuration Management
185
+ | Tool | Description | Platform |
186
+ |------|-------------|----------|
187
+ | `analyze_pacman_conf` | Parse pacman.conf settings | Arch only |
188
+ | `analyze_makepkg_conf` | Parse makepkg.conf settings | Arch only |
189
+ | `check_ignored_packages` | List ignored packages (warns on critical) | Arch only |
190
+ | `get_parallel_downloads_setting` | Get parallel download config | Arch only |
191
+
192
+ #### Security Analysis
193
+ | Tool | Description | Platform |
194
+ |------|-------------|----------|
195
+ | `analyze_pkgbuild_safety` | Comprehensive PKGBUILD analysis (50+ red flags) | Any |
196
+ | `analyze_package_metadata_risk` | Package trust scoring (votes, maintainer, age) | Any |
197
+
198
+ ### Prompts (Guided Workflows)
199
+
200
+ | Prompt | Purpose | Workflow |
201
+ |--------|---------|----------|
202
+ | `troubleshoot_issue` | Diagnose system errors | Extract keywords → Search Wiki → Context-aware suggestions |
203
+ | `audit_aur_package` | Pre-installation safety audit | Fetch metadata → Analyze PKGBUILD → Security recommendations |
204
+ | `analyze_dependencies` | Installation planning | Check repos → Map dependencies → Suggest install order |
205
+ | `safe_system_update` | Safe update workflow | Check critical news → Verify disk space → List updates → Check services → Recommendations |
206
+
207
+ ---
208
+
209
+ ## Installation
210
+
211
+ ### Prerequisites
212
+ - Python 3.11+
213
+ - [uv](https://github.com/astral-sh/uv) (recommended) or pip
214
+
215
+ ### Quick Install with `uvx`
216
+
217
+ ```bash
218
+ uvx arch-ops-server
219
+ ```
220
+ ---
221
+
222
+ ## Configuration
223
+
224
+ Claude / Cursor / Any MCP client that supports STDIO transport
225
+
226
+ ```json
227
+ {
228
+ "mcpServers": {
229
+ "arch-ops": {
230
+ "command": "uvx",
231
+ "args": ["arch-ops-server"]
232
+ }
233
+ }
234
+ }
235
+ ```
236
+
237
+ ## Contributing
238
+
239
+ Contributions are greatly appreciated. Please feel free to submit a pull request or open an issue and help make things better for everyone.
240
+
241
+ [Contributing Guide](https://nxk.mintlify.app/arch-mcp/contributing)
242
+
243
+ ## License
244
+
245
+ This project is dual-licensed under your choice of:
246
+
247
+ - **[GPL-3.0-only](https://www.gnu.org/licenses/gpl-3.0.en.html)** - See [LICENSE-GPL](LICENSE-GPL)
248
+ - **[MIT License](https://opensource.org/licenses/MIT)** - See [LICENSE-MIT](LICENSE-MIT)
249
+
250
+ You may use this software under the terms of either license. See [LICENSE](LICENSE) for more details.
@@ -0,0 +1,217 @@
1
+ # Arch Linux MCP Server
2
+
3
+ <a href="https://glama.ai/mcp/servers/@nihalxkumar/arch-mcp">
4
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/@nihalxkumar/arch-mcp/badge" />
5
+ </a>
6
+
7
+ **Disclaimer:** Unofficial community project, not affiliated with Arch Linux.
8
+
9
+ A [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server that bridges AI assistants with the Arch Linux ecosystem. Enables intelligent, safe, and efficient access to the Arch Wiki, AUR, and official repositories for AI-assisted Arch Linux usage on Arch and non-Arch systems.
10
+
11
+ Leverage AI to get output for digestible, structured results that are ready for follow up questions and actions.
12
+
13
+ 📖 [Complete Documentation with Comfy Guides](https://nxk.mintlify.app/arch-mcp)
14
+
15
+ ## Sneak Peak into what's available
16
+
17
+ <details open>
18
+ <summary>Claude Desktop (no terminal)</summary>
19
+
20
+ ![Claude Desktop Demo](assets/claudedesktop_signalcli.gif)
21
+
22
+ </details>
23
+
24
+ <details>
25
+ <summary>VS Code (with terminal)</summary>
26
+
27
+ ![VS Code Demo](assets/vscode_notesnook.gif)
28
+
29
+ </details>
30
+
31
+ ### Resources (URI-based Access)
32
+
33
+ Direct access to Arch ecosystem data via custom URI schemes:
34
+
35
+ #### Documentation & Search
36
+ | URI Scheme | Example | Returns |
37
+ |------------|---------|---------|
38
+ | `archwiki://` | `archwiki://Installation_guide` | Markdown-formatted Wiki page |
39
+
40
+ #### Package Information
41
+ | URI Scheme | Example | Returns |
42
+ |------------|---------|---------|
43
+ | `archrepo://` | `archrepo://vim` | Official repository package details |
44
+ | `aur://*/info` | `aur://yay/info` | AUR package metadata (votes, maintainer, dates) |
45
+ | `aur://*/pkgbuild` | `aur://yay/pkgbuild` | Raw PKGBUILD with safety analysis |
46
+
47
+ #### System Packages (Arch only)
48
+ | URI Scheme | Example | Returns |
49
+ |------------|---------|---------|
50
+ | `pacman://installed` | `pacman://installed` | System installed packages list |
51
+ | `pacman://orphans` | `pacman://orphans` | Orphaned packages |
52
+ | `pacman://explicit` | `pacman://explicit` | Explicitly installed packages |
53
+ | `pacman://groups` | `pacman://groups` | All package groups |
54
+ | `pacman://group/*` | `pacman://group/base-devel` | Packages in specific group |
55
+ | `pacman://database/freshness` | `pacman://database/freshness` | Package database sync status |
56
+
57
+ #### System Monitoring & Logs
58
+ | URI Scheme | Example | Returns |
59
+ |------------|---------|---------|
60
+ | `system://info` | `system://info` | System information (kernel, memory, uptime) |
61
+ | `system://disk` | `system://disk` | Disk space usage statistics |
62
+ | `system://services/failed` | `system://services/failed` | Failed systemd services |
63
+ | `system://logs/boot` | `system://logs/boot` | Recent boot logs |
64
+ | `pacman://log/recent` | `pacman://log/recent` | Recent package transactions |
65
+ | `pacman://log/failed` | `pacman://log/failed` | Failed package transactions |
66
+
67
+ #### News & Updates
68
+ | URI Scheme | Example | Returns |
69
+ |------------|---------|---------|
70
+ | `archnews://latest` | `archnews://latest` | Latest Arch Linux news |
71
+ | `archnews://critical` | `archnews://critical` | Critical news requiring manual intervention |
72
+ | `archnews://since-update` | `archnews://since-update` | News since last system update |
73
+
74
+ #### Configuration
75
+ | URI Scheme | Example | Returns |
76
+ |------------|---------|---------|
77
+ | `config://pacman` | `config://pacman` | Parsed pacman.conf configuration |
78
+ | `config://makepkg` | `config://makepkg` | Parsed makepkg.conf configuration |
79
+ | `mirrors://active` | `mirrors://active` | Currently configured mirrors |
80
+ | `mirrors://health` | `mirrors://health` | Mirror configuration health status |
81
+
82
+ ### Tools (Executable Functions)
83
+
84
+ #### Package Search & Information
85
+ | Tool | Description | Platform |
86
+ |------|-------------|----------|
87
+ | `search_archwiki` | Query Arch Wiki with ranked results | Any |
88
+ | `search_aur` | Search AUR (relevance/votes/popularity/modified) | Any |
89
+ | `get_official_package_info` | Get official package details (hybrid local/remote) | Any |
90
+
91
+ #### Package Lifecycle Management
92
+ | Tool | Description | Platform |
93
+ |------|-------------|----------|
94
+ | `check_updates_dry_run` | Check for available updates | Arch only |
95
+ | `install_package_secure` | Install with security checks (blocks malicious packages) | Arch only |
96
+ | `remove_package` | Remove single package (with deps, forced) | Arch only |
97
+ | `remove_packages_batch` | Remove multiple packages efficiently | Arch only |
98
+
99
+ #### Package Analysis & Maintenance
100
+ | Tool | Description | Platform |
101
+ |------|-------------|----------|
102
+ | `list_orphan_packages` | Find orphaned packages | Arch only |
103
+ | `remove_orphans` | Clean orphans (dry-run, exclusions) | Arch only |
104
+ | `verify_package_integrity` | Check file integrity (modified/missing files) | Arch only |
105
+ | `list_explicit_packages` | List user-installed packages | Arch only |
106
+ | `mark_as_explicit` | Prevent package from being orphaned | Arch only |
107
+ | `mark_as_dependency` | Allow package to be orphaned | Arch only |
108
+
109
+ #### Package Organization
110
+ | Tool | Description | Platform |
111
+ |------|-------------|----------|
112
+ | `find_package_owner` | Find which package owns a file | Arch only |
113
+ | `list_package_files` | List files in package (regex filtering) | Arch only |
114
+ | `search_package_files` | Search files across packages | Arch only |
115
+ | `list_package_groups` | List all groups (base, base-devel, etc.) | Arch only |
116
+ | `list_group_packages` | Show packages in specific group | Arch only |
117
+
118
+ #### System Monitoring & Diagnostics
119
+ | Tool | Description | Platform |
120
+ |------|-------------|----------|
121
+ | `get_system_info` | System info (kernel, memory, uptime) | Any |
122
+ | `check_disk_space` | Disk usage with warnings | Any |
123
+ | `get_pacman_cache_stats` | Package cache size and age | Arch only |
124
+ | `check_failed_services` | Find failed systemd services | systemd |
125
+ | `get_boot_logs` | Retrieve journalctl boot logs | systemd |
126
+ | `check_database_freshness` | Check package database sync status | Arch only |
127
+
128
+ #### Transaction History & Logs
129
+ | Tool | Description | Platform |
130
+ |------|-------------|----------|
131
+ | `get_transaction_history` | Recent package transactions (install/upgrade/remove) | Arch only |
132
+ | `find_when_installed` | Package installation history | Arch only |
133
+ | `find_failed_transactions` | Failed package operations | Arch only |
134
+ | `get_database_sync_history` | Database sync events | Arch only |
135
+
136
+ #### News & Safety Checks
137
+ | Tool | Description | Platform |
138
+ |------|-------------|----------|
139
+ | `get_latest_news` | Fetch Arch Linux news from RSS | Any |
140
+ | `check_critical_news` | Find critical news (manual intervention required) | Any |
141
+ | `get_news_since_last_update` | News posted since last system update | Arch only |
142
+
143
+ #### Mirror Management
144
+ | Tool | Description | Platform |
145
+ |------|-------------|----------|
146
+ | `list_active_mirrors` | Show configured mirrors | Arch only |
147
+ | `test_mirror_speed` | Test mirror latency | Arch only |
148
+ | `suggest_fastest_mirrors` | Recommend optimal mirrors by location | Any |
149
+ | `check_mirrorlist_health` | Verify mirror configuration | Arch only |
150
+
151
+ #### Configuration Management
152
+ | Tool | Description | Platform |
153
+ |------|-------------|----------|
154
+ | `analyze_pacman_conf` | Parse pacman.conf settings | Arch only |
155
+ | `analyze_makepkg_conf` | Parse makepkg.conf settings | Arch only |
156
+ | `check_ignored_packages` | List ignored packages (warns on critical) | Arch only |
157
+ | `get_parallel_downloads_setting` | Get parallel download config | Arch only |
158
+
159
+ #### Security Analysis
160
+ | Tool | Description | Platform |
161
+ |------|-------------|----------|
162
+ | `analyze_pkgbuild_safety` | Comprehensive PKGBUILD analysis (50+ red flags) | Any |
163
+ | `analyze_package_metadata_risk` | Package trust scoring (votes, maintainer, age) | Any |
164
+
165
+ ### Prompts (Guided Workflows)
166
+
167
+ | Prompt | Purpose | Workflow |
168
+ |--------|---------|----------|
169
+ | `troubleshoot_issue` | Diagnose system errors | Extract keywords → Search Wiki → Context-aware suggestions |
170
+ | `audit_aur_package` | Pre-installation safety audit | Fetch metadata → Analyze PKGBUILD → Security recommendations |
171
+ | `analyze_dependencies` | Installation planning | Check repos → Map dependencies → Suggest install order |
172
+ | `safe_system_update` | Safe update workflow | Check critical news → Verify disk space → List updates → Check services → Recommendations |
173
+
174
+ ---
175
+
176
+ ## Installation
177
+
178
+ ### Prerequisites
179
+ - Python 3.11+
180
+ - [uv](https://github.com/astral-sh/uv) (recommended) or pip
181
+
182
+ ### Quick Install with `uvx`
183
+
184
+ ```bash
185
+ uvx arch-ops-server
186
+ ```
187
+ ---
188
+
189
+ ## Configuration
190
+
191
+ Claude / Cursor / Any MCP client that supports STDIO transport
192
+
193
+ ```json
194
+ {
195
+ "mcpServers": {
196
+ "arch-ops": {
197
+ "command": "uvx",
198
+ "args": ["arch-ops-server"]
199
+ }
200
+ }
201
+ }
202
+ ```
203
+
204
+ ## Contributing
205
+
206
+ Contributions are greatly appreciated. Please feel free to submit a pull request or open an issue and help make things better for everyone.
207
+
208
+ [Contributing Guide](https://nxk.mintlify.app/arch-mcp/contributing)
209
+
210
+ ## License
211
+
212
+ This project is dual-licensed under your choice of:
213
+
214
+ - **[GPL-3.0-only](https://www.gnu.org/licenses/gpl-3.0.en.html)** - See [LICENSE-GPL](LICENSE-GPL)
215
+ - **[MIT License](https://opensource.org/licenses/MIT)** - See [LICENSE-MIT](LICENSE-MIT)
216
+
217
+ You may use this software under the terms of either license. See [LICENSE](LICENSE) for more details.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arch-ops-server"
3
- version = "0.1.3"
3
+ version = "3.0.0"
4
4
  description = "MCP server bridging AI assistants with Arch Linux ecosystem (Wiki, AUR, official repos)"
5
5
  readme = {file = "README.md", content-type = "text/markdown"}
6
6
  license = { text = "GPL-3.0-only OR MIT" }
@@ -33,6 +33,44 @@ dependencies = [
33
33
  [project.scripts]
34
34
  arch-ops-server = "arch_ops_server:main_sync"
35
35
 
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=8.0.0",
39
+ "pytest-asyncio>=0.23.0",
40
+ "pytest-cov>=4.1.0",
41
+ "pytest-mock>=3.12.0",
42
+ "httpx>=0.27.0", # For testing async HTTP
43
+ ]
44
+
45
+ [tool.pytest.ini_options]
46
+ testpaths = ["tests"]
47
+ python_files = ["test_*.py"]
48
+ python_classes = ["Test*"]
49
+ python_functions = ["test_*"]
50
+ asyncio_mode = "auto"
51
+ asyncio_default_fixture_loop_scope = "function"
52
+ addopts = [
53
+ "-v",
54
+ "--strict-markers",
55
+ "--cov=arch_ops_server",
56
+ "--cov-report=term-missing",
57
+ "--cov-report=html",
58
+ ]
59
+
60
+ [tool.coverage.run]
61
+ source = ["arch_ops_server"]
62
+ omit = ["*/tests/*", "*/__pycache__/*"]
63
+
64
+ [tool.coverage.report]
65
+ exclude_lines = [
66
+ "pragma: no cover",
67
+ "def __repr__",
68
+ "raise AssertionError",
69
+ "raise NotImplementedError",
70
+ "if __name__ == .__main__.:",
71
+ "if TYPE_CHECKING:",
72
+ ]
73
+
36
74
  [build-system]
37
75
  requires = ["uv_build>=0.9.4,<0.10.0"]
38
76
  build-backend = "uv_build"
@@ -0,0 +1,166 @@
1
+ # SPDX-License-Identifier: GPL-3.0-only OR MIT
2
+ """
3
+ Arch Linux MCP Server
4
+
5
+ A Model Context Protocol server that bridges AI assistants with the Arch Linux
6
+ ecosystem, providing access to the Arch Wiki, AUR, and official repositories.
7
+ """
8
+
9
+ __version__ = "0.1.0"
10
+
11
+ from .wiki import search_wiki, get_wiki_page, get_wiki_page_as_text
12
+ from .aur import (
13
+ search_aur,
14
+ get_aur_info,
15
+ get_pkgbuild,
16
+ get_aur_file,
17
+ analyze_pkgbuild_safety,
18
+ analyze_package_metadata_risk,
19
+ install_package_secure
20
+ )
21
+ from .pacman import (
22
+ get_official_package_info,
23
+ check_updates_dry_run,
24
+ remove_package,
25
+ remove_packages_batch,
26
+ list_orphan_packages,
27
+ remove_orphans,
28
+ find_package_owner,
29
+ list_package_files,
30
+ search_package_files,
31
+ verify_package_integrity,
32
+ list_package_groups,
33
+ list_group_packages,
34
+ list_explicit_packages,
35
+ mark_as_explicit,
36
+ mark_as_dependency,
37
+ check_database_freshness
38
+ )
39
+ from .system import (
40
+ get_system_info,
41
+ check_disk_space,
42
+ get_pacman_cache_stats,
43
+ check_failed_services,
44
+ get_boot_logs
45
+ )
46
+ from .news import (
47
+ get_latest_news,
48
+ check_critical_news,
49
+ get_news_since_last_update
50
+ )
51
+ from .logs import (
52
+ get_transaction_history,
53
+ find_when_installed,
54
+ find_failed_transactions,
55
+ get_database_sync_history
56
+ )
57
+ from .mirrors import (
58
+ list_active_mirrors,
59
+ test_mirror_speed,
60
+ suggest_fastest_mirrors,
61
+ check_mirrorlist_health
62
+ )
63
+ from .config import (
64
+ analyze_pacman_conf,
65
+ analyze_makepkg_conf,
66
+ check_ignored_packages,
67
+ get_parallel_downloads_setting
68
+ )
69
+ from .utils import IS_ARCH, run_command
70
+
71
+ # Import server from the server module
72
+ from .server import server
73
+
74
+ # Main function will be defined here
75
+ async def main():
76
+ """
77
+ Main entry point for the MCP server.
78
+ Runs the server using STDIO transport.
79
+ """
80
+ import asyncio
81
+ import mcp.server.stdio
82
+ import logging
83
+
84
+ # Set up logging
85
+ logging.basicConfig(level=logging.INFO)
86
+ logger = logging.getLogger(__name__)
87
+
88
+ logger.info("Starting Arch Linux MCP Server")
89
+ logger.info(f"Running on Arch Linux: {IS_ARCH}")
90
+
91
+ # Run the server using STDIO
92
+ async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
93
+ await server.run(
94
+ read_stream,
95
+ write_stream,
96
+ server.create_initialization_options()
97
+ )
98
+
99
+
100
+ def main_sync():
101
+ """Synchronous wrapper for the main function."""
102
+ import asyncio
103
+ asyncio.run(main())
104
+
105
+ __all__ = [
106
+ # Wiki
107
+ "search_wiki",
108
+ "get_wiki_page",
109
+ "get_wiki_page_as_text",
110
+ # AUR
111
+ "search_aur",
112
+ "get_aur_info",
113
+ "get_pkgbuild",
114
+ "get_aur_file",
115
+ "analyze_pkgbuild_safety",
116
+ "analyze_package_metadata_risk",
117
+ "install_package_secure",
118
+ # Pacman
119
+ "get_official_package_info",
120
+ "check_updates_dry_run",
121
+ "remove_package",
122
+ "remove_packages_batch",
123
+ "list_orphan_packages",
124
+ "remove_orphans",
125
+ "find_package_owner",
126
+ "list_package_files",
127
+ "search_package_files",
128
+ "verify_package_integrity",
129
+ "list_package_groups",
130
+ "list_group_packages",
131
+ "list_explicit_packages",
132
+ "mark_as_explicit",
133
+ "mark_as_dependency",
134
+ "check_database_freshness",
135
+ # System
136
+ "get_system_info",
137
+ "check_disk_space",
138
+ "get_pacman_cache_stats",
139
+ "check_failed_services",
140
+ "get_boot_logs",
141
+ # News
142
+ "get_latest_news",
143
+ "check_critical_news",
144
+ "get_news_since_last_update",
145
+ # Logs
146
+ "get_transaction_history",
147
+ "find_when_installed",
148
+ "find_failed_transactions",
149
+ "get_database_sync_history",
150
+ # Mirrors
151
+ "list_active_mirrors",
152
+ "test_mirror_speed",
153
+ "suggest_fastest_mirrors",
154
+ "check_mirrorlist_health",
155
+ # Config
156
+ "analyze_pacman_conf",
157
+ "analyze_makepkg_conf",
158
+ "check_ignored_packages",
159
+ "get_parallel_downloads_setting",
160
+ # Utils
161
+ "IS_ARCH",
162
+ "run_command",
163
+ # Main functions
164
+ "main",
165
+ "main_sync",
166
+ ]