%global extras gssapi Name: linux-mcp-server Version: 1.3.2 Release: %autorelease Summary: MCP server for read-only Linux system administration # The linux-mcp-server is licensed under Apache-2.0, except for: # # GPL-3.0: # - src/linux_mcp_server/_vendor/__init__.py # - See https://github.com/rhel-lightspeed/linux-mcp-server/blob/1.3.2/src/linux_mcp_server/_vendor/__init__.py#L10-L27 for longer explanation License: Apache-2.0 AND GPL-3.0 URL: https://github.com/rhel-lightspeed/linux-mcp-server Source: %{pypi_source linux_mcp_server} Patch: remove-pytest-coverage-options.diff # This patch can be removed once linux-mcp-server get updated to 1.4+ Patch1: https://github.com/rhel-lightspeed/linux-mcp-server/pull/307.patch#/disable-container-detection-under-test-by-default.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-bcrypt BuildRequires: python3-asyncssh BuildRequires: tomcli # Test dependencies BuildRequires: python3-pytest BuildRequires: python3-pytest-asyncio # Provides the `mocker` fixture BuildRequires: python3-pytest-mock # Some tests expects that certain critical binaries are present in the system # for performing tool calling. # # * tests/tools/test_system_info.py:70 BuildRequires: /usr/bin/free # * tests/tools/test_system_info.py:70 BuildRequires: /usr/bin/top # * tests/tools/test_system_info.py:70 BuildRequires: /usr/bin/hostname # * tests/tools/test_services.py:46 # * tests/tools/test_services.py:57 BuildRequires: /usr/bin/journalctl # * tests/tools/test_processes.py:15 # * tests/tools/test_processes.py:27 # * tests/tools/test_processes.py:33 # * tests/tools/test_processes.py:45 BuildRequires: /usr/bin/ps # * tests/tools/test_services.py:11 # * tests/tools/test_services.py:28 # * tests/tools/test_services.py:34 BuildRequires: /usr/bin/systemctl %global _description %{expand: A Model Context Protocol (MCP) server for read-only Linux system administration, diagnostics, and troubleshooting on RHEL-based systems. Features: * Read-Only Operations: All tools are strictly read-only for safe diagnostics * Remote SSH Execution: Execute commands on remote systems via SSH with key-based authentication * Multi-Host Management: Connect to different remote hosts in the same session * Comprehensive Diagnostics: System info, services, processes, logs, network, and storage * Configurable Log Access: Control which log files can be accessed via environment variables * RHEL/systemd Focused: Optimized for Red Hat Enterprise Linux systems } %description %_description %package -n python3-linux-mcp-server Summary: %{summary} %description -n python3-linux-mcp-server %_description %pyproject_extras_subpkg -n linux-mcp-server %{extras} %prep %autosetup -p1 -n linux_mcp_server-%{version} tomcli set pyproject.toml arrays replace project.optional-dependencies.gssapi "gssapi.*" "gssapi>=1.7.3" # python3-asyncssh does not provide an extra for bcrypt, so we re installing it # manually and removing it in %%prep tomcli set pyproject.toml arrays delitem project.dependencies "asyncssh.*" %generate_buildrequires %pyproject_buildrequires -x %{extras} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l linux_mcp_server %check # The following tests expects that the system has been booted with systemd, and # since we are executing this under systemd-nspawn, the test fails to determine # the PID 1 to by systemd. k="${k-}not test_get_service_status" k="${k-}${k+ and } not test_list_services" %pytest -k "${k-}" %files -n linux-mcp-server -f %{pyproject_files} %license LICENSE %license licenses/GPL-3.0.txt %doc README.md %doc docs/*.md %doc docs/examples/* %{_bindir}/linux-mcp-server %changelog %autochangelog