Koneksi MCP Server (Node.js)

A Node.js-based MCP (Model Context Protocol) server that provides AI assistants with access to Koneksi Storage for secure file storage and backup operations.

Features

  • Upload files to Koneksi Storage

  • Download files from Koneksi Storage

  • Create and manage directories

  • List and search files

  • Backup files with optional compression and encryption

  • Secure authentication using API keys

  • Lightweight Node.js implementation

Installation

  1. Clone the repository:

git clone <repository-url>
cd mcp-server-nodejs
  1. Install dependencies:

npm install
  1. Configure your Koneksi API credentials:

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

Configuration

Set the following environment variables in your .env file:

  • 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

Usage

With Claude Desktop

Add the server to your Claude Desktop configuration (claude_desktop_config.json):

Available Tools

  1. upload_file: Upload a file to Koneksi Storage

    • filePath: Path to the file to upload

    • directoryId: (Optional) Directory ID to upload to

  2. download_file: Download a file from Koneksi Storage

    • fileId: ID of the file to download

    • outputPath: Path where to save the file

  3. list_directories: List all directories

  4. create_directory: Create a new directory

    • name: Name of the directory

    • description: (Optional) Description

  5. search_files: List files in a directory

    • directoryId: Directory ID to search in

  6. upload_content: Upload content directly (for attached files in Claude)

    • fileName: Name for the file

    • content: Base64 encoded file content

    • directoryId: (Optional) Directory ID to upload to

  7. backup_file: Backup a file with optional compression and encryption

    • 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

Development

Run the server:

Run in development mode with auto-reload:

Testing

Test the MCP server:

Example Usage with Claude

Once configured, you can use commands like:

  • "Upload the file /path/to/document.pdf to Koneksi Storage"

  • "Download file with ID abc123 to my desktop"

  • "List all my directories in Koneksi Storage"

  • "Create a new directory called 'Project Files' for my project backups"

  • "Show me all files in directory xyz789"

  • "Backup the file /path/to/important.doc with compression and encryption"

Differences from Go Implementation

This Node.js implementation provides the exact same MCP interface as the Go version, with identical:

  • Tool names and parameters

  • JSON-RPC protocol handling

  • Response formats

  • Environment variable configuration

The main differences are:

  • Written in JavaScript/Node.js instead of Go

  • Uses axios for HTTP requests instead of Go's net/http

  • File handling uses Node.js fs module

License

MIT

Last updated