MCP 서버(Node.js)의 연결

AI 어시스턴트가 Koneksi Storage에 접근하여 안전한 파일 저장 및 백업 작업을 수행할 수 있도록 지원하는 Node.js 기반 MCP(Model Context Protocol) 서버입니다.

특징

  • Koneksi Storage에 파일 업로드

  • Koneksi Storage에서 파일 다운로드

  • 디렉토리 생성 및 관리

  • 파일 나열 및 검색

  • 선택적인 압축 및 암호화를 통한 파일 백업

  • API 키를 사용한 안전한 인증

  • 경량 Node.js 구현

설치

  1. 저장소를 복제합니다.

git clone <repository-url>
cd mcp-server-nodejs
  1. 종속성을 설치합니다.

npm install
  1. Koneksi API 자격 증명을 구성하세요.

cp .env.example .env
# Edit .env with your API credentials

구성

.env 파일에서 다음 환경 변수를 설정하세요.

  • KONEKSI_API_CLIENT_ID: Your Koneksi API client ID

  • KONEKSI_API_CLIENT_SECRET: Your Koneksi API client secret

  • KONEKSI_API_BASE_URL: (Optional) Koneksi API base URL

용법

클로드 데스크탑과 함께

Claude Desktop 구성에 서버를 추가합니다. (claude_desktop_config.json):

{
  "mcpServers": {
    "koneksi": {
      "command": "node",
      "args": ["/path/to/mcp-server-nodejs/src/index.js"],
      "env": {
        "KONEKSI_API_CLIENT_ID": "your_client_id",
        "KONEKSI_API_CLIENT_SECRET": "your_client_secret"
      }
    }
  }
}

사용 가능한 도구

  1. upload_file: Koneksi Storage에 파일 업로드

    • filePath: Path to the file to upload

    • directoryId: (Optional) Directory ID to upload to

  2. download_file: Koneksi Storage에서 파일을 다운로드하세요

    • fileId: ID of the file to download

    • outputPath: Path where to save the file

  3. list_directories: 모든 디렉토리 나열

  4. create_directory: 새 디렉터리 만들기

    • name: Name of the directory

    • description: (Optional) Description

  5. search_files: 디렉토리의 파일 나열

    • directoryId: Directory ID to search in

  6. upload_content: 컨텐츠를 직접 업로드하세요(Claude의 첨부 파일용)

    • fileName: Name for the file

    • content: Base64 encoded file content

    • directoryId: (Optional) Directory ID to upload to

  7. backup_file: 선택적 압축 및 암호화를 사용하여 파일 백업

    • filePath: Path to the file to backup

    • directoryId: (Optional) Directory ID to backup to

    • compress: (Optional) Compress the file before backup

    • encrypt: (Optional) Encrypt the file before backup

    • encryptPassword: (Optional) Password for encryption

개발

서버를 실행합니다:

npm start

자동 다시 로드를 사용하여 개발 모드에서 실행:

npm run dev

테스트

MCP 서버를 테스트합니다.

# Run the server
npm start

# In another terminal, send a test request
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | npm start

Claude를 사용한 예시 사용

구성이 완료되면 다음과 같은 명령을 사용할 수 있습니다.

  • "/path/to/document.pdf 파일을 Koneksi 저장소에 업로드합니다."

  • "ID가 abc123인 파일을 데스크톱에 다운로드합니다."

  • "Koneksi 저장소에 있는 모든 디렉터리를 나열합니다."

  • "프로젝트 백업을 위해 'Project Files'라는 새 디렉터리를 만듭니다."

  • "xyz789 디렉터리의 모든 파일을 표시합니다."

  • "/path/to/important.doc 파일을 압축 및 암호화하여 백업합니다."

Go 구현과의 차이점

이 Node.js 구현은 Go 버전과 정확히 동일한 MCP 인터페이스를 제공합니다.

  • 도구 이름 및 매개변수

  • JSON-RPC 프로토콜 처리

  • 응답 형식

  • 환경 변수 구성

주요 차이점은 다음과 같습니다.

  • Go 대신 JavaScript/Node.js로 작성됨

  • HTTP 요청에 Go의 net/http 대신 axios를 사용함

  • 파일 처리는 Node.js fs 모듈을 사용함

특허

MIT

Last updated