arch-ops-server 3.0.1__py3-none-any.whl

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,176 @@
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__ = "3.0.1"
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 (default for Docker MCP Catalog).
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 (STDIO)")
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 (STDIO transport)."""
102
+ import asyncio
103
+ asyncio.run(main())
104
+
105
+
106
+ def main_http_sync():
107
+ """
108
+ Main entry point for HTTP server (for Smithery).
109
+ Runs the server using SSE (Server-Sent Events) HTTP transport.
110
+ """
111
+ from .http_server import main_http
112
+ main_http()
113
+
114
+ __all__ = [
115
+ # Wiki
116
+ "search_wiki",
117
+ "get_wiki_page",
118
+ "get_wiki_page_as_text",
119
+ # AUR
120
+ "search_aur",
121
+ "get_aur_info",
122
+ "get_pkgbuild",
123
+ "get_aur_file",
124
+ "analyze_pkgbuild_safety",
125
+ "analyze_package_metadata_risk",
126
+ "install_package_secure",
127
+ # Pacman
128
+ "get_official_package_info",
129
+ "check_updates_dry_run",
130
+ "remove_package",
131
+ "remove_packages_batch",
132
+ "list_orphan_packages",
133
+ "remove_orphans",
134
+ "find_package_owner",
135
+ "list_package_files",
136
+ "search_package_files",
137
+ "verify_package_integrity",
138
+ "list_package_groups",
139
+ "list_group_packages",
140
+ "list_explicit_packages",
141
+ "mark_as_explicit",
142
+ "mark_as_dependency",
143
+ "check_database_freshness",
144
+ # System
145
+ "get_system_info",
146
+ "check_disk_space",
147
+ "get_pacman_cache_stats",
148
+ "check_failed_services",
149
+ "get_boot_logs",
150
+ # News
151
+ "get_latest_news",
152
+ "check_critical_news",
153
+ "get_news_since_last_update",
154
+ # Logs
155
+ "get_transaction_history",
156
+ "find_when_installed",
157
+ "find_failed_transactions",
158
+ "get_database_sync_history",
159
+ # Mirrors
160
+ "list_active_mirrors",
161
+ "test_mirror_speed",
162
+ "suggest_fastest_mirrors",
163
+ "check_mirrorlist_health",
164
+ # Config
165
+ "analyze_pacman_conf",
166
+ "analyze_makepkg_conf",
167
+ "check_ignored_packages",
168
+ "get_parallel_downloads_setting",
169
+ # Utils
170
+ "IS_ARCH",
171
+ "run_command",
172
+ # Main functions
173
+ "main",
174
+ "main_sync",
175
+ "main_http_sync",
176
+ ]