mega-mcp-server 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +200 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +589 -0
- package/package.json +30 -0
- package/src/index.ts +605 -0
- package/tsconfig.json +16 -0
package/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# MEGA Cloud Storage MCP Server
|
|
2
|
+
|
|
3
|
+
MCP server for MEGA cloud storage integration with Claude Code. Provides comprehensive file management, synchronization, and sharing capabilities using MEGAcmd.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **File Management** - List, copy, move, delete files and folders
|
|
8
|
+
- **Upload/Download** - Transfer files between local and cloud
|
|
9
|
+
- **Sharing** - Create public links and share with other users
|
|
10
|
+
- **Sync** - Set up folder synchronization
|
|
11
|
+
- **Storage Info** - View usage and quotas
|
|
12
|
+
|
|
13
|
+
## Available Tools (18 total)
|
|
14
|
+
|
|
15
|
+
### Account & Navigation
|
|
16
|
+
| Tool | Description |
|
|
17
|
+
|------|-------------|
|
|
18
|
+
| `mega_whoami` | Get current logged-in account info |
|
|
19
|
+
| `mega_pwd` | Print current working directory |
|
|
20
|
+
| `mega_cd` | Change current directory |
|
|
21
|
+
| `mega_df` | Show storage space usage |
|
|
22
|
+
| `mega_du` | Show disk usage of remote path |
|
|
23
|
+
|
|
24
|
+
### File Operations
|
|
25
|
+
| Tool | Description |
|
|
26
|
+
|------|-------------|
|
|
27
|
+
| `mega_ls` | List files and folders |
|
|
28
|
+
| `mega_mkdir` | Create a directory |
|
|
29
|
+
| `mega_rm` | Remove files or folders |
|
|
30
|
+
| `mega_mv` | Move or rename files/folders |
|
|
31
|
+
| `mega_cp` | Copy files/folders |
|
|
32
|
+
| `mega_cat` | Display contents of a remote file |
|
|
33
|
+
| `mega_tree` | Show directory tree structure |
|
|
34
|
+
| `mega_find` | Search for files/folders |
|
|
35
|
+
|
|
36
|
+
### Transfer
|
|
37
|
+
| Tool | Description |
|
|
38
|
+
|------|-------------|
|
|
39
|
+
| `mega_get` | Download files to local filesystem |
|
|
40
|
+
| `mega_put` | Upload files to MEGA cloud |
|
|
41
|
+
| `mega_transfers` | Show current transfers |
|
|
42
|
+
| `mega_sync` | Set up folder synchronization |
|
|
43
|
+
|
|
44
|
+
### Sharing
|
|
45
|
+
| Tool | Description |
|
|
46
|
+
|------|-------------|
|
|
47
|
+
| `mega_export` | Create a public link |
|
|
48
|
+
| `mega_share` | Share folder with another user |
|
|
49
|
+
| `mega_import` | Import a public MEGA link |
|
|
50
|
+
|
|
51
|
+
## Setup
|
|
52
|
+
|
|
53
|
+
### 1. Prerequisites
|
|
54
|
+
|
|
55
|
+
Install MEGAcmd from https://mega.io/cmd
|
|
56
|
+
|
|
57
|
+
On macOS:
|
|
58
|
+
```bash
|
|
59
|
+
brew install --cask megacmd
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Login to your MEGA account:
|
|
63
|
+
```bash
|
|
64
|
+
mega-login your@email.com password
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 2. Install Dependencies
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cd ~/mcp-servers/mega-mcp
|
|
71
|
+
npm install
|
|
72
|
+
npm run build
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 3. Add to Claude Code
|
|
76
|
+
|
|
77
|
+
Add to `~/.claude.json`:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"mcpServers": {
|
|
82
|
+
"mega": {
|
|
83
|
+
"type": "stdio",
|
|
84
|
+
"command": "node",
|
|
85
|
+
"args": ["/Users/matthewkarsten/mcp-servers/mega-mcp/dist/index.js"]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Architecture
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Claude Code (Opus 4.5)
|
|
95
|
+
│
|
|
96
|
+
└──▶ MEGA MCP Server
|
|
97
|
+
│
|
|
98
|
+
└──▶ MEGAcmd CLI
|
|
99
|
+
│
|
|
100
|
+
└──▶ MEGA Cloud Storage
|
|
101
|
+
│
|
|
102
|
+
├── 20 GB Free Storage
|
|
103
|
+
├── End-to-End Encryption
|
|
104
|
+
├── File Versioning
|
|
105
|
+
└── Sharing & Sync
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## MEGA Features
|
|
109
|
+
|
|
110
|
+
- **End-to-End Encryption** - All files encrypted client-side
|
|
111
|
+
- **20 GB Free Storage** - Free tier included
|
|
112
|
+
- **File Versioning** - Automatic version history
|
|
113
|
+
- **Cross-Platform Sync** - Desktop and mobile apps
|
|
114
|
+
- **Public Links** - Share files with anyone
|
|
115
|
+
- **Folder Sharing** - Collaborate with other MEGA users
|
|
116
|
+
|
|
117
|
+
## Usage Examples
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
User: Show my MEGA storage usage
|
|
121
|
+
|
|
122
|
+
Claude: [Uses mega_df tool]
|
|
123
|
+
Result:
|
|
124
|
+
Account: purplesquirrelmedia@icloud.com
|
|
125
|
+
Used: 2.3 GB of 20 GB (11.5%)
|
|
126
|
+
Available: 17.7 GB
|
|
127
|
+
|
|
128
|
+
User: List files in my Documents folder
|
|
129
|
+
|
|
130
|
+
Claude: [Uses mega_ls tool with path=/Documents]
|
|
131
|
+
Result:
|
|
132
|
+
- project-files/
|
|
133
|
+
- presentations/
|
|
134
|
+
- backup.zip (156 MB)
|
|
135
|
+
- notes.txt (2.3 KB)
|
|
136
|
+
|
|
137
|
+
User: Create a public link for backup.zip
|
|
138
|
+
|
|
139
|
+
Claude: [Uses mega_export tool]
|
|
140
|
+
Result: https://mega.nz/file/xxxxx#yyyyy
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Transfer Features
|
|
144
|
+
|
|
145
|
+
### Upload
|
|
146
|
+
```
|
|
147
|
+
User: Upload ~/reports/ to MEGA
|
|
148
|
+
|
|
149
|
+
Claude: [Uses mega_put tool]
|
|
150
|
+
Uploading 15 files...
|
|
151
|
+
Completed: ~/reports/ -> /reports/
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Download
|
|
155
|
+
```
|
|
156
|
+
User: Download /Documents/backup.zip
|
|
157
|
+
|
|
158
|
+
Claude: [Uses mega_get tool]
|
|
159
|
+
Downloaded: /Documents/backup.zip -> ~/Downloads/backup.zip
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Sync
|
|
163
|
+
```
|
|
164
|
+
User: Set up sync between ~/Projects and /Projects
|
|
165
|
+
|
|
166
|
+
Claude: [Uses mega_sync tool]
|
|
167
|
+
Sync established: ~/Projects <-> /Projects
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Files
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
mega-mcp/
|
|
174
|
+
├── src/
|
|
175
|
+
│ └── index.ts # MCP server implementation
|
|
176
|
+
├── dist/ # Compiled JavaScript
|
|
177
|
+
├── package.json
|
|
178
|
+
├── tsconfig.json
|
|
179
|
+
└── README.md
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Dependencies
|
|
183
|
+
|
|
184
|
+
- `@modelcontextprotocol/sdk` - MCP SDK
|
|
185
|
+
- MEGAcmd - MEGA command-line client
|
|
186
|
+
|
|
187
|
+
## Security
|
|
188
|
+
|
|
189
|
+
- All data encrypted with your account key
|
|
190
|
+
- Zero-knowledge encryption (MEGA can't read your files)
|
|
191
|
+
- Two-factor authentication supported
|
|
192
|
+
- Session-based authentication via MEGAcmd
|
|
193
|
+
|
|
194
|
+
## Author
|
|
195
|
+
|
|
196
|
+
Matthew Karsten
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
MIT
|
package/dist/index.d.ts
ADDED