MCP Hub
Back to servers

nhn-server-mcp

An MCP server that acts as an SSH gateway for secure remote server command execution, featuring Kerberos authentication, command whitelisting, and dynamic configuration reloading.

Tools
5
Updated
Jan 9, 2026
Validated
Jan 9, 2026

NHN Server MCP

SSH Gateway를 통해 서버에 접속하고 명령어를 실행하는 MCP (Model Context Protocol) 서버입니다.

기능

  • SSH Gateway를 통한 서버 접속
  • Kerberos 인증 (kinit) 지원
  • 명령어 화이트리스트
  • 위험 패턴 차단 (설정 가능)
  • 서버 정보 조회 (AI가 로그 경로 등 확인 가능)
  • 설정 동적 리로드

설치

npm install
npm run build

설정

1. config.json 생성

{
  "gatewayConnection": "user@gateway.example.com:22",
  "gatewayPassword": "your-password",
  "kinitPassword": "your-kerberos-password",
  "allowedHosts": ["server1", "server2"],
  "blockedPatterns": [">", "`", "$(", ";", "&&", "||"],
  "allowedCommands": [
    "tail", "head", "cat", "grep", "ls", "ps", "whoami"
  ],
  "serverInfo": {
    "서버에 대한 user 정보 필수": "exec 할때 user 를 같이 보냅니다.",
    "나머지는": "원하는 내용으로",
    "ex - logPaths": {
      "app": "/var/log/app.log",
      "nginx": "/var/log/nginx/access.log"
    }
  }
}

2. Claude Desktop 설정

~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "nhn-server": {
      "command": "node",
      "args": ["/path/to/nhn-server-mcp/dist/index.js"],
      "env": {
        "CONFIG_FILE": "/path/to/config.json",
        "DEBUG": "false"
      }
    }
  }
}

설정 옵션

설명기본값
gatewayConnectionGateway SSH 연결 (user@host:port)-
gatewayPasswordGateway SSH 비밀번호-
kinitPasswordKerberos 인증 비밀번호-
allowedHosts접속 허용 호스트 목록[] (모두 허용)
allowedCommands실행 허용 명령어 목록기본 명령어 목록
blockedPatterns차단할 패턴 목록[">", "\", "$(", ";", "&&", "||"]`
serverInfoAI에게 노출할 서버 정보{}

환경변수

변수설명
CONFIG_FILEconfig.json 파일 경로
DEBUG디버그 로그 활성화 (true/false)

MCP 도구

exec

서버에서 명령어를 실행합니다.

{
  "host": "server-hostname",
  "user": "user",
  "command": "tail -100 /var/log/app.log"
}

get_config

서버 설정 정보를 조회합니다. (허용 호스트, 명령어, 서버 정보)

reload_config

설정 파일을 다시 로드합니다.

disconnect_server

Gateway 연결을 종료합니다.

connection_status

현재 연결 상태를 확인합니다.

보안

  • config.json에 민감한 정보(비밀번호)가 포함되므로 git에 커밋하지 마세요
  • blockedPatterns로 위험한 명령어 패턴을 차단합니다
  • allowedHosts로 접속 가능한 서버를 제한합니다
  • allowedCommands로 실행 가능한 명령어를 제한합니다
  • 5분 비활성 시 자동 연결 종료

라이선스

MIT

Reviews

No reviews yet

Sign in to write a review