c9a99f4fb3
代码修复: - web/agent/agent.py: datetime.utcnow() → datetime.now(timezone.utc) - requirements.txt: 移除 paramiko==3.5.0 (已无活跃引用) - 删除 server/infrastructure/ssh/pool.py (DEPRECATED, 无引用) 连接池三层对齐 (config.py/.env.example/session.py): - DB_POOL_SIZE 100→160, DB_MAX_OVERFLOW 100→120 - 基于 MySQL max_connections=400, install.php 公式 文档修复 (21项): - P0: 硬编码域名/IP替换为配置变量占位符 - P1: 10个过时设计文档加归档标注 (引用旧文件结构) - P2: step-3-webssh报告 paramiko引用修正 - 6份审查报告连接池参数勘误 100/100→160/120 - ECC安全报告 EC5 datetime.utcnow 标记已修复 - docs/README.md 文档索引重写 - docs/memory/mem_nexus_overview.md 移除硬编码凭证 - docs/project/tech-stack-inventory.md paramiko标记已移除 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
923 B
Python
30 lines
923 B
Python
"""MCP Bridge — launches remote MCP server via SSH and bridges stdio
|
|
|
|
Configure via environment variables:
|
|
NEXUS_SSH_KEY — path to SSH private key (default: ~/.ssh/id_rsa)
|
|
NEXUS_SSH_HOST — remote server hostname/IP (required)
|
|
NEXUS_DEPLOY_DIR — remote installation path (default: /opt/nexus)
|
|
"""
|
|
import os
|
|
import sys
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
ssh_key = os.environ.get("NEXUS_SSH_KEY", str(Path.home() / ".ssh" / "id_rsa"))
|
|
ssh_host = os.environ.get("NEXUS_SSH_HOST", "")
|
|
deploy_dir = os.environ.get("NEXUS_DEPLOY_DIR", "/opt/nexus")
|
|
|
|
if not ssh_host:
|
|
print("ERROR: NEXUS_SSH_HOST not set (e.g. root@1.2.3.4)", file=sys.stderr)
|
|
sys.exit(1)
|
|
|
|
ssh = subprocess.Popen([
|
|
"ssh",
|
|
"-o", "StrictHostKeyChecking=no",
|
|
"-i", ssh_key,
|
|
ssh_host,
|
|
"python3", f"{deploy_dir}/mcp/Nexus_server.py"
|
|
], stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr)
|
|
|
|
sys.exit(ssh.wait())
|