MCP 서버 연결(Go)

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

특징

  • Koneksi Storage에 파일 업로드

  • Koneksi Storage에서 파일 다운로드

  • 디렉토리 생성 및 관리

  • 파일 나열 및 검색

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

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

  • 경량 Go 구현

설치

  1. mcp-server 디렉토리로 이동합니다.

cd mcp-server
  1. 종속성을 설치합니다.

go mod download
  1. 프로젝트를 빌드합니다.

go build -o koneksi-mcp main.go
  1. Koneksi API 자격 증명을 구성하세요.

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

구성

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

  • KONEKSI_API_CLIENT_ID: Koneksi API 클라이언트 ID

  • KONEKSI_API_CLIENT_SECRET: Koneksi API 클라이언트 비밀번호

  • KONEKSI_API_BASE_URL: (선택사항) Koneksi API 기본 URL

용법

클로드 데스크탑과 함께

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

{
  "mcpServers": {
    "koneksi": {
      "command": "/path/to/koneksi-backup-cli/mcp-server/koneksi-mcp",
      "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

개발

서버를 실행합니다:

go run main.go

다양한 플랫폼에 맞춰 빌드:

# macOS
GOOS=darwin GOARCH=amd64 go build -o koneksi-mcp-darwin-amd64
GOOS=darwin GOARCH=arm64 go build -o koneksi-mcp-darwin-arm64

# Linux
GOOS=linux GOARCH=amd64 go build -o koneksi-mcp-linux-amd64

# Windows
GOOS=windows GOARCH=amd64 go build -o koneksi-mcp-windows-amd64.exe

테스트

MCP 서버를 테스트합니다.

# Run the server
./koneksi-mcp

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

Claude를 사용한 예시 사용Example Usage with Claude

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

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

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

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

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

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

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

특허

MIT

Last updated