neozip-mcp 0.1.0-beta
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/.cursor/mcp.json.global.example +10 -0
- package/CHANGELOG.md +16 -0
- package/DOCUMENTATION.md +40 -0
- package/LICENSE +16 -0
- package/README.md +223 -0
- package/SECURITY.md +37 -0
- package/dist/account/account-state.js +86 -0
- package/dist/account/format-account-status.js +37 -0
- package/dist/account/identity-provision.js +75 -0
- package/dist/account/identity-wrap.js +69 -0
- package/dist/account/profile-crypto.js +47 -0
- package/dist/account/profile-store.js +108 -0
- package/dist/account/require-account.js +29 -0
- package/dist/account/token-service-identity.js +395 -0
- package/dist/account/types.js +2 -0
- package/dist/account/wallet-evm.js +39 -0
- package/dist/archive/blockchain-status.js +303 -0
- package/dist/archive/crypto-self.js +114 -0
- package/dist/archive/detect-text.js +56 -0
- package/dist/archive/embed-metadata.js +283 -0
- package/dist/archive/encryption.js +166 -0
- package/dist/archive/extract-entry-buffer.js +18 -0
- package/dist/archive/find-entry.js +21 -0
- package/dist/archive/grep-content.js +141 -0
- package/dist/archive/identity-key.js +176 -0
- package/dist/archive/manifest.js +55 -0
- package/dist/archive/merkle.js +31 -0
- package/dist/archive/metadata-paths.js +14 -0
- package/dist/archive/mint-archive.js +61 -0
- package/dist/archive/open-archive.js +23 -0
- package/dist/archive/read-entry-buffer.js +11 -0
- package/dist/archive/read-entry-content.js +51 -0
- package/dist/archive/recipient-access.js +26 -0
- package/dist/archive/recipient-decrypt.js +21 -0
- package/dist/archive/recipient-lookup.js +55 -0
- package/dist/archive/timestamp-network.js +54 -0
- package/dist/config/capabilities.js +37 -0
- package/dist/config/index.js +74 -0
- package/dist/connect-cli.js +312 -0
- package/dist/connection/coordinator.js +74 -0
- package/dist/connection/credentials.js +29 -0
- package/dist/connection/crypto.js +56 -0
- package/dist/connection/dump.js +79 -0
- package/dist/connection/incomplete-setup.js +81 -0
- package/dist/connection/interactive.js +814 -0
- package/dist/connection/legacy-profile-reader.js +47 -0
- package/dist/connection/magic-link.js +138 -0
- package/dist/connection/migrate.js +76 -0
- package/dist/connection/onboarding.js +524 -0
- package/dist/connection/origin.js +63 -0
- package/dist/connection/phase.js +93 -0
- package/dist/connection/phone.js +20 -0
- package/dist/connection/promote-active.js +53 -0
- package/dist/connection/reset.js +20 -0
- package/dist/connection/setup-guidance.js +154 -0
- package/dist/connection/status-report.js +40 -0
- package/dist/connection/store.js +352 -0
- package/dist/connection/token-auth.js +42 -0
- package/dist/connection/types.js +2 -0
- package/dist/connection/wallet-setup.js +70 -0
- package/dist/constants/wallet-identity.js +11 -0
- package/dist/index.js +47 -0
- package/dist/load-env.js +16 -0
- package/dist/neozipkit-node.js +11 -0
- package/dist/register/resources.js +14 -0
- package/dist/register/tools.js +77 -0
- package/dist/resources/zip-resource.js +40 -0
- package/dist/resources/zip-uri.js +23 -0
- package/dist/security/auth.js +28 -0
- package/dist/security/capabilities.js +85 -0
- package/dist/security/rate-limiter.js +43 -0
- package/dist/security/resource-limiter.js +44 -0
- package/dist/security/sandbox.js +61 -0
- package/dist/server.js +32 -0
- package/dist/startup-account-gate.js +101 -0
- package/dist/startup-summary.js +40 -0
- package/dist/token-service/require-configured.js +23 -0
- package/dist/tools/account.js +504 -0
- package/dist/tools/compress.js +237 -0
- package/dist/tools/connect-status.js +143 -0
- package/dist/tools/extract.js +62 -0
- package/dist/tools/grep-entries.js +42 -0
- package/dist/tools/identity-status.js +157 -0
- package/dist/tools/info.js +147 -0
- package/dist/tools/list.js +118 -0
- package/dist/tools/lookup-recipient.js +37 -0
- package/dist/tools/mint.js +41 -0
- package/dist/tools/read-entry.js +35 -0
- package/dist/tools/search-entries.js +71 -0
- package/dist/tools/stamp.js +60 -0
- package/dist/tools/test.js +90 -0
- package/dist/tools/token-service-account.js +143 -0
- package/dist/tools/upgrade.js +60 -0
- package/dist/tools/verify.js +75 -0
- package/dist/tools/wallet-config-status.js +119 -0
- package/dist/tools/wallet-info.js +64 -0
- package/dist/translators/index.js +106 -0
- package/dist/types/index.js +7 -0
- package/dist/util/mask.js +30 -0
- package/dist/util/token-service-fetch.js +23 -0
- package/dist/vendor/neozipkit-pro.js +3 -0
- package/docs/NEOZIP_CONNECTION_STORE.md +238 -0
- package/docs/NEOZIP_CONNECT_CLI.md +185 -0
- package/docs/OPERATIONS.md +992 -0
- package/docs/examples/CLAUDE.md.example +22 -0
- package/docs/examples/claude/skills/neozip-mcp/SKILL.md +54 -0
- package/docs/examples/claude/skills/neozip-notarization/SKILL.md +75 -0
- package/docs/examples/mcp.json.claude.example +11 -0
- package/docs/examples/neozip-mcp-cursor-rule.mdc +31 -0
- package/docs/installation-guides/INSTALL_CLAUDE_CODE.md +286 -0
- package/docs/installation-guides/INSTALL_CLAUDE_WORKSPACE.md +301 -0
- package/docs/installation-guides/README.md +76 -0
- package/package.json +99 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# NeoZip Connect CLI
|
|
2
|
+
|
|
3
|
+
`neozip-connect` is published with the `neozip-mcp` npm package. It registers a NeoZip account on a Token Service, provisions a Data Wallet and X25519 identity, and writes a **connection store** under `~/.neozip/connection/`.
|
|
4
|
+
|
|
5
|
+
The MCP server reads that store at startup; it does **not** shell out to the CLI during normal operation.
|
|
6
|
+
|
|
7
|
+
For field-level schema details, see [NEOZIP_CONNECTION_STORE.md](./NEOZIP_CONNECTION_STORE.md). The canonical schema is in [NEOZIP_CONNECTION_FILE.md](https://github.com/neoware/neozip-token-service/blob/main/docs/NEOZIP_CONNECTION_FILE.md) (neozip-token-service).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Connection store
|
|
12
|
+
|
|
13
|
+
| Override | Default |
|
|
14
|
+
|----------|---------|
|
|
15
|
+
| `NEOZIP_CONNECTION_DIR` | `~/.neozip/connection/` |
|
|
16
|
+
|
|
17
|
+
Each saved account is a **connection** — one email + wallet + identity bound to one Token Service deployment. You can store multiple connections on one machine.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
~/.neozip/connection/
|
|
21
|
+
├── manifest.json # Index + active account
|
|
22
|
+
└── connections/
|
|
23
|
+
└── <connection-uuid>/
|
|
24
|
+
├── public.json # Non-secret metadata (plain JSON)
|
|
25
|
+
└── secrets.enc # Encrypted credentials (AES-256-GCM)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| File | Contents |
|
|
29
|
+
|------|----------|
|
|
30
|
+
| `manifest.json` | Connection IDs grouped by Token Service origin; which connection is **active** for MCP |
|
|
31
|
+
| `public.json` | Label, `tokenServiceOrigin`, verified email, EVM address, wallet/identity IDs, X25519 public key fingerprint, onboarding phase timestamps |
|
|
32
|
+
| `secrets.enc` | Encrypted Bearer access token and EVM private key |
|
|
33
|
+
|
|
34
|
+
Inspect without secrets:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
neozip-connect dump
|
|
38
|
+
neozip-connect status --verbose
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
A connection reaches **`phase: ready`** when email is verified, the wallet is linked, and the X25519 identity is provisioned. MCP loads the active ready connection for timestamp, tokenize, mint, stamp, and recipient encryption.
|
|
42
|
+
|
|
43
|
+
### Encryption
|
|
44
|
+
|
|
45
|
+
By default, `secrets.enc` is encrypted with a **machine-local key** (hostname + username). No setup step is required on a trusted machine.
|
|
46
|
+
|
|
47
|
+
Optional — set a custom passphrase when you need portable encryption across machines or users:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
export NEOZIP_UNLOCK_PASSPHRASE='your-secret-passphrase'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use the same value for both `neozip-connect` and `neozip-mcp` when you set a custom passphrase.
|
|
54
|
+
|
|
55
|
+
**Recovery phrase vs unlock passphrase:** When you create a new Data Wallet, the wizard shows your **wallet recovery phrase** once (for restoring the wallet). `NEOZIP_UNLOCK_PASSPHRASE` only encrypts files under `~/.neozip/connection/` — it is not the wallet recovery phrase.
|
|
56
|
+
|
|
57
|
+
Optional Token Service default during setup:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
export TOKEN_SERVICE_URL='https://testnet.token-service.neozip.io'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Interactive wizard
|
|
66
|
+
|
|
67
|
+
Run **`neozip-connect`** with no subcommand (or `neozip-connect wizard`) for the interactive flow:
|
|
68
|
+
|
|
69
|
+
1. Choose a Token Service deployment
|
|
70
|
+
2. Register and verify email (6-digit OTP)
|
|
71
|
+
3. Create or import a Data Wallet
|
|
72
|
+
4. Link the wallet and provision the X25519 identity
|
|
73
|
+
|
|
74
|
+
The Token Service step offers:
|
|
75
|
+
|
|
76
|
+
1. NeoZip Testnet (`https://testnet.token-service.neozip.io`) — default
|
|
77
|
+
2. NeoZip Production (`https://token-service.neozip.io`)
|
|
78
|
+
3. Local Development (`http://localhost:14789`)
|
|
79
|
+
4. Custom URL
|
|
80
|
+
|
|
81
|
+
When you choose **Create new wallet**, the wizard shows your **recovery phrase once** and asks you to confirm you have saved it before continuing.
|
|
82
|
+
|
|
83
|
+
After a verification code is sent, enter the **6-digit code** at the prompt. Type **`r`** to resend, **`c`** to change email, or **`a`** to abort setup.
|
|
84
|
+
|
|
85
|
+
When an account is already set up, the wizard shows account status and asks whether to finish, add another account on the same or a different Token Service, delete an account, switch the active account (when multiple are saved), or **show connection JSON** (manifest + `public.json`, no secrets).
|
|
86
|
+
|
|
87
|
+
If adding an account fails (e.g. local Token Service not running), the wizard **rolls back** to your previous ready account and removes the incomplete shell. If you still have an incomplete account active, the wizard offers **continue / delete / switch to ready** instead of exiting.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Commands
|
|
92
|
+
|
|
93
|
+
All subcommands support `--json` for machine-readable stdout. Errors go to stderr; exit code is non-zero on failure.
|
|
94
|
+
|
|
95
|
+
| Command | Purpose |
|
|
96
|
+
|---------|---------|
|
|
97
|
+
| `neozip-connect` | Interactive wizard (default) |
|
|
98
|
+
| `neozip-connect wizard` | Same as no subcommand |
|
|
99
|
+
| `neozip-connect status [--verbose]` | Phase, paths; `--verbose` lists all saved accounts |
|
|
100
|
+
| `neozip-connect select --connection-id ID` | Set active connection |
|
|
101
|
+
| `neozip-connect rename --label NAME [--connection-id ID]` | Rename a saved connection |
|
|
102
|
+
| `neozip-connect dump [--connection-id ID]` | Print manifest + all `public.json` files as JSON |
|
|
103
|
+
| `neozip-connect register --email user@example.com [--resend]` | Send email OTP (`verificationDelivery: cli`, code only) |
|
|
104
|
+
| `neozip-connect verify --email user@example.com --code 123456` | Verify email → store Bearer in `secrets.enc` |
|
|
105
|
+
| `neozip-connect verify --magic-token LINK_OR_TOKEN` | Verify via pasted magic link URL, `email=…&code=…`, or opaque token |
|
|
106
|
+
| `neozip-connect phone request --phone +14155551234` | Send SMS OTP (when Token Service requires phone verification) |
|
|
107
|
+
| `neozip-connect phone verify --phone +14155551234 --code 123456` | Verify phone → store verified phone on connection |
|
|
108
|
+
| `neozip-connect wallet create --ack-backup` | Generate EOA (requires backup acknowledgment) |
|
|
109
|
+
| `neozip-connect wallet import-mnemonic --mnemonic "…"` | Import wallet from recovery phrase |
|
|
110
|
+
| `neozip-connect wallet import-key --private-key 0x…` | Import wallet from private key |
|
|
111
|
+
| `neozip-connect finish [--create-wallet]` | Link wallet + identity init (does not auto-create wallet unless `--create-wallet`) |
|
|
112
|
+
| `neozip-connect setup --email … --code …` | Verify + finish when code is already known |
|
|
113
|
+
| `neozip-connect logout` | Clear secrets for active connection |
|
|
114
|
+
| `neozip-connect delete [--connection-id ID]` | Remove a saved account from disk |
|
|
115
|
+
| `neozip-connect migrate` | Import legacy `~/.neozip/mcp/` profiles |
|
|
116
|
+
| `neozip-connect reset --force` | Delete connection + legacy profile dirs (start over) |
|
|
117
|
+
|
|
118
|
+
Reset locally:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
pnpm connect:reset --force
|
|
122
|
+
# or: bash scripts/connect-reset.sh --force
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Global flags:
|
|
126
|
+
|
|
127
|
+
- `--token-service-url URL` — override Token Service base URL
|
|
128
|
+
- `--label NAME` — optional override for the saved connection display name (interactive wizard derives this from the deployment choice)
|
|
129
|
+
- `--verbose` / `-v` — on `status`, include per-account details (label, email, phase, active marker)
|
|
130
|
+
- `--resend` — on `register`, re-send the email verification code
|
|
131
|
+
- `--magic-token` — on `verify`, accept a full magic link URL, `email=…&code=…` query string, or opaque exchange token
|
|
132
|
+
- `--connection-id ID` — target a specific saved connection (`select`, `rename`, `delete`, `dump`)
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## AI / agent flow
|
|
137
|
+
|
|
138
|
+
1. `neozip-connect register --email user@example.com --json`
|
|
139
|
+
2. User pastes OTP from email into chat (or full magic link via `verify --magic-token …`)
|
|
140
|
+
3. `neozip-connect verify --email user@example.com --code 123456 --json`
|
|
141
|
+
4. `neozip-connect wallet create --ack-backup --json` (or import-mnemonic / import-key)
|
|
142
|
+
5. `neozip-connect finish --json`
|
|
143
|
+
6. User reloads MCP in Cursor Settings
|
|
144
|
+
|
|
145
|
+
Or single step when the code is known:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
neozip-connect setup --email user@example.com --code 123456 --json
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### JSON response shape
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"success": true,
|
|
156
|
+
"phase": "awaiting_code",
|
|
157
|
+
"connectionId": "uuid",
|
|
158
|
+
"tokenServiceOrigin": "https://testnet.token-service.neozip.io",
|
|
159
|
+
"nextCommand": "neozip-connect verify --email user@example.com --code 123456",
|
|
160
|
+
"message": "Verification code sent."
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
No Bearer tokens or private keys appear in CLI output.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Migration from `~/.neozip/mcp/`
|
|
169
|
+
|
|
170
|
+
Legacy MCP-only profiles are imported automatically on first `neozip-connect status`, or manually:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
neozip-connect migrate --json
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
pnpm connect status --json
|
|
182
|
+
pnpm connect register --email you@example.com --json
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Interactive wizard (deprecated): `pnpm init` / `bash scripts/mcp-init.sh` (delegates to the same flow as bare `neozip-connect`).
|