ssh-licco 2.6.0__tar.gz → 2.7.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.
Files changed (52) hide show
  1. {ssh_licco-2.6.0/ssh_licco.egg-info → ssh_licco-2.7.0}/PKG-INFO +1 -1
  2. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/pyproject.toml +1 -1
  3. {ssh_licco-2.6.0 → ssh_licco-2.7.0/ssh_licco.egg-info}/PKG-INFO +1 -1
  4. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/__init__.py +2 -2
  5. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/session_manager.py +7 -0
  6. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/LICENSE +0 -0
  7. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/README.md +0 -0
  8. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/setup.cfg +0 -0
  9. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_licco.egg-info/SOURCES.txt +0 -0
  10. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_licco.egg-info/dependency_links.txt +0 -0
  11. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_licco.egg-info/entry_points.txt +0 -0
  12. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_licco.egg-info/requires.txt +0 -0
  13. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_licco.egg-info/top_level.txt +0 -0
  14. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/__main__.py +0 -0
  15. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/audit_logger.py +0 -0
  16. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/batch_executor.py +0 -0
  17. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/cli.py +0 -0
  18. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/clients/__init__.py +0 -0
  19. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/clients/additional_clients.py +0 -0
  20. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/clients/factory.py +0 -0
  21. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/clients/interface.py +0 -0
  22. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/clients/paramiko_client.py +0 -0
  23. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/config_manager.py +0 -0
  24. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/connection_config.py +0 -0
  25. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/connection_pool.py +0 -0
  26. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/exceptions.py +0 -0
  27. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/executor.py +0 -0
  28. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/__init__.py +0 -0
  29. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/connect.py +0 -0
  30. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/context.py +0 -0
  31. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/docker.py +0 -0
  32. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/execute.py +0 -0
  33. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/file_transfer.py +0 -0
  34. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/host.py +0 -0
  35. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/key.py +0 -0
  36. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/process.py +0 -0
  37. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/schemas.py +0 -0
  38. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/session.py +0 -0
  39. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/handlers/utils.py +0 -0
  40. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/key_manager.py +0 -0
  41. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/logging_config.py +0 -0
  42. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/security.py +0 -0
  43. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/server.py +0 -0
  44. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/service.py +0 -0
  45. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/tunnel.py +0 -0
  46. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/ssh_mcp/watchdog.py +0 -0
  47. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/tests/test_config_manager.py +0 -0
  48. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/tests/test_key_manager.py +0 -0
  49. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/tests/test_security.py +0 -0
  50. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/tests/test_server.py +0 -0
  51. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/tests/test_session_manager.py +0 -0
  52. {ssh_licco-2.6.0 → ssh_licco-2.7.0}/tests/test_watchdog.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ssh-licco
3
- Version: 2.6.0
3
+ Version: 2.7.0
4
4
  Summary: SSH Model Context Protocol Server - Enable SSH functionality for AI models
5
5
  Author-email: SSH LICCO Team <contact@ssh-licco.dev>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ssh-licco"
3
- version = "2.6.0"
3
+ version = "2.7.0"
4
4
  description = "SSH Model Context Protocol Server - Enable SSH functionality for AI models"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ssh-licco
3
- Version: 2.6.0
3
+ Version: 2.7.0
4
4
  Summary: SSH Model Context Protocol Server - Enable SSH functionality for AI models
5
5
  Author-email: SSH LICCO Team <contact@ssh-licco.dev>
6
6
  License: MIT
@@ -1,8 +1,8 @@
1
1
  # SSH-LICCO 版本信息
2
2
  # 所有代码中的版本信息都从这里读取
3
- # 版本号:2.6.0
3
+ # 版本号:2.7.0
4
4
 
5
- __version__ = "2.6.0"
5
+ __version__ = "2.7.0"
6
6
  __author__ = "Li Qi"
7
7
  __email__ = "1985694657@qq.com"
8
8
  __license__ = "MIT"
@@ -692,6 +692,7 @@ class SSHSession:
692
692
 
693
693
  class SessionManager:
694
694
  # 🔒 安全限制:最大并发会话数(防止资源耗尽 DoS)
695
+ # 可通过环境变量 SSH_MAX_SESSIONS / SSH_MAX_SESSIONS_PER_HOST 覆盖
695
696
  MAX_SESSIONS = 20
696
697
  MAX_SESSIONS_PER_HOST = 5 # 每个主机最多 5 个并发会话
697
698
 
@@ -701,6 +702,12 @@ class SessionManager:
701
702
  self._shutdown_event = asyncio.Event()
702
703
  self._timeout_cleanup_task: asyncio.Task | None = None
703
704
  self._logger = get_logger("SessionManager")
705
+ # 环境变量覆盖每主机会话上限与全局会话上限(与 sshd MaxSessions 解耦)
706
+ # 注意:这是 MCP 应用层限制,独立于 sshd 的 MaxSessions
707
+ self.MAX_SESSIONS = max(1, int(os.getenv("SSH_MAX_SESSIONS", str(type(self).MAX_SESSIONS))))
708
+ self.MAX_SESSIONS_PER_HOST = max(
709
+ 1, int(os.getenv("SSH_MAX_SESSIONS_PER_HOST", str(type(self).MAX_SESSIONS_PER_HOST)))
710
+ )
704
711
  self._start_timeout_cleanup()
705
712
  self._session_counter = 0 # 用于统计和限制
706
713
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes