arch-ops-server 0.1.0__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.
- arch_ops_server/__init__.py +79 -0
- arch_ops_server/aur.py +1132 -0
- arch_ops_server/pacman.py +319 -0
- arch_ops_server/py.typed +0 -0
- arch_ops_server/server.py +672 -0
- arch_ops_server/utils.py +272 -0
- arch_ops_server/wiki.py +244 -0
- arch_ops_server-0.1.0.dist-info/METADATA +109 -0
- arch_ops_server-0.1.0.dist-info/RECORD +11 -0
- arch_ops_server-0.1.0.dist-info/WHEEL +4 -0
- arch_ops_server-0.1.0.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Arch Linux MCP Server
|
|
3
|
+
|
|
4
|
+
A Model Context Protocol server that bridges AI assistants with the Arch Linux
|
|
5
|
+
ecosystem, providing access to the Arch Wiki, AUR, and official repositories.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "0.1.0"
|
|
9
|
+
|
|
10
|
+
from .wiki import search_wiki, get_wiki_page, get_wiki_page_as_text
|
|
11
|
+
from .aur import (
|
|
12
|
+
search_aur,
|
|
13
|
+
get_aur_info,
|
|
14
|
+
get_pkgbuild,
|
|
15
|
+
get_aur_file,
|
|
16
|
+
analyze_pkgbuild_safety,
|
|
17
|
+
analyze_package_metadata_risk,
|
|
18
|
+
install_package_secure
|
|
19
|
+
)
|
|
20
|
+
from .pacman import get_official_package_info, check_updates_dry_run
|
|
21
|
+
from .utils import IS_ARCH, run_command
|
|
22
|
+
|
|
23
|
+
# Import server from the server module
|
|
24
|
+
from .server import server
|
|
25
|
+
|
|
26
|
+
# Main function will be defined here
|
|
27
|
+
async def main():
|
|
28
|
+
"""
|
|
29
|
+
Main entry point for the MCP server.
|
|
30
|
+
Runs the server using STDIO transport.
|
|
31
|
+
"""
|
|
32
|
+
import asyncio
|
|
33
|
+
import mcp.server.stdio
|
|
34
|
+
import logging
|
|
35
|
+
|
|
36
|
+
# Set up logging
|
|
37
|
+
logging.basicConfig(level=logging.INFO)
|
|
38
|
+
logger = logging.getLogger(__name__)
|
|
39
|
+
|
|
40
|
+
logger.info("Starting Arch Linux MCP Server")
|
|
41
|
+
logger.info(f"Running on Arch Linux: {IS_ARCH}")
|
|
42
|
+
|
|
43
|
+
# Run the server using STDIO
|
|
44
|
+
async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
|
|
45
|
+
await server.run(
|
|
46
|
+
read_stream,
|
|
47
|
+
write_stream,
|
|
48
|
+
server.create_initialization_options()
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def main_sync():
|
|
53
|
+
"""Synchronous wrapper for the main function."""
|
|
54
|
+
import asyncio
|
|
55
|
+
asyncio.run(main())
|
|
56
|
+
|
|
57
|
+
__all__ = [
|
|
58
|
+
# Wiki
|
|
59
|
+
"search_wiki",
|
|
60
|
+
"get_wiki_page",
|
|
61
|
+
"get_wiki_page_as_text",
|
|
62
|
+
# AUR
|
|
63
|
+
"search_aur",
|
|
64
|
+
"get_aur_info",
|
|
65
|
+
"get_pkgbuild",
|
|
66
|
+
"get_aur_file",
|
|
67
|
+
"analyze_pkgbuild_safety",
|
|
68
|
+
"analyze_package_metadata_risk",
|
|
69
|
+
"install_package_secure",
|
|
70
|
+
# Pacman
|
|
71
|
+
"get_official_package_info",
|
|
72
|
+
"check_updates_dry_run",
|
|
73
|
+
# Utils
|
|
74
|
+
"IS_ARCH",
|
|
75
|
+
"run_command",
|
|
76
|
+
# Main functions
|
|
77
|
+
"main",
|
|
78
|
+
"main_sync",
|
|
79
|
+
]
|